1.11M Members

vb.net with microsoft sql server


how to connect a vb.net form to microsoft sql server database in coding?


Please post in .NET forum


If you are connecting to a SQL server instance on your own (trusted) computer you can use

Dim con As New SqlConnection("Server=.\SQLEXPRESS;Database=PUBS;Trusted_Connection=yes;")

If you have installed SQLEXPRESS then the above connection string is sufficient. Just replace PUBS with the appropriate database name. If you need other strings you can find them here

This article has been dead for over six months: Start a new discussion instead
Start New Discussion
Tags Related to this Article