Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

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.storedprocedure)



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
Avatar of gamarrojgq
gamarrojgq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VBdotnet2005

ASKER

Got it to work. Thank you much