How to insert textbox values in the database using ADO connections in VB
[b]Question asked by visitor Durga Prasad.Argi[/b]
Printable View
How to insert textbox values in the database using ADO connections in VB
[b]Question asked by visitor Durga Prasad.Argi[/b]
Could you please explain the question a bit?
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
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.