I have fill method to get data from DB to dataSet that is like
Select * from table
where (columnName = @parameter) OR (@parameter is null)
and in CS, its like
tableadapterObject.Fill(datasetObj.tableName, @parameter)
that works fine, but when I try to pass null
tableadapterObject.Fill(datasetObj.tableName, null)
It gives error.. {"Value cannot be null.\\r\\nParameter name: columnName"}
How could I Pass null value to parameter?? Any kind of help will be appreciated.
Parameters
Allow DbNull
from false
to true
. (german IDE and other parameter, but you should understand what i mean)
Change the property "AllowDBNull" to true. Please refer the below link.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.