请教VB.NET调用SQL server文件的问题
调用SQL SERVER文件,采用直接连接服务器可以连接上,如下:Public conn As SqlClient.SqlConnection = New SqlClient.SqlConnection("Data Source=lydia-pc;Initial Catalog=database1;Integrated Security=True")
但是采用如下方式直接调用数据文件却被拒绝访问,请问老师该怎样解决?
Public conn As SqlClient.SqlConnection = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbfilename=C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\database1.mdf;Integrated Security=True;connect timeout=30;User instance=True")