每次调试执行程序水晶报表的时候都要登陆数据库 怎样去掉登陆啊

来源:百度知道 编辑:UC知道 时间:2024/06/03 04:25:03
我用的是WINFORM做的水晶报表 每次都让我输入登陆数据库的密码 我想去掉 怎么做到????????????????

protected void Button1_Click(object sender, EventArgs e)
{
//Response.Write("select * from w_member where UserName='" + TextBox1.Text + "' and UserPass='" + TextBox2.Text + "'");
DataSet ds = MyAscx.SqlDatabase.GetDataFromDB("select * from w_member where UserName='" + TextBox1.Text + "' and UserPass='" + TextBox2.Text + "'");

if (ds != null && ds.Tables[0].Rows.Count != 0)
{
Session["Mid"] = ds.Tables[0].Rows[0]["Mid"].ToString();
//Session["UserName"] = TextBox1.Text;
//Session["UserPass"] = TextBox2.Text;
Response.Redirect("user_index.aspx");
}
else
{
Response.Write("<script>alert('密码或用户名不对')</script>");
}