|
hi,
let me clarify now.
string mySelectQuery = "SELECT * from Table1";
SqlConnection myConnection = new SqlConnection(connectionString);
SqlDataAdapter adpt = new SqlDataAdapter(mySelectQuery, myConnection);
dt = new DataTable();
myConnection.Open();
adpt.Fill(ds);
dt = ds.Tables[0];
dataGridView1.DataSource = dt;
myConnection.Close();
This is written on Refresh button.
Now there is another button where i written code to get only updated row from above datatable.
DataSet ds3 = new DataSet();
dt.AcceptChanges(); // dt delcared globally
ds3 = dt.GetChanges();
If I change one of the field in table1 directly from database and if i clicked on refresh button then it is showing the updated field. Now if i clicked on second button then I want only that updated row and want to store in dataset ds3.
Just let me know if i m doing any wrong from above code.
Thanks
sjs
|
|
|
|
|
sjs4u wrote: DataSet ds3 = new DataSet();
dt.AcceptChanges(); // dt delcared globally
ds3 = dt.GetChanges();
After you say AcceptChanges, there are no changes left. Hence you will get null in GetChanges method.
I suggest adding an AcceptChanges when you load your table. This way any changes maade during the program will be shown when you want to.
|
|
|
|
|
I write it after
adpt.Fill(ds)
It is showing in the dt that value is updated but when i click on 2nd button still it is not showing that perticular updated row..
Can you show it with the above example
|
|
|
|
|
see, its simple.
DataSet ds = new DataSet("DateSet");
ds.Tables.Add(new DataTable());
LoadTable(ds.Tables[0]);
ds.AcceptChanges();
ds.Tables[0].Rows.Add(50,20,10);
DataTable changedTable = ds.Tables[0].GetChanges();
|
|
|
|
|
ok thanks... I will try it
|
|
|
|
|
Read the documentation on GetChanges and AcceptChanges. Those functions do things different than what your code suggests they do.
GetChanges returns a DataSet/DataTable object with the changes in the DataSet/DataTable. It does NOT get the last set of changes from the database.
DataSet/DataTable objects keep track of which records they hold are "dirty" an need to be written back to the database. AcceptChanges tells the DataSet/DataTable object to reset all the "dirty", "new", and "deleted" flags to "original" (can't remember the actual enum names right now!) so the DataSet/DataTable thinks there are no changes to be written back to the database.
|
|
|
|
|
On wondiws 7 professional 64 bit machine. I have written an exe which will defragment particular drive and runs in system account. The exe is scheduled. whenever exe runs it gives below error.
<b>The resource loader cache doesn't have loaded MUI entry. (0x80073B01) .</b>
i have rebooted machine 2-3 times but no any luck.
Can any one tell me what is the error and why it occurs? and what is the solution?
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:31am.
|
|
|
|
|
UAC is disabled on the machine.
|
|
|
|
|
Hello,
Im near completeion of a windows app and now need to generate my .ico for the forms(and shorctcut).
Ive googled and looked around to convert\create .png into .ico but the applications I have found so far seem unable to convert my .png into
.ico while maintaing quality.
I need an app that can design all the way from 16 x 16 upto 256x256.
Is there a industry standard app that does this? or what else do you use?
thanks
|
|
|
|
|
Yes if you are trying to create icon from Image then image color some information will be lost.
So you should need to open Your image to icon Creator then Correct it as per your requirement.
If you can think then I Can.
|
|
|
|
|
I used either Paint.NET or GIMP (I can't remember which... probably GIMP) to save an image in layers. Doing so, you can create an icon with multiple resolutions in one (Winodws will choose the proper resolution depending on how big the icon being displayed is). You could probably find similar instructions by searching for "create layered application icon with GIMP" (replace with "Paint.NET" too) or something like that.
|
|
|
|
|
There is a free integrated version of Axalis Icon workshop knocking around for VS users. I found it via Scott Gu's blog, where he recommended it.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Problem Statement: How to know if unmanaged com object is deleted from memory.
Problem Description: I have unmanaged object instance in one class. When closing application this object is is destructed from other part of code. And it also comes to point where object is member of class to do some final clear stuff. When it tried to access this com object (which has already been deleted from memory) it throws memory access violation error.
Is there any way to know if this object still exist?
Thanks,
AksharRoop
|
|
|
|
|
|
I hope I atleast know this!!
The object is not null. It holds a pointer to an object. so here it is a 'dangling ptr' kind of situation.
|
|
|
|
|
Not so much "dangling pointer", but orphaned. The only way to see if it still exists is to check the pointer to it for null. If you're worried about orphaning pointers, make sure you're those pointers to other objects are null before you kill the parent object.
|
|
|
|
|
Thanks Dave, I wrote a similar reply but just happened to see that there was another comment
|
|
|
|
|
Dear friend,
Do you know any freeware event calendar develop in .NET 1.1?? It just used to show the event in month (e.g. simple version of google calendar). No need for edit. Urgently needs.
Big Thanks,
Mimi
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:31am.
|
|
|
|
|
It is not simple to change from 2.0 to 1.1. Any recommend?
|
|
|
|
|
|
How to Display value of variable in crystal report textbox run time???
|
|
|
|
|
You should use database to fatch data from forms.
If you can think then I Can.
|
|
|
|
|