473,594 Members | 2,713 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(passwor d) in 2nd column of datagrid.
The code for insert data is:
dim cmd as new oledbcommand("i nsert into table(userid,pa ssword) values('" & cmbcol1.text & "','" & txtcol2.text & "')",connection )
dim da as new oledbdataadapte r
dim ds as new dataset
da.selectcomman d=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(txtcol 2.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 2189

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

Similar topics

1
11619
by: Thayyil | last post by:
i am new with cake php ..any body can help me to insert data into database
1
7867
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
5204
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
2065
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 about how to relate excel wid database tabel
2
1560
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 cmd.CommandText = "INSERT INTO Bla bla bla"; //setting the sql conn.Open() //open database connection cmdUpdateLog.ExecuteNonQuery(); //execute the sql command
3
3749
by: bobbyze | last post by:
how to insert data into database using php with OOP structure
0
2517
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, HttpServletRequest request, HttpServletResponse response) throws Exception { MemberActionForm formbean = (MembeActionForm) form; data.Dvb user = new data.Dvb();
0
7946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7876
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8251
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8372
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8234
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
3859
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2385
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 we have to send another system
1
1478
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1210
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.