2
Reply

Connect to sql server with .udl file

shimin

shimin

May 21 2008 1:08 AM
11.8k
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.
   


Answers (2)