468,511 Members | 1,531 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,511 developers. It's quick & easy.

Updating data to datagridview

How can i update the data in my database directly through
datagridview....? Can anyone tell me the appropriate links and what is
the exact event in datagridview that handles it and some explanation
abut how to handle it.

what does ds.Tables[0]...ds.Tables[string name] return by the way?
What does it mean?

DatagridView.DataSource=ds.Tables[0]; // one of the statement in my
code Why?

What is a DAtaSet and DataAdapter? Some links plz.

I have successfully displayed data in the datagridview.

Jul 13 '07 #1
1 2314
See inline:

"weird0" <am********@gmail.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
How can i update the data in my database directly through
datagridview....? Can anyone tell me the appropriate links and what is
the exact event in datagridview that handles it and some explanation
abut how to handle it.
You can't do it. Assuming you are bound to a DataSet/DataTable, at the
point you want to update the database (that's up to you to decide when), you
have to pass the changed DataSet/DataTable through a data adapter,
performing the update yourself.
what does ds.Tables[0]...ds.Tables[string name] return by the way?
What does it mean?
Assuming ds is a DataSet, ds.Tables[0] will return the first DataTable
instance that the DataSet stores. The call to the string indexer on the
Tables will return the DataTable with that name.
DatagridView.DataSource=ds.Tables[0]; // one of the statement in my
code Why?
I don't know what you mean by this.
What is a DAtaSet and DataAdapter? Some links plz.
A DataSet is a set of DataTables, along with any relations
(DataRelation) between those tables. It is an in-memory representation of
data.

A DataAdapter will take a DataSet/DataTable and based on the changes
made to it, iterate through the changes and execute a command against the
underlying data source for each change in the DataTable.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
Jul 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Steve Teeples | last post: by
5 posts views Thread by JimmyKoolPantz | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.