Hello,
I try to explain my problem with a simple example. I have a simple
dataset with only one datatable.
The table is also very simple: ID (pk), Name and Age.
The first query select all the records:
SELECT ID, Name, Age FROM People
The tableadapter has also another query:
SELECT ID, Name, Age FROM People
WHERE (ID = @ID) OR (@ID IS NULL)
The @ID parameter is optionl: if @ID is null, I get all the rows. If
it contains a value, the query select only the record with id=@ID.
Ok. No problem.
But... the wizard in VS2005 creates a wrong parameter in the parameter
colletion of the table adapater. The AllowDbNull property is set to
false, so the resulting method accepts an int instead of a nullable
int.
I can correct it manually. I set the property to allowdbnull = true
and the method now accepts a nullable int. All seems ok. But if I run
again the wizard, also without changing anything, the parameter is
dropped and recreated with allowdbnull = false.
Question 1: is it a bug or is by design?
Question 2: is there a way to force or freeze the property?
Thank you very much for help
Fabrizio