{"关键字 'user' 附近有语法错误。"}...求指教错误在什么地方?
stringconnectionString=@"DataSource=3S6ZWHVOXZHTX9A;InitialCatalog=TOUR_DB;Integrated...
string connectionString = @"Data Source=3S6ZWHVOXZHTX9A;Initial Catalog=TOUR_DB;Integrated Security=True";
//建立连接
SqlConnection myCnnection = new SqlConnection(connectionString);
myCnnection.Open();
//读取所输入用户名的密码
SqlCommand myCommand = myCnnection.CreateCommand();
string sql = "SELECT u_name,u_pass,u_realname,u_type From user Where(u_name=N'" + textBox1.Text.Trim() + "')";
SqlCommand tr1 = new SqlCommand(sql, myCnnection);
SqlDataReader myDataReader = tr1.ExecuteReader(); 展开
//建立连接
SqlConnection myCnnection = new SqlConnection(connectionString);
myCnnection.Open();
//读取所输入用户名的密码
SqlCommand myCommand = myCnnection.CreateCommand();
string sql = "SELECT u_name,u_pass,u_realname,u_type From user Where(u_name=N'" + textBox1.Text.Trim() + "')";
SqlCommand tr1 = new SqlCommand(sql, myCnnection);
SqlDataReader myDataReader = tr1.ExecuteReader(); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询