updating data from data grid

mjroodt

New member
Joined
Jul 4, 2006
Messages
1
Programming Experience
Beginner
Hi, I have created a database in access and used a datagrid to display contacts. I have done that successfully but I can't seem to edit it.I'm not sure how to update the access data source. For example the first name is inputted in a text box named Contact_Forname.This gets input into the database in the table tbl_Contacts under the column Contact_Forname. But when the edit button is pressed the name appears in a text box called edit_contact_name.

So my question is how do I write the update statement to take the data om the text box called edit_contact_name to be stored in the table under the column Contact_Forname.

If I use update query in the properties part of the datasource I can't set paramaters for the text boxes that come up when edit is selected.



Here is the sql statement I used in the updatequery:

UPDATE tbl_Contact SET Contact_Forname = edit_contact_name.text Where Contact_id =edit_contact_id.text

Do I need special symbols in this sql statement or is there any instructions on how to do this. I just need a general direction as I am very new to this.

I am using visual web developer 2005 express edition.

Thanks kindly for your help :)
 
Its a shame you are using Access. Something with stored procedures is better.

Anyways, you can try this...

UPDATE your_table
SET column1 = '" & textbox1.text &"' , column2 = '" & textbox2.text & "'
WHERE your_condition
 
Hi, I have created a database in access and used a datagrid to display contacts. I have done that successfully but I can't seem to edit it.
Read the DW2 link in my signature, section on creating a simple app. Also read the DNU link in my signature to make yourself aware of a common trap
 
Back
Top