|
Right before you call update on the data set, call this:
private void CommitChanges(DataSet ds)
{
foreach (DataTable dt in ds.Tables)
{
foreach (DataRow dr in ds.Tables)
{
dr.EndEdit();
}
}
}
Or, you could first subscribe to the ColumnChanged event on the table
dt.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged);
then in the event do this:
static void dt_ColumnChanged(object sender, DataColumnChangeEventArgs e)
{
e.Row.EndEdit();
}
Everything makes sense in someone's mind
modified on Wednesday, October 7, 2009 11:28 AM
|
|
|
|
|
Thanks to the both of you. Although i'm using .net 2.0 the answer from Henry Minute was correct for that i thank you.
The asnwer from KMAROIS was exactly what i was looking for. Thanks
|
|
|
|
|
Hi all..
========================================
TYPE Public_Rec IS RECORD
(user_id SETUP_TAB.user_id%TYPE,
tool SETUP_TAB.tool%TYPE,
database SETUP_TAB.database%TYPE);
========================================
FUNCTION Get (
id_ IN VARCHAR2 ) RETURN Public_Rec
IS
temp_ Public_Rec;
CURSOR get_attr IS
SELECT user_id, tool, database
FROM SETUP_TAB
WHERE id = id_;
BEGIN
OPEN get_attr;
FETCH get_attr INTO temp_;
CLOSE get_attr;
RETURN temp_;
END Get;
========================================
can any one tell me how to this function and set return value to dataset.
|
|
|
|
|
The same way you'd call a stored proc. Use ExecuteScalar if your function has a single return value.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
OracleConnection conn = new OracleConnection();
String str = "Data source=****;user ID=****;Password=****;";
conn.ConnectionString = str;
OracleCommand cmd = new OracleCommand("Setup_API.Get", conn);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter id_ = new OracleParameter();
id_.ParameterName = "id_";
id_.OracleDbType = OracleDbType.Varchar2;
id_.Value = "11";
id_.Direction = ParameterDirection.Input;
cmd.Parameters.Add(id_);
i have write this code..and can you tell me how to get return value(record) and and how to set it inti dataset.i'm new to C#,pl sql.thank you for reply my post.
|
|
|
|
|
sampath_dr wrote: i'm new to C#,pl sql.
you're new to C# and SQL ? In what context do you need to do this then ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i'm doing my indusrial training these days.To my project need it.can you help me? thank you reply my post.
|
|
|
|
|
Hi,
i have made program which takes screen-shots and crop screen image. but i want to take a screen shots like -
you can see any image or screen or in web page, there are many rectangle images, not only images, it can be anything in rectangle shape. i want to take a screen shot of each rectangle image of screen. how can i do this???
take a look at snagit software. i am developing application like this.
|
|
|
|
|
You would take a screenshot of the actual desktop, and then chop it based on the box the user drags.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
http://www.techsmith.com/download/snagittrial.asp , install it and try. and try to take a screen shot using window option.
|
|
|
|
|
yogeshdew wrote: i am developing application like this.
If it already exists; why?
Are you sure it's not enumerating the processes on the system and then capturing their windows?
|
|
|
|
|
i just want to make a clone and want to know then how anybody can do it.
|
|
|
|
|
Hi All,
I have a class named "C1" which has a property name "P1", which is declared as below in class.
Class C1
{
...
Account1[] P1;// Here Account1 is another class/type
...
}
Now i have created an object of "C1" using reflection as below.
// object
Type objTempType = Type.GetType("C1");
object objTempObject = Activator.CreateInstance(objTempType);
Now i want to set value of first item in "P1" property(An array property) of objTempObject using reflection, which i can do without reflection as per below.
objTempType.P1[0].SomeFieldinAccount1Class = SomeObjectOrValue;
Could any one of you please give me some direction on how is that possible.
I checked all the possible ways do it using property/reflection related classes in C#, also searched many sites and forums to get answer but without any success...
modified on Wednesday, August 26, 2009 5:41 AM
|
|
|
|
|
Hi
Before you can set the SomeFieldinAccount1Class property/field value you need to intialize / create the element at position 0
objTempType.P1[0] = new Account1();
|
|
|
|
|
Hello nissims,
Thanks for your reply.
i have already created the first item in P1[0](before i try setvalue thing), I just didn't want to make my post a more lengthier one, so made the code hide.
modified on Wednesday, October 7, 2009 4:23 AM
|
|
|
|
|
You can use the Array class when operating on array properties with reflection.
Using only refection, what you want to achieve is done like this:
Type objTempType = Type.GetType("C1");
object objTempObject = Activator.CreateInstance(objTempType);
PropertyInfo p1Property = objTempType.GetProperty("P1");
Array p1ArrayValue = p1Property.GetValue(objTempObject, null) as Array;
Type itemType = p1ArrayValue.GetType().GetElementType();
object itemValue = p1ArrayValue.GetValue(0);
PropertyInfo someFieldProperty = itemType.GetProperty("SomeFieldinAccount1Class");
someFieldProperty.SetValue(itemValue, SomeObjectOrValue, null);
|
|
|
|
|
Thanks Bro...
your suggestion exactly matched what i needed and was more than i expected... thanks again...
modified on Wednesday, October 7, 2009 4:23 AM
|
|
|
|
|
You welcome
|
|
|
|
|
<br />
ToolStripMenuItem firstItem = new ToolStripMenuItem("level1);<br />
for (int i = 0; i<CenterTables.Length; i++)<br />
{<br />
ToolStripMenuItem subItem = new ToolStripMenuItem(CenterTables[i]);<br />
firstItem.DropDownItems.Add(subItem);<br />
}<br />
contextMenuStrip1.Items.Add(firstItem);
in the above code centertable is a string array. I am adding the element of this array as sub menu/dropdown item for level1.
Now I need the following task:
1. No need to get the level1 selected item
2. need to handle the submenu seleted event
2. Need to get the sub menu/ dropdownitems that have been selected
How can I do that...
|
|
|
|
|
1st.:
Don't add event on top level item
2nd:
Yust add event handler for each sub menu
ToolStripMenuItem subItem = new ToolStripMenuItem(CenterTables[i]);
subItem.Click += new System.EventHandler(subItem_Click);
firstItem.DropDownItems.Add(subItem);
Also there is no Select Event, but Click.
3rd: You can get item in Event Handelr
This code is in event handler and gets ToolStripMenuItem from Object that is passet into event handler. So every SubItem with a can use same event handler and can be distinguished betwen them
ToolStripMenuItem mnu = sender as ToolStripMenuItem;
|
|
|
|
|
It's great!!!!
Thanks a lotz
|
|
|
|
|
Hi all,
I am searching the Internet for articles on how to query exchange server 2003, without any result.... Can anyone perhaps provide me with a starting point? Struggling to get out of the block
More specific ... query the appointment items on a specific mailbox
Many thanks in advance.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
modified on Wednesday, October 7, 2009 2:37 AM
|
|
|
|
|
Hi all,
Well I found an example: here[^], but I keep receiving an exception, more specifically:
On this line of code: WebDavResponse = (System.Net.HttpWebResponse)WebDavRequest.GetResponse();
Exception: WebException
Description: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Any ideas how I can fix this?
Many thanks again.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
When requesting to https, you need to add a certificate with the request. Add that to ClientCertificates collection of request object.
To query exchange server and get all mails from inbox, you could do something like
string serverUrl = "https://yourdomain.com/exchange/userid/inbox/"
const string xml = "<?xml version='1.0'?>" +
"<g:searchrequest xmlns:g='DAV:'>" +
"<g:sql>{0}</g:sql>" +
"</g:searchrequest>";
string query = "SELECT * FROM SCOPE('SHALLOW TRAVERSAL OF \"" + serverUrl + "\"') " + "WHERE \"DAV:isfolder\" = false";
string requestString = string.Format(xml, query);
WebHeaderCollection headers = new WebHeaderCollection();
headers.Set("Pragma", "no-cache");
headers.Set("Translate", "f");
headers.Set("Depth", "0"); WebDavRequest.Method should be SEARCH . Set the WebHeaderCollection to WebDavRequest.Headers property.
I have written a useful WEBDAV wrapper for one of our application. I can share as an article later
|
|
|
|
|
Hi Navaneeth,
Thank you for the information, really appreciate it.
N a v a n e e t h wrote: Add that to ClientCertificates collection of request object.
Hmmm ... this sounds like the difficult part ...
N a v a n e e t h wrote: I have written a useful WEBDAV wrapper for one of our application. I can share as an article later
That would be awesome!!
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|