converting String to uniqueidentifier

From: Sandra (anonymous_at_discussions.microsoft.com)
Date: 02/24/04


Date: Tue, 24 Feb 2004 13:46:06 -0800

I am trying to convert a string into a uniqueidentifier by using the following code:

string contrID = Request.Params["oId"]
SqlGuid sqlID = SqlGuid.Parse(contrID)

I am then putting sqlID into my SQL WHERE clause so it only pulls that record. I've double checked that the record I'm trying to pull is in the database. I am getting the error below. I don't understand what is causing it, Any Help is appreciated!!!!!!!

ArgumentNull_String Parameter name: g
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: ArgumentNull_String Parameter name: g

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: ArgumentNull_String
Parameter name: g]
   System.Guid..ctor(String g) +3415
   System.Data.SqlTypes.SqlGuid..ctor(String s) +33
   System.Data.SqlTypes.SqlGuid.Parse(String s) +19
   Contract_Contact.grid_data.GetDataset(String sortcolumn, ColumnSortDirection sortdirection)
   Contract_Contact.grid_data.Page_Load(Object sender, EventArgs e)
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +731



Relevant Pages

  • Specified argument was out of the range of valid values. Par
    ... and couldn't find error like this can any one help me in trouble with ... Parameter name: U Description: An unhandled exception ... Source Error: ... Stack Trace: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ERROR:Crystal Reports - Logon failed.
    ... An unhandled exception occurred during the execution of the ... > current web request. ... > exception can be identified using the exception stack trace below. ... > CrystalDecisions.Shared.TableLogOnInfo myLogin; ...
    (microsoft.public.dotnet.general)
  • Re: Server Error in / Application.
    ... The error looks like it could be coming from the unsupported MS Treeview ... An unhandled exception occurred during the execution of the ... > current web request. ... > be identified using the exception stack trace below. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Error problem: asp.net app trying to reference local file?
    ... An unhandled exception occurred during the execution of the ... current web request. ... can be identified using the exception stack trace below. ... sourceControl, String eventArgument) +18 ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: File or assembly name System.Xml, or one of its dependencies, was
    ... > An unhandled exception was generated during the execution of the current web ... > be identified using the exception stack trace below. ... No redirect found in host configuration file ... Attempting download of new URL ...
    (microsoft.public.dotnet.framework.aspnet)