iulianchira
asked on
Nullable GUIDs
n my database, in one of the table I have a GUID column with allow nulls. I have a method with a Guid? parameter that inserts a new data row in the table. However when I say myNewRow.myGuidColumn = myGuid I get the following error: "Cannot implicitly convert type 'System.Guid?' to 'System.Guid'."
please use guidcolumn= system.Guid.NewGuid()
ASKER
I do not want to a new GUID, i allready have the GUID I want to insert.
but in whatever guid it should have some value.
otherwise it will insert null in guid column.
like You have created a guid
System.Guid g=System.Guid.NewGuid()
you can not use this one
System.Guid g=new System.Guid() will create guid with blank.
otherwise it will insert null in guid column.
like You have created a guid
System.Guid g=System.Guid.NewGuid()
you can not use this one
System.Guid g=new System.Guid() will create guid with blank.
ASKER
I want to have null sometimes in the column.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or in your case
myNewRow.myGuidColumn = (Guid)myGuid ;