Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to connect vb.net with sql server. after that, how we can check whether information is properly storing. help me.
Posted

Sounds like you are a beginner to this area?

Check out these videos here; http://msdn.microsoft.com/en-gb/vbasic/ff718212[^]
 
Share this answer
 
//try this code for your sqlconnection
//first of all declare all Required object in form class
//eg. below is declarations

dim objcon as sqlclient.sqlconnection

//then on formload event add code whis is given below

objcon=new sqlclient.sqlconnection
objcon.connectionstring("datasource=sqlservername;initial catalog=databasename; integratedSecurity=True")

//your sqlconnection established here properly
// if you want to inser some values in table then look here
// double click on your insert button and write this code

private sub btninsert(bayval sender as object,byval e as eventargs) handles btninsert.click

dim objcom as new sqlclient.sqlcommand("insert into table values('"+textbox1.text+"','"+textbox2.text+"')",objcon)

objcon.open()

objcom.executenonquery()

objcon.close()


end sub

// then textbox values will be inserted successfully
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900