运行我的应用程序时出现错误。当我以管理员身份登录时,它工作正常。之后,当尝试以标准用户身份登录时,出现以下错误:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: The wait operation timed out
Source Error:
Line 30: {
Line 31: DataTable dt = new DataTable();
Line 32: sda.Fill(dt);
Line 33: return dt;
Line 34: }
Source File: h:\Project Code\Tickandtie_472018\App_Code\bindingControl.cs Line: 32
我已经附加了我的web.config文件和连接字符串。
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="login.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
public class bindingControl
{
string constr = "Password=password;Persist Security Info=True;User ID=tick;Initial Catalog=TickandTie;Timeout=200;Data Source=184.168";
//string constr = "Data Source=.\\SQLEXPRESS;Initial Catalog=TickandTie;Integrated Security=True";
public DataTable DataTableFill(string commandText, CommandType commandType, params SqlParameter[] parameters)
{
using (SqlConnection con = new SqlConnection(constr))
using (SqlCommand cmd = new SqlCommand(commandText, con))
{
cmd.CommandType = commandType;
cmd.Parameters.AddRange(parameters);
con.Open();
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
DataTable dt = new DataTable();
sda.Fill(dt);
return dt;
}
}
}
public DataSet DataSetFill(string commandText, CommandType commandType, params SqlParameter[] parameters)
{
using (SqlConnection con = new SqlConnection(constr))
using (SqlCommand cmd = new SqlCommand(commandText, con))
{
cmd.CommandType = commandType;
cmd.Parameters.AddRange(parameters);
con.Open();
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
DataSet ds = new DataSet();
sda.Fill(ds);
return ds;
}
}
}
(snip)-该类的第二种方法中发生错误。
这两种登录均有效,但突然看来用户登录似乎不再有效。