System.Data.SqlClient.SqlException: 列名 'admin' 无效,这是怎么回事
string_username=Session["ok"].ToString();stringConnstr1=ConfigurationManager.Connecti...
string _username = Session["ok"].ToString();
string Connstr1 = ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString;
SqlConnection SqlConn = new SqlConnection(Connstr1);
SqlConn.Open();
string sql = "select * from T_download where Name="+_username;
SqlCommand cmd1 = new SqlCommand(sql, SqlConn);
SqlDataReader reader11 = cmd1.ExecuteReader();
while (reader11.Read())
{
string tjjf1 = reader11["tjjf"].ToString();
TextBox1.Text = tjjf1.ToString();
}
reader11.Close();
SqlConn.Close(); 展开
string Connstr1 = ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString;
SqlConnection SqlConn = new SqlConnection(Connstr1);
SqlConn.Open();
string sql = "select * from T_download where Name="+_username;
SqlCommand cmd1 = new SqlCommand(sql, SqlConn);
SqlDataReader reader11 = cmd1.ExecuteReader();
while (reader11.Read())
{
string tjjf1 = reader11["tjjf"].ToString();
TextBox1.Text = tjjf1.ToString();
}
reader11.Close();
SqlConn.Close(); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询