Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert NULL value into Stored Proc parameter datatype uniqueidentifier

Status
Not open for further replies.

abs2003

MIS
Aug 31, 2004
80
US
How can I insert NULL value into Stored Proc parameter datatype uniqueidentifier.

My stored proc
Code:
REATE PROCEDURE [bookstore_insert_WebList]
	( @ParentID 	[uniqueidentifier],
	 @MasterID 	[uniqueidentifier],
	 @ListLevel 	[int],

My code
Code:
tmpCommand.Parameters.Add(New SqlClient.SqlParameter("@ParentID", SqlDbType.UniqueIdentifier))
tmpCommand.Parameters.Add(New SqlClient.SqlParameter("@MasterID", SqlDbType.UniqueIdentifier))
.
.
.
    tmpCommand.Parameters("@ParentID").Value = vbNullString
    tmpCommand.Parameters("@MasterID").Value = vbNullString

Evidently, it can't cast 'string' into 'uniqueidentifier'

Thank you
 
1. vbNullString is not a Null value, it's an empty string.
2. See
For SQL-specific questions, you will usually get a better answer in one of the specific SQL forums

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
Essex Steam UK for steam enthusiasts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top