View Full Version : حل مشکل برنامه با ریستور کردن بانک
r_mehrizi
شنبه 29 آبان 1389, 09:20 صبح
برنامه بعد از این که چند بار تحت شبکه با اون کار میشه خطا میده حتما باید بانک را ریستور کنم تا برنامه درست کار کنه دلیلش چیه خواهشا راهنمایی کنید چون خیلی ضروری هستش
حمیدرضاصادقیان
شنبه 29 آبان 1389, 09:37 صبح
سلام. لطفا پیغام خطا رو قرار بدید تا ببینیم مشکل چی هست.
r_mehrizi
شنبه 29 آبان 1389, 10:09 صبح
کدم را به این شکل نوشتم
DataTable dt = new DataTable();
BLUser obj1 = new BLUser();
string pwd = FormsAuthentication.HashPasswordForStoringInConfig File(txt_password.Text.Trim(), "md5");
dt = obj1.Login(txt_username.Text.Trim(),pwd);
if (dt.Rows.Count == 1)
{
string str_sex = string.Empty;
if (dt.Rows[0].Field<bool>("u_sex"))
{
str_sex = "خانم";
}
else
{
str_sex = "آقای";
}
public static DataTable Login(string userUserName, string userPassword)
{
SqlParameter[] param = new SqlParameter[]
{
new SqlParameter("@username",userUserName),
new SqlParameter("@pwd",userPassword)
};
return OperateGetDataTable("sp_tbl_user_Login", ref param);
}
public static DataTable OperateGetDataTable(string StoredProcedureName, ref SqlParameter[] SqlParameters)
{
try
{
SqlDataAdapter cmd = new SqlDataAdapter(StoredProcedureName, con);
cmd.SelectCommand.Parameters.Clear();
cmd.SelectCommand.Parameters.AddRange(SqlParameter s);
cmd.SelectCommand.CommandType = CommandType.StoredProcedure;
DataTable ds = new DataTable();
cmd.SelectCommand.CommandTimeout = 50000;
cmd.Fill(ds);
return ds;
}
catch (Exception ex )
{
//string exMsg = "Message:" + ex.Message + " Source:" + ex.Source + " StackTrace:" + ex.StackTrace;
//TextWriter tw = new StreamWriter(@"c:\inetpub\wwwroot\BBS\BBSDAL\Log.txt");
//tw.WriteLine(exMsg);
//tw.Close();
con.Close();
return null;
}
}
خطای زیر را میده
Server Error in '/BBS/BBS' Application.
Column 'u_sex' does not belong to table .
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.ArgumentException: Column 'u_sex' does not belong to table .
Source Error:
Line 43: string str_sex = string.Empty;
Line 44:
Line 45: if (dt.Rows[0].Field<bool>("u_sex"))
Line 46: {
Line 47: str_sex = "خانم";
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.