Posted on 2008-11-12
Medium Priority
Last Modified: 2012-05-05
On Datakeyname in Gridview properties, I have "cid, firstname"), but why this won't work?

    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged

        Dim idNum As String = Me.GridView1.SelectedDataKey.Value("cid").ToString
        Dim idNum2 As String = Me.GridView1.SelectedDataKey.Value("firstname").ToString

        Dim URL As String = [String].Concat("test.aspx?cid=", idNum & idNum2)


    End Sub
Question by:VBdotnet2005
1 Comment

Accepted Solution

M3mph15 earned 2000 total points
ID: 22946401
I don't believe that GridView1.SelectedDataKey.Value accepts a string. Maybe try something like GridView1.SelectedDataKey.Item("[name]").ToString()

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question