但在Visual Studio的服务器资源管理器中为什么却连不上?
你是Visual Studio 6.0么?你看看用TRUST CONNECTION.还有就是你的配置有问题,你是连接本机的SQLSERVER还是REMOTE的SQLSERVER?
检查下面的文件是否真确配置。File Description Location Directory
SQLLE.dll SQL Language Engine Client \program files\microsoft visual studio .net\common7\packages\debugger
SQLDBREG2.exe SQL Debug Registry Client \program files\common files\microsoft shared\sql debugging
MSSDI98.dll SQL Debugging Interface Server SQL Server \binn
SQLDBG.dll SQL Debugging Proxy/Stub Client and server \program files\common files\microsoft shared\sql debugging
你是Visual Studio 6.0么?你看看用TRUST CONNECTION.还有就是你的配置有问题,你是连接本机的SQLSERVER还是REMOTE的SQLSERVER?
检查下面的文件是否真确配置。File Description Location Directory
SQLLE.dll SQL Language Engine Client \program files\microsoft visual studio .net\common7\packages\debugger
SQLDBREG2.exe SQL Debug Registry Client \program files\common files\microsoft shared\sql debugging
MSSDI98.dll SQL Debugging Interface Server SQL Server \binn
SQLDBG.dll SQL Debugging Proxy/Stub Client and server \program files\common files\microsoft shared\sql debugging
File 文件名;
Description 功能描述;
Location 是SERVER端还是CLIENT;
Directory 文件的路径;
using System.Data;
using System.Data.SqlClient;namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
try
{
SqlConnection Conn= new SqlConnection("userid = "+"sa"+";password = "+"104"+";initial catalog = "+"master"+";data source=(local);Connect Timeout=30");
Conn.Open();
Console.Write("suceessfully");
Conn.Close();
}
catch(Exception ee)
{
Console.Write(ee.Message);
}
}
}
}
这段程序在我的C#.Net里也catch到错误,
说SQLSever不存在或拒绝访问。
用户名密码都对的。
我在查询分析器里明明能连上。
配置文件好象没错。