GUID Headace

H

Hennie

I have a GridView with a uniqueidentifier as DataKey.
When the selected index change of the GridView I want to update a Session
variable with the DataKey value of the selected row. I tried
Dim ProgramID As String

ProgramID = GVProgram.SelectedValue

Session("ProgramID") = ProgramID

But get error:

Error 1 Value of type 'String' cannot be converted to 'System.Guid'.



Please help



Thanks
 
H

Hans Kesting

I have a GridView with a uniqueidentifier as DataKey.
When the selected index change of the GridView I want to update a Session
variable with the DataKey value of the selected row. I tried
Dim ProgramID As String

ProgramID = GVProgram.SelectedValue

Session("ProgramID") = ProgramID

But get error:

Error 1 Value of type 'String' cannot be converted to 'System.Guid'.

Please help

Thanks

ProgramID = new Guid(GVProgram.SelectedValue)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top