-
How to insert textbox values in database using ADO
How to insert textbox values in the database using ADO connections in VB
Question asked by visitor Durga Prasad.Argi
-
Junior Member
Re: How to insert textbox values in database using ADO
Could you please explain the question a bit?
-
Junior Member
Re: How to insert textbox values in database using ADO
i understand wat ur saying
first open a window form and create a textbox in the form
and create a one button and create a database for ur textbox
in button click
write a below code
dim oc as oledbconnection
oc= new loedbconnection("") \\ in brackets write the database link
dim cmd as oledbcommand
cmd=new oledbcommand("") \\ in brackets write insert command (ex:insert into tablename values('" & textbox1.text & "')",oc)
try
oc.open()
cmd.executenonquery()
catch e as exception
if(oc.state=connectionstate.open) then
oc.close()
now u enter data intextbox and click button
the data is displayed in ur database
ok bye
-
Junior Member
Re: How to insert textbox values in database using ADO
dim oc as oledbconnection
oc= new loedbconnection("") \\ in brackets write the database link
dim cmd as oledbcommand
cmd=new oledbcommand <<<< could also change this part to call a stored procedure ... and then below execute the name of the stored proc, to make server the work for you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules