null /dbnull ???

Alexou59

New Member
This is probably a stupid question but in classic ASP I had a subroutine with 3 parameters - sometimes I would specify the third parameter as Null. When I do this is ASP.NET it raises an error and tells me to change it too DBNull. But when I do that it tells me that 'DBNull is a type and cannot be used as an expression'. How do I make something null in ASP.NET???<BR><BR>thanks<BR><BR>masmtihuse DBNull.Value<BR><BR>e.g. (C#)<BR>SqlCommand myCmd = new SqlCommand("Update myTable Set myValue = http://aspmessageboard.com/archive/index.php/@NewValue, myConnection);<BR>myCmd.Parameters.Add(new SqlParameter("@NewValue",SqlDbType.VarChar));<BR>myCmd.Parameters[@NewValue].Value = DBNull.Value;<BR><BR>hope it helps<BR>- Christianthat did it, thanks
 
Back
Top