VBdotnet2005
asked on
VB class
I am not sure how to create a class to insert data to ms db. I want to create parameters to 10 and then call from my Form1.vb to insert data. PleaseSee my sample below.
vb classe
1. Insert_DB class
public shared sub Insert_data(byval orderdate as string, byval address as string, etc)
...
...
...
mycon.open
mycon.createparameter(10)
mycon.addparameter(0, "@orderdate", orderdate )
etc
and then
mycon.executenonquery("my storeprocedure", commandtype.storedprocedur e)
then in my VB form1.vb
call Insert_DB
dim test as new Inset_DB
test.orderdate = "03/16/2011"
test.address = "123 test st...."
at the end then insert data to db
vb classe
1. Insert_DB class
public shared sub Insert_data(byval orderdate as string, byval address as string, etc)
...
...
...
mycon.open
mycon.createparameter(10)
mycon.addparameter(0, "@orderdate", orderdate )
etc
and then
mycon.executenonquery("my storeprocedure", commandtype.storedprocedur
then in my VB form1.vb
call Insert_DB
dim test as new Inset_DB
test.orderdate = "03/16/2011"
test.address = "123 test st...."
at the end then insert data to db
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER