473,485 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
3 1852

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
12651
by: Mojtaba Faridzad | last post by:
Hi, Please check these lines: DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet, "mytable"); DataRow row; row = dataSet.Tables.Rows; row.BeginEdit(); row = "555";
5
2373
by: Steve B. | last post by:
A particular column in my Access DB table, and the associated datagrid, cannot have duplicate string entries. I've selected "Yes (no duplicates)" for the Indexed Field Property of this column in...
4
1996
by: CaptRR | last post by:
I think this is the right group to post to, so here goes. My problem is this, I cannot update the datarow to save my life. Been on this for 2 days now, and still am no closer to figuring it out...
13
2626
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value....
3
1669
by: Wanda | last post by:
I am using vb.net and have a bounded datagrid by using SQLDataAdaptor and SQLDataSet, it does show the data when it is first loaded. But when I change the data on the datagrid, it doesn't update...
1
2298
by: mivey4 | last post by:
Okay, The problem is that I have an Access Database that has the following fields: EmpID - Autonumber (PrimaryKey) AccountID - Text IssueReported - Memo DateOpened ...
11
2225
by: Siv | last post by:
Hi, I seem to be having a problem with a DataAdapter against an Access database. My app deletes 3 records runs a da.update(dt) where dt is a data.Datatable. I then proceed to update a list to...
4
1484
by: William LaMartin | last post by:
In the past, I have filled a datagrid with data from an Access database table using a data adapter and dataset, where I used the OleDbCommandBuilder to have the program create the insert, delete...
13
2424
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
0
7090
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6960
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6825
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7275
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3063
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
247
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.