SqlDbType.UniqueIdentifier



I need to pass in a SqlDbType.UniqueIdentifier to a stored procedure.
I have the value in a string and I program in C#.
What is wrong with the code below?
string id = (string) ViewState["userid"];
cmd.Parameters.Add("@userID", SqlDbType.UniqueIdentifier).Value
= (System.Guid) id;

--
Arne Garvander
(I program VB.Net for fun and C# to get paid.)
.



Relevant Pages

  • RE: SQL stored procedure executing twice
    ... from one parent record to another. ... Dim stDocName As String ... My pass-thru query syntax going to stored procedure ...
    (microsoft.public.access.modulesdaovba)
  • RE: MS Query "Connections"
    ... handle that with my connection string. ... for using the stored procedure route is that it is faster. ... If you truly want to pass in the query string, ...
    (microsoft.public.excel.programming)
  • Re: XML binding advice
    ... Performance - By writing the SQL statement as a stored procedure, ... execution plan will take into account any indexes you have on the tables ... each piece you add to the string. ...
    (microsoft.public.dotnet.xml)
  • Re: TableAdapter specifing IN in the where clause for list of id
    ... And till now, there products which are huge products, they are using AD-HOC ... Since IN cannot accept a delimited string but ... Muhammad replied that I could use a stored procedure to accomplish this ... specify. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Creating A Custom Collection
    ... You'll have to get away from using multidimensional arrays. ... > string StoredProcedureName, string UserName, string TransactionType ... > stored procedure so it can walk this object to create a SqlCommand ... > send the name of the proc and the parameters object to the data layer ...
    (microsoft.public.dotnet.framework)

Loading