473,509 Members | 3,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert Data directly into database using WinForm DataGrid

31 New Member
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
Apr 5 '07 #1
0 2179

Sign in to post your reply or Sign up for a free account.

Similar topics

1
11608
by: Thayyil | last post by:
i am new with cake php ..any body can help me to insert data into database
1
7866
by: rahia307 | last post by:
hi to all i want to use Aajx in php and want to insert data into database. but i have no idea about it. if any one have idea for it please help me
1
5196
by: SuvarnaChaudhari | last post by:
Hi,Plz any one can tell me how to insert data in database through GridView,or there is no way,then plz tell me another way(I mean,should I use DetailView?but how?) Thaknk You!
3
2060
by: chirag1989 | last post by:
how can i add data to database using excel through asp actual i wanted to use datagrid but as its not supported by asp so i want to try dat by excel can any one just provide me a short code...
2
1554
chathura86
by: chathura86 | last post by:
public void insertData(String sql) { if(conn != null) { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn ; //setting the connection to sql command ...
3
3745
by: bobbyze | last post by:
how to insert data into database using php with OOP structure
0
2513
by: ghjk | last post by:
I want to insert web application data to mysql database. I'm using struts, jsp and hibernet.This is my action class. public ActionForward execute(ActionMapping mapping, ActionForm form, ...
0
7234
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,...
1
7069
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
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
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
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
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
441
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.