主题:大家都帮看看吧
string connstring ="Initial Catalog =txl; Data Source =localhost; user id=sa; password =; Connect Timeout =20";
con = new SqlConnection(connstring);
try
{
con.Open();
}
catch
{
MessageBox.Show("连接数据库失败","信息");
}
string Sqlcom = "SELECT *FROM user";
SqlCommand com = new SqlCommand();
com.Connection = con;
com.CommandText = Sqlcom;
bool b_accept = false;
SqlDataReader dr = com.ExecuteReader();
while(dr.Read())
{
}
SqlDataReader dr = com.ExecuteReader();////////////////////////(在这一句显示为系统错误,到底是怎么回事,各位都帮忙看看吧)///////////////////////////
[em10]
con = new SqlConnection(connstring);
try
{
con.Open();
}
catch
{
MessageBox.Show("连接数据库失败","信息");
}
string Sqlcom = "SELECT *FROM user";
SqlCommand com = new SqlCommand();
com.Connection = con;
com.CommandText = Sqlcom;
bool b_accept = false;
SqlDataReader dr = com.ExecuteReader();
while(dr.Read())
{
}
SqlDataReader dr = com.ExecuteReader();////////////////////////(在这一句显示为系统错误,到底是怎么回事,各位都帮忙看看吧)///////////////////////////
[em10]