i get
Incorrect syntax near 'nvarchar'.
Must declare the scalar variable "@.BookingID".
Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code. Exception Details:System.Data.SqlClient.SqlException: Incorrect syntax near 'nvarchar'.
Must declare the scalar variable "@.BookingID".
Source Error:
An unhandled exception was generated during the execution of thecurrent web request. Information regarding the origin and location ofthe exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Incorrect syntax near 'nvarchar'.
Must declare the scalar variable "@.BookingID".]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857354
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734966
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
...
i am using the Edit feature of the detailsview, seems like the datatype is wrong? ID are int (in my DB, BookingID is int), and also its readonly it should not be updating in the first place right?
----------
Any way to debug whats in "new" values? ItemUpdating? how to do it?
Can you post your code?
|||erm... its SqlDataSource controls + DetailsView, shouldn't it be automatic? i found out that some tables can work some cannot
anyway
UPDATE [Booking]SET [InventoryID] = @.InventoryID, [Username] = @.Username, [Status] = @.Status, [DateBooked] = @.DateBookedWHERE [BookingID] = @.BookingIDSELECT Booking.BookingID, Booking.InventoryID, Booking.Username, Booking.Status, Booking.DateBooked, InventoryPC.TitleAS [Inventory Title]FROM BookingINNERJOIN InventoryPCON Booking.InventoryID = InventoryPC.InventoryIDWHERE (Booking.BookingID = @.ID)the code from data source the details view is getting from... looks like thats all relavent code? what else is needed,|||
It would be best if you post all your code (page and code behind).
No comments:
Post a Comment