ASP.NET中的问题,请高手指教? 15
stringstrConn=ConfigurationSettings.AppSettings["ConnectionString"];stringFinally="se...
string strConn = ConfigurationSettings.AppSettings["ConnectionString"];
string Finally="select * from admin where username=@username and password=@password";
SqlConnection myConn = new SqlConnection(strConn);
myConn.Open();
SqlCommand Sql=new SqlCommand(Finally,myConn);
Sql.Parameters.Add("@username",SqlDbType.Char,30);
Sql.Parameters.Add("@password",SqlDbType.Char,30);
Sql.Parameters["@username"].Value = username.ToString();
Sql.Parameters["@password"].Value = password.ToString();
SqlDataReader dir=Sql.ExecuteReader();
这一段语句是正确的,但是里面的,如:=@username Sql.Parameters.Add("@password",SqlDbType.Char,30);
Sql.Parameters["@username"].Value = username.ToString();中用到的SQL,我都不知道是从那儿来的,请高手指明。 展开
string Finally="select * from admin where username=@username and password=@password";
SqlConnection myConn = new SqlConnection(strConn);
myConn.Open();
SqlCommand Sql=new SqlCommand(Finally,myConn);
Sql.Parameters.Add("@username",SqlDbType.Char,30);
Sql.Parameters.Add("@password",SqlDbType.Char,30);
Sql.Parameters["@username"].Value = username.ToString();
Sql.Parameters["@password"].Value = password.ToString();
SqlDataReader dir=Sql.ExecuteReader();
这一段语句是正确的,但是里面的,如:=@username Sql.Parameters.Add("@password",SqlDbType.Char,30);
Sql.Parameters["@username"].Value = username.ToString();中用到的SQL,我都不知道是从那儿来的,请高手指明。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询