Hi, I am a newbie in this forum.
I wanna seek help at here, if I want to connect to sqlserver using .udl file, can it?
Imports System.Data.Sqlclient
Private sub button1_click
dim conn as new SqlConnection("FILE NAME = C:\conn.udl")
conn.open
End Sub
I choose Microsoft OLE DB Provider for SQL SERVER in provider tab.
I ever read we can't connect to sql server with 'SqlConnection'
dim conn as new SqlConnection("FILE NAME = C:\conn.udl")
Thanks.
Connect to sql server with .udl file
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Dipal ChoksiRank #199 · 12K reputationPosted May 20, 2008, 9:58 PM EDT
shimin3 reputationPosted May 20, 2008, 10:25 PM EDT
So I should use oledbconnection instead of sqlconnection.
and how about if I use SqlDataAdatpter, SqlCommand, Sqldatareader, is it correct?
So what should I do if I don't want to hard code the connection string in my application.
I want user able to change the connection string. is it possible?