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.

posted @ 2008-12-11 15:52  许晓光  阅读(1123)  评论(0)    收藏  举报