C# 从DataView返回超时
我正在将代码从visual basic转换为C#,转换为C#的代码如下:C# 从DataView返回超时,c#,asp.net,C#,Asp.net,我正在将代码从visual basic转换为C#,转换为C#的代码如下: if (txt_Username.Text == string.Empty || txt_pwd.Text == string.Empty || txt_Installation.Text == string.Empty) { lbl_AlertDanger.Visible = true; lbl_AlertDanger.Text = "<center><strong>ER
if (txt_Username.Text == string.Empty || txt_pwd.Text == string.Empty || txt_Installation.Text == string.Empty)
{
lbl_AlertDanger.Visible = true;
lbl_AlertDanger.Text = "<center><strong>ERROR</strong> -Ingrese Credenciales</center>";
}
else if (txt_Username.Text.Length > 1 && txt_pwd.Text.Length > 1 && txt_Installation.Text.Length >= 1)
{
try
{
ds_Student_Login.SelectParameters["Installation"].DefaultValue = txt_Installation.Text.Trim();
ds_Student_Login.SelectParameters["Username"].DefaultValue = txt_Username.Text.Trim().ToLower();
ds_Student_Login.SelectParameters["Pwd"].DefaultValue = txt_pwd.Text.Trim();
ds_Student_Login.DataBind();
DataView o_Selecte_UserData = ((DataView)(ds_Student_Login.Select(DataSourceSelectArguments.Empty)));
foreach (DataRow o_UserData in o_Selecte_UserData.Table.Rows)
{
if (o_UserData["Result_Cd"] == "OK")
{
HttpCookie v_CkLastLogin = new HttpCookie("FM_LastLogin");
v_CkLastLogin.Values["Username"] = txt_Username.ToString();
v_CkLastLogin.Values["Installation"] = txt_Installation.ToString();
v_CkLastLogin.Expires = DateTime.Now.AddDays(30);
Response.Cookies.Add(v_CkLastLogin);
Session["s_Username"] = o_UserData["Username"];
Response.Redirect("LSProducts.aspx", true);
}
}
}
catch (Exception ex)
{
lbl_AlertDanger.Visible = true;
lbl_AlertDanger.Text = "<center><strong>ERROR</strong> - " + ex.Message + </center>";
}
}
上面写着:
执行超时超时。操作完成前的超时时间或服务器未响应
如果VB.net给我留下了印象,为什么要使用C#?什么是堆栈跟踪?您在
ds\u Student\u Login
中有多少记录?目前我只有一个用户
DataView o_Selecte_UserData = ((DataView)(ds_Student_Login.Select(DataSourceSelectArguments.Empty)));