machine.config文件中改成userName="system"

解决方案 »

  1.   

    很可能是你SQL版本的问题.你自己查一查.如果是Sql 2000的话,检查一下你的版本.
        SELECT @@VERSION 
    如果版本低于8.00.534,,要安装SP2.
    http://www.microsoft.com/sql/downloads/2000/sp2.asp
      

  2.   

    看一下你的SQL版本吧,好像要SP3才可以呀
    cmbList.Items.Clear(); SQLDMO.ApplicationClass app = new SQLDMO.ApplicationClass();
    SQLDMO.NameList list = app.Application.ListAvailableSQLServers();
    string server;
    for(int i=0;i<list.Count;i++)
    {
    server = list.Item(i);
    if(server==null)
    continue;
    cmbList.Items.Add(server);
    }
      

  3.   

    我的sql server就还没打补丁, 可以
    是不是你的系统比较乱了?
      

  4.   

    SQL SERVER 要装上SP2 
    如果要在下拉菜单中添加上局域网内的所有SQL SERVER服务器的话,可以调用isql.exe来完成这个工作,而不用装什么SP2
    代码如下:private void ListAllServer()
    {
    string fileName = "C:\\Program Files\\Microsoft SQL Server\\80\\Tools\\Binn\\isql.exe";
    if(System.IO.File.Exists(fileName))
    {
    System.Diagnostics.ProcessStartInfo processStartInfo = new System.Diagnostics.ProcessStartInfo(fileName,"-L");
    processStartInfo.UseShellExecute = false;
    processStartInfo.CreateNoWindow = true;
    processStartInfo.RedirectStandardOutput = true;
    processStartInfo.RedirectStandardError = true;
    System.Diagnostics.Process process = System.Diagnostics.Process.Start(processStartInfo);
    process.WaitForExit();
    cboServerList.Items.Clear();
    int line = 1;
    string server = null;
    while(process.StandardOutput.Peek() > -1)
    {
    server = process.StandardOutput.ReadLine().Trim();
    line +=1;
    if ( line > 6)
    {
    cboServerList.Items.Add(server);
    }
    server = null;
    }
    }
    cboServerList.Items.Remove(System.Environment.MachineName);
    cboServerList.Items.Add("localhost");
    }