I am a beginner in VB 2008 and MS SQL Server 2005. How can I connect my vb app into a database in SQL Server? Any help is greatly appreciated.

you need to import System.Data.SqlClient; then you can say this.

Dim con = new SqlConnection("Initial Catalog=DBName;Data Source=ServerName;UID=User;PWD=Pass;");
con.Open()
//Some code here
con.Close()

with that piece of code you can establish the connection and open it.

regards.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.