Hello,
I want to insert data directly into my windows form data grid and load a combobox(userid) in the 1st column of data grid,a textbox(password) in 2nd column of datagrid.
The code for insert data is:
dim cmd as new oledbcommand("insert into table(userid,password) values('" & cmbcol1.text & "','" & txtcol2.text & "')",connection)
dim da as new oledbdataadapter
dim ds as new dataset
da.selectcommand=cmd
da.fill(ds)
messagebox.show "Record Inserted successfully"
I want to insert the data into database so when the user presses the enter key in 2nd column of datagrid(txtcol2.text),the above code for inserting data is executed and cursor moves to second row of 1st column.
can anybody explain me how to achieve this in vb.net 2003 windows form?
Regards:
Danish Majid
I want to insert data directly into my windows form data grid and load a combobox(userid) in the 1st column of data grid,a textbox(password) in 2nd column of datagrid.
The code for insert data is:
dim cmd as new oledbcommand("insert into table(userid,password) values('" & cmbcol1.text & "','" & txtcol2.text & "')",connection)
dim da as new oledbdataadapter
dim ds as new dataset
da.selectcommand=cmd
da.fill(ds)
messagebox.show "Record Inserted successfully"
I want to insert the data into database so when the user presses the enter key in 2nd column of datagrid(txtcol2.text),the above code for inserting data is executed and cursor moves to second row of 1st column.
can anybody explain me how to achieve this in vb.net 2003 windows form?
Regards:
Danish Majid