Sqldatasource updating event to check using the debugger

30-Jan-2018 17:15 by 8 Comments

Sqldatasource updating event to check using the debugger - Camtocam ipad kostenlos

And because I am doing inserts and updates with the update code, I think this is where I am having the trouble.I need to allow an update to continue if the datakeyfield is null/empty. So some how I need to convert this null value to a zero before it gets to the sqldatasource update event.

You can, of course, use the Data Validators which I'm a big fan of (see my column on Custom Validators ).

The Data View is my first chance to touch the user's changes.

So, this week, in looking at managing updates I'm going to be looking at events on Data Views.

Best wishes, Iana the Telerik team Naming them the same as the datafields? Thanks I have done some looking into the debugger, and looking at the stack trace it seems the error is being thrown because it is trying to cast the lng Task List ID which is null, to int32.

Because this is the datakeyfield I think the update routine is expecting a value.

There is nothing of any value on the codebehind page. Mainly my problem is an error I get when I try to update a row, saying that it cannot cast a dbnull to any other type.

Hello Sheepdog, Please try naming the Update/Delete/Select parameters in your Sql Data Source control with the same name as the corresponding Data Field is called and check if it makes any difference. Even the stored procedure parameters fields are named the same. perhaps I missed one, but I just looked them over again and they look all the same.

So I click the edit button on the row, the boxes open up so I can enter data, then click the update link and BOOM.

I get an error saying that the Object cannot be cast from DBNull to other types.

So your answer wont work as I need to deal with the Updatecommand, which is what I resorted to using.

I finished last month's column, titled Dynamically Setting Parameters , with a bit of philosophy around when to use the Data View and when to use the Data Source where the two controls share functionality. When retrieving data, I want to modify the query in the Data Source because it's closest to the data I'll be retrieving.

I am using the latest Ajax Radgrid I have bound it to a SQLdatasource. The problem I am having is the record may not exist yet in the database, so the datakey field may be null.