By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,853 Members | 842 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,853 IT Pros & Developers. It's quick & easy.

Need to update dataadapter from datagrid that doesn't contain field

P: n/a
I have a datagrid that is carrying all fields of a record...except one. Now
I want to update the underlying database via a dataadapter. The update is
working but the field that is "left out" is not there, of course. How do I
get that field back into the datatable for the database update?

TIA,

Larry Woods
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Why is the datagrid one record short ?
"Larry Woods" <la***@NOSPAMlwoods.com> wrote in message
news:O4**************@TK2MSFTNGP09.phx.gbl...
I have a datagrid that is carrying all fields of a record...except one. Now I want to update the underlying database via a dataadapter. The update is
working but the field that is "left out" is not there, of course. How do I get that field back into the datatable for the database update?

TIA,

Larry Woods

Nov 21 '05 #2

P: n/a
The table is created from a new row in a datagrid. The datagrid is
populated from a parameterized query. The user selects a name from a
combobox. The value is used in a parameterized query to select a group of
records related to the name (via a userid key field). Now the user adds a
record to the datagrid and I want to update the database via a dataadapter
update....BUT I need to add the userid to the new record before I write it
back to the database. That's why I need to FORCE a value into the userid
key field of the new record.

How do I do this?

TIA,

Larry Woods

"OHM ( Terry Burns )" <me@mine.com> wrote in message
news:ue**************@TK2MSFTNGP12.phx.gbl...

Why is the datagrid one record short ?
"Larry Woods" <la***@NOSPAMlwoods.com> wrote in message
news:O4**************@TK2MSFTNGP09.phx.gbl...
I have a datagrid that is carrying all fields of a record...except one. Now
I want to update the underlying database via a dataadapter. The update is working but the field that is "left out" is not there, of course. How

do I
get that field back into the datatable for the database update?

TIA,

Larry Woods


Nov 21 '05 #3

P: n/a
Forgive me, but this seems a bit of a strange way of going about this.

In essence, you need to bind the DataGrid to a table, then fill the table
using the parameterised query as you suggest. Adding a row to the DataGrid
will add it to the table, you can insert the UderID from the ValueMember on
the ComboBox and then run and Insert Command to add new records to the
database.

HTH



"Larry Woods" <la***@NOSPAMlwoods.com> wrote in message
news:eA*************@TK2MSFTNGP11.phx.gbl...
The table is created from a new row in a datagrid. The datagrid is
populated from a parameterized query. The user selects a name from a
combobox. The value is used in a parameterized query to select a group of
records related to the name (via a userid key field). Now the user adds a
record to the datagrid and I want to update the database via a dataadapter
update....BUT I need to add the userid to the new record before I write it
back to the database. That's why I need to FORCE a value into the userid
key field of the new record.

How do I do this?

TIA,

Larry Woods

"OHM ( Terry Burns )" <me@mine.com> wrote in message
news:ue**************@TK2MSFTNGP12.phx.gbl...

Why is the datagrid one record short ?
"Larry Woods" <la***@NOSPAMlwoods.com> wrote in message
news:O4**************@TK2MSFTNGP09.phx.gbl...
I have a datagrid that is carrying all fields of a record...except
one.
Now
I want to update the underlying database via a dataadapter. The
update is working but the field that is "left out" is not there, of course. How

do
I
get that field back into the datatable for the database update?

TIA,

Larry Woods



Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.