Exception שאני לא מצליח לפתור בado.net - תכנות - HWzone פורומים
עבור לתוכן
  • צור חשבון

Exception שאני לא מצליח לפתור בado.net


bdoron

Recommended Posts

תראו את התמונה צלמתי הכל אולי אתם תצליחו לראות משהו שלא ראיתי

nkgn.th.jpg

וזה הקוד שממנו אני קורא לפונקציה



if (Request.HttpMethod == "POST")
{

RegisterPerson person = new RegisterPerson();
RegisterAddress address = new RegisterAddress();
RegisterPhones phones = new RegisterPhones();
RegisterCompany company = new RegisterCompany();
RegisterEmployee emp = new RegisterEmployee();
SqlConnection _conn = new SqlConnection("Data Source=WINDOWS-PC;Initial Catalog=Db_CrmWrk;Integrated Security=True");


SqlCommand comm = new SqlCommand("", _conn);
_conn.Open();


/* *************** check if person exists ***************/
bool isExistence = person.isExistence(Request.Form["id"], comm);


// if person not at DB than add the person
person.addPerson(isExistence, Request.Form["id"], Request.Form["firstName"], Request.Form["lastName"], Request.Form["GenderDropDownList"],
Request.Form["monthDroupdownList"], Request.Form["dayDroupdownList"], Request.Form["yearDroupdownList"], Request.Form["emailaddress"], Request.Form["StatusDropDownList"], comm);


company.addCompany(isExistence, Request.Form["id"], Request.Form["companyName"], Request.Form["operateCompanyID"], Request.Form["url"], Request.Form["EmpNumberDropDownList"], comm);


// if person not at DB than add the person location







// if person not at DB than add the person phone list
phones.addPhones(isExistence,Request.Form["id"], Request.Form["phoneHome"], Request.Form["faxPhone"], Request.Form["mobile"], comm);
address.addAddress(isExistence, Request.Form["id"], Request.Form["city"], Request.Form["postalCode"],
Request.Form["street"], Request.Form["houseNumber"], Request.Form["country"], comm);
emp.StartUP(isExistence, Request.Form["id"], Request.Form["password"], Request.Form["operateCompanyID"], comm);


_conn.Close();

}

- - - תגובה אוחדה: - - -

הוא זורק לי אקספשן על הcountry לא יודע למה, אומר לי שהוא לא אותו סוג, בדקתי בשרת sql server שהם כמו שצריך

והכל ניראה פיקס ולא יודע מה נסגר למה הוא נופל

קישור לתוכן
שתף באתרים אחרים

הוא לא זורק את החריגה על ה-country, השורה שגרמה לחריגה היא זו שמסומנת באדום (הביצוע של השאילתא).

וידאת ש-houseNumber הוא אכן מספר תקני? יכול להיות שאתה צריך להעביר אותו כ-int ולא כ-string.

קישור לתוכן
שתף באתרים אחרים

מה אני יגיד לך יואב :) אתה מלך! חח

פתרתי את הבעיה, לא הבנתי למה הוא מראה את הcountry ושעה נתקעתי על זה חשבתי שאם הוא רושם לי באקספשן את השורה הזאת אז משהו לא תקין בה

עשיתי פשוט convert לסטרינג שהולך למספר בית זה הכל :)

קישור לתוכן
שתף באתרים אחרים

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

×
  • צור חדש...