
04-06-2009, 08:46
|
|
|
|
חבר מתאריך: 03.01.06
הודעות: 13
|
|
עכשיו ישנה בעיה בעדכון נתונים חזרה ל- DB
אני משתמש בעורך טקסט TinyMCE...
כאשר אני מנסה לבצע עדכון של המידע לתוך ה- DB לאחר ששיניתי אותו
בעורך הטקסט.
יש כפתור צמוד ל-GRID שתפקידו לבצע את הכנסת הנתונים המעודכנים חזרה ל- DB.
הקוד שלו הוא:
protected void btnUpdate_Click(object sender, EventArgs e)
{
string UpdateCom = string.Format("UPDATE [notesTxt] SET [note] = @note, [CategoryName]={1} WHERE [Id]={0})", Session["NoteId"], Session["NoteCategory"]);
NewLineSqlDataSource.UpdateCommand = UpdateCom;
NewLineSqlDataSource.Update();
}
לאחר הלחיצה מתקבלת הודעת השגיאה הבאה:
Server Error in '/IlanNotes' Application.
Incorrect syntax near ')'.
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.Data.SqlClient.SqlException: Incorrect syntax near ')'.
Source Error:
Line 71: string UpdateCom = string.Format("UPDATE [notesTxt] SET [note] = @note, [CategoryName]={1} WHERE [Id]={0})", Session["NoteId"], Session["NoteCategory"]);
Line 72: NewLineSqlDataSource.UpdateCommand = UpdateCom;
Line 73: NewLineSqlDataSource.Update();
Line 74: }
Line 75: }
Source File: c:\Users\asaf\Documents\Visual Studio 2008\WebSites\IlanNotes\PostPage.aspx.cs Line: 73
בדקתי מבחינת הנתונים המוכנסים לשאילתא והם בסדר ( אני מקבל את מס' ה- ID ואת שם הקטגוריה כמו שהם אכן מופיעים ב- DB ).
מה הוא רוצה ממני?? שיגע אותי ....
|