Datagrid Update DB?

  • Thread starter Thread starter pnp
  • Start date Start date
P

pnp

Hi all,
I have a datagrid that connects to a DataSource through ODBC and I can't
seem to make a datagrid cell update the database with the new value, when I
edit that cell... How can I do this?

Thanks in advance,
Peter
 
Hi,

You'll have to use ado.net OdbcDataAdapter.Update method on source table.
You might read about ado.net and database access in .net help files...
 
What kind of data source is it? Is it a Dataset? If its a Dataset then you have to manually get the changes from the datagrid and then update the Dataset. After you do this then use the adapter to call the update method with the Dataset.
 
Tony Almazan said:
What kind of data source is it? Is it a Dataset? If its a Dataset then
you have to manually get the changes from the datagrid and then update the
Dataset.

Actually, you can just call Update directly on the underlying table(s)
calling
dataAdapter1.Update(ds.Tables[0])
dataAdapter2.Update(ds.Tables[1])

etc
After you do this then use the adapter to call the update method with the
Dataset.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top