con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
da = new SqlDataAdapter("select password from login_master where username='"+TextBox1.Text+"'",con);
ds = new DataSet();
da.Fill(ds, "login_master");
DataTable dt = new DataTable();
dt = ds.Tables[0];
//here i have to chk database table password with textbox entered password in disconnected architecture
如何才能做到这一点......
在先进的感谢| nikhildayalapwar:Shobana16:试试这个,
con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
con.open();
string sql = "select * from login_master where username='"+TextBox1.Text + "'";
cmd = new SqlCommand(sql, conn);
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds, "login_master");
if (ds.Tables[login_master].Rows[0]["password "].ToString()== TextBox2.Text.ToString())
{
string url = "Default2.aspx";
Response.Redirect(url);
}
else
{
Response.Write("<script>alert('Invalid password');</script>");
}