I am trying to connect a VB.NET 2003 Oledbdataadapter through the wizard to a SQL Server 2005 Database, but i get an error message during the wizard.

These are my steps:
New Connection, Select provider (Microsoft OLE DB Provider for SQL Server), Select Connection: server name, log on: use windows NT integrated security, select database.
I do all these steps then click "test connection" and it is fine, but when I click "ok" and error message pops up.

"Unable to connect to database. It is only possible to connect to SQL Server Desktop Engine databases and Microsoft Access Databases with this version of visual studio."

I have attached print shots of the VB.NET 2003 Wizard and of SQL Server Management studio log on screen.

Can anyone help me?
Thanks in advance.

please help me on how to connect to sql server 2005 database and save all text on a form using vb.net.

U can use this ConnectionString :

Imports System.Data
Imports System.Data.SqlClient

Dim objcon As New SqlConnection
Dim constr As String="Data Source=.\SQLEXPRESS;AttachDbFileName=|DataDirectory|\database.mdf;_
Integrated Security=True;User Instance=True;"


U can use also this string:

Dim constr As String="Data Source=localhost;Initial Catalog=your database name;Integrated Security=SSPI"

Kourosh Nikzad

This question has already been answered. Start a new discussion instead.