连接局域网SQL2000数据库出错?
我用c#连接局域网中的sql2000的服务器时出错代码如下:
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;a
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace 连接局域网SQL服务器
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string str = "Server=192.168.0.86;Integrated Security=SSPI;database=pubs";
SqlConnection conn = new SqlConnection(str);
conn.Open();
if (conn.State == ConnectionState.Open)
{
MessageBox.Show("打开数据库");
}
else
{
MessageBox.Show("数据库未打开");
}
}
}
}
各位大虾帮小弟分析下原因