我在连接到我的数据库时遇到问题有人知道导致此问题的原因吗?
谢谢
代码是:
private void button1_Click(object sender, System.EventArgs e)
{
string connetionString = null;
SqlConnection cnn;
connetionString = "Data Source=UMAIR;Initial Catalog=Air.dbo;User ID=;Password=";
cnn = new SqlConnection(connetionString);
try
{
cnn.Open();
MessageBox.Show ("Connection Open ! ");
cnn.Close();
}
catch (Exception ex)
{
MessageBox.Show("Can not open connection ! ");
}
}
它总是向我显示“无法打开连接错误!”