M
marti
I've run into three problems trying to solve this one issue.
Using VS2005 B2 & sql server 2000, I create a sqldatasource and bind a
gridview to it. Everything looks good. However, if there is an original
value of Null in a field, the auto-generated update to the table fails
because the sql statement says "where field1 = Null" instead of "where
field1 is Null". I've pasted versions of the sql statement from
profiler to query analyzer and they all are the same, "is null" works,
"= null" fails.
So I try to change the sql statement that's sent in the
GridView_RowUpdating event using e.OldValues(FieldName). This seems to
always evaluate to Nothing, eventhough there are an appropiate count of
FieldName's within e.OldValues.Keys.
So I try to change the sql statement using SqlDatasource_Updating
event using e.Command.Parameters(i).Value , which gives a
NullReferenceException, eventhough the
e.Command.Parameters(i).ParameterName shows the correct field name.
I've tried everything I can think of, can you give me some ideas
as to some possible causes for these? Thanks for any clues!
-Jeff
Using VS2005 B2 & sql server 2000, I create a sqldatasource and bind a
gridview to it. Everything looks good. However, if there is an original
value of Null in a field, the auto-generated update to the table fails
because the sql statement says "where field1 = Null" instead of "where
field1 is Null". I've pasted versions of the sql statement from
profiler to query analyzer and they all are the same, "is null" works,
"= null" fails.
So I try to change the sql statement that's sent in the
GridView_RowUpdating event using e.OldValues(FieldName). This seems to
always evaluate to Nothing, eventhough there are an appropiate count of
FieldName's within e.OldValues.Keys.
So I try to change the sql statement using SqlDatasource_Updating
event using e.Command.Parameters(i).Value , which gives a
NullReferenceException, eventhough the
e.Command.Parameters(i).ParameterName shows the correct field name.
I've tried everything I can think of, can you give me some ideas
as to some possible causes for these? Thanks for any clues!
-Jeff