pisceswzh Well-known member Joined Mar 19, 2007 Messages 96 Programming Experience 1-3 Jan 23, 2008 #1 Dim Comm As New SqlCommand("SELECT * FROM tableUser WHERE fieldName = @strName", Conn) Comm.Parameters.AddWithValue("@strName", "abc") I am just wondering how can I replace the "abc" to a DBNULL value? Thanks!
Dim Comm As New SqlCommand("SELECT * FROM tableUser WHERE fieldName = @strName", Conn) Comm.Parameters.AddWithValue("@strName", "abc") I am just wondering how can I replace the "abc" to a DBNULL value? Thanks!
JohnH VB.NET Forum Moderator Staff member Joined Dec 17, 2005 Messages 15,825 Location Norway Programming Experience 10+ Jan 23, 2008 #2 DBNULL.value Upvote 0 Downvote
cjard Well-known member Joined Apr 25, 2006 Messages 7,081 Programming Experience 10+ Jan 28, 2008 #3 i.e. Comm.Parameters.AddWithValue("@strName", DBNull.Value) Upvote 0 Downvote
pisceswzh Well-known member Joined Mar 19, 2007 Messages 96 Programming Experience 1-3 Jan 28, 2008 #4 Yes. Thank you for you both. Upvote 0 Downvote