ADO.NET – SqlParameter类
SqlParameter[] parameters = new SqlParameter[]
{
New SqlParameter("@productid",SqlDbType.Int, 4),
New SqlParameter("@itemName",SqlDbType.Varchar, 50 )
}
Parameters[0].Value = productCode;
Parameters[1].Value = DBNull.Value;
Do not confuse the notion of nullNothingnullptra null reference (Nothing in Visual Basic) in an object-oriented programming language with a DBNull object. In an object-oriented programming language, nullNothingnullptra null reference (Nothing in Visual Basic) means the absence of a reference to an object. DBNull represents an uninitialized variant or nonexistent database column.

浙公网安备 33010602011771号