int jibie = 0;
protected void Button1_Click(object sender, EventArgs e)
{
if (userpasswd1.Text == "")
{
Response.Write("ÃÜÂë²»ÄÜΪ¿Õ");
}
else
{
SqlConnection conn = new SqlConnection("Data Source=NINGCHAO-PC;Initial Catalog=pets;Integrated Security=True");
SqlDataAdapter sa = new SqlDataAdapter("select * from user1 where username='" + username1.Text + "' and userpasswd='" + userpasswd1.Text + "'", conn);
DataSet ds= new DataSet();
conn.Open();
sa.Fill(ds,"sduser");
conn.Close();
if (ds.Tables[0].Rows.Count > 0)
{
jibie = int.Parse(ds.Tables[0].Rows[0]["jibie"].ToString());
Response.Redirect("/Default2.aspx");
}
else
{
Response.Write("ÃÜÂë´íÎó");
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载