how can i pass the value"null" in to the database

  • Thread starter Thread starter Karunakararao
  • Start date Start date
K

Karunakararao

Hi all

Presently i am sending data to database filed like this
"EquipmentFilterDevPrimaryId = 0"

i need Instead of "0" (NULL)i need store the data null value

how can i pass this null value

pls check that

if(txtDeviceCategory.Text != "")

{usi.EquipmentFilterDevPrimaryId = (long.Parse(txtDeviceCategory.Text));}

else{usi.EquipmentFilterDevPrimaryId = 0;}
 
Hi Karunakararao,

The null value in a database is DBNull.Value, you can pass that.
 
Hi,

I am not sure about it but if you dont set the value and in the Database
null values is allowed, then does it write Null in database.

Hope this helps.
rawCoder
 
Back
Top