עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

תקלה בsql server

Featured Replies

פורסם

אני עובד בasp.net וכאשר אני מוסיף text שמגיע מinput לתוך שדה בDB שלי , אז הוא מוסיף אחרי הטקסט עצמו כמה פסיקים

בדקתי אם הוא שונה במשהו מהinput השני והם אותו דבר

אחד מציב את הסטרינג כמו שצריך

והשני משרשר לי אליו פסיקים

משהו כזה

,,,boaz

וגם הטקסטבוקס של האימל גם עושה לי את אותו דבר

משרשר לי לאימל שמתעדכן מהaspx משרשר אותו בצורה הבאה :

avidoronb@gmail.com ,

לא מבין מה הקטע של הפסיקים

אשמח לעזרה אם מישהו נתקל, לא מצאתי על זה שום מידע בגוגל

פורסם

תרשום פה את הקוד של ההכנסה למסד נתונים

פורסם
  • מחבר

ככה אני קורא לפונקציה שעשיתי :





string n =""+ Request.Form["Fname"].ToString();
// if person not at DB than add the person
person.addPerson(isExistence, Request.Form["id"],n, Request.Form["Lname"], Request.Form["gender"],
Request.Form["month"],Request.Form["day"], Request.Form["Select1"],Request.Form["email"],Request.Form["status"],_connectionString, comm);



וזאת הפונקציה



public bool addPerson(bool isExistence, string id, string fname, string lname, string gender, string day,string month,string year, string email, string status, string connection, SqlCommand comm)
{




string date = day + "/" + month + "/" + year;


if (!isExistence)
{
string _commandStr = string.Format("insert into [Db_CrmWrk].[dbo].[Persons] values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", id, fname, lname, gender,date, email, status);


comm.CommandText = _commandStr;

comm.ExecuteNonQuery();

return true;
}
return false;
}




פורסם
  • מחבר

אוקיי אז ככה , מצאתי את השגיאה, חבר מהלימודים שאמרתי לו לעשות משהו עשה ולא שינה שם תג , אז בגלל זה הפסיקים, הוא הגיע מ2 טקסט דרופים עכשיו למה שאמרת..

אוי ויי. הקוד שלך פגיע בטירוף ל-sql injection. תלמד להשתמש בפרמטרים

מה ההבדל אם פרמטרים או בלי

לא מבין מה ההבדל , אם אני משרשר או יוצר פונקציה כזאת

אגב אני עדיין צריך לשלוח לפונקציה את התוכן של הtext boxes

פורסם

כי השימוש בפרמטרים זה הצורה הנכונה לתכנת. אחרת הקוד שלך פגיע ל-sql injection. זה אפילו לא רק עניין של אבטחה, מספיק שמישהו ירצה לשים גרש בשם המשפחה שלו מסיבה כלשהי וזה ידפוק את השאילתה.

אם אתה רוצה לדעת עוד אז תקרא כאן:

http://he.wikipedia.org/wiki/%D7%94%D7%96%D7%A8%D7%A7%D7%AA_SQL

נערך על-ידי שניצל

ארכיון

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

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.