Can anyone guide me into using the detailsView's built in feauture Update and Delete

ImDaFrEaK

Well-known member
Joined
Jan 7, 2006
Messages
416
Location
California
Programming Experience
5-10
I have added a Details View to my webform and then configured my Datasource to read a table from my form. I clicked advanced while configuring it and chose to Generate Update and Delete SQL Statements for me automatically. When I run the webpage everything works great as far as surfing through the data or editing it but when I try to delete a column or insert a new column I always get an error. I havn't written any code. I am just using the DetailsView and DataSource the way I was told to on an asp.net video. My crap don't work. I think this will be easier to do by hand but I shouldn't have to write these simple commands by hand if it's built in right?
 
Sorry bout that. One error I am getting now is
Incorrect syntax near 'nvarchar'.

I don't have any nvarchar in my table. It is a simple table with 5 specs.

"Title = Bills"
ID
Rent
Car Loan
Insurance
Morgage

I wrote it just for testing so it's a pointless table. Anyways. I drag the table Bills to the form in which a DataGrid is produced for me. I can use the edit, update, and delete functions fine for this but all I choose is Selection.

Then I add a DetailsView to my form and configure a new DataSource which reads all the information from the same table at whichever ID the is selected on the DataGrid. You know how to set those options and all that works fine. The DetailsView will update to show the information for whatever row I select in the DataGrid.

I get the error when I use the Delete or Insert commands with the DetailsView. That is one of the errors I get up top. The one I'm pinnin on for now. I wrote no code to do this, all visually setup with the DataSource Objects and I have no nvarchar in my table.
 
Back
Top