System.TypeInitializationException:";Webservice.Helper.SqlHelper“;,System.NullReferenceException
是不是配置无法从数据库获取数据 那么服务器启动调试失败的原因是什么?我已经查了很久了,希望你能救我System.TypeInitializationException:";Webservice.Helper.SqlHelper“;,System.NullReferenceException,sql,asp.net,winforms,Sql,Asp.net,Winforms,是不是配置无法从数据库获取数据 那么服务器启动调试失败的原因是什么?我已经查了很久了,希望你能救我 public static string sqlServierDBConnectString = ConfigurationManager.ConnectionStrings["datazzj"].ConnectionString; 除了报告错误的地点外,还有以下地点: public string Login_GetUserID(string username,string pwd){
public static string sqlServierDBConnectString = ConfigurationManager.ConnectionStrings["datazzj"].ConnectionString;
除了报告错误的地点外,还有以下地点:
public string Login_GetUserID(string username,string pwd){
string sqlText = @"SELECT UserId FROM [User_Shaoxie] WHERE userName=@userName and pwd = @pwd";
SqlParameter[] _param={new SqlParameter("@userName",userName),new SqlParameter("@pwd",pwd)};
Object obj;
obj= SqlParameter.ExecuteScaler(SqlHelper.sqlServierDBConnectString,CommandType.Text,sqlText,_param);
if(obj == DBNull.Value || obj == null){
obj = "NoThisMan";}
return obj.To String();
}
这是在运行时还是在单元测试期间?
new
不是有效的C关键字。我把C语言标签转换成C++。