getting error in nested grid view control

hi guys i am getting problem in nested grid view

<asp:GridView ID="GridViewCategory"
        CellSpacing="2" ForeColor="#42301c" Font-Bold="true" Width="940px" GridLines="None"
         AllowPaging="True"
         OnRowDataBound="InnerGridViewLessons_RowDataBound"
         DataKeyNames="QuestionSubjectID"
        AutoGenerateColumns="False" runat="server" BackColor="White"
         BackImageUrl="images/hdngbar_lc.jpg" CellPadding="4">
    <Columns>                                
        <asp:TemplateField HeaderText="Subject Name" >
            <ItemTemplate>
                <asp:Label runat="server" id="lblQuestionSubjectDesc" Font-Bold="True" Text=<%#Eval("QuestionSubjectDesc")%>></asp:Label>
               
                  <asp:GridView ID="InnerGridViewLessons" runat="server" CellPadding="4" Width="100%"                      
                       
                       BorderStyle="Solid" BorderWidth="1px" Font-Size="8pt"
                       BorderColor="#336699" GridLines="Horizontal">
                       <HeaderStyle BackColor="#336699" Font-Bold="True" ForeColor="White" />
                   </asp:GridView>
                             
            </ItemTemplate>
       <%-- <asp:BoundField DataField="QuestionSubjectDesc" HeaderText="Subject Name"  SortExpression="QuestionSubjectDesc" ShowHeader="False"  />--%>
        </asp:TemplateField>                            
         
    </Columns>
   
    <EmptyDataRowStyle CssClass="headingtitle" />
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" />
    <RowStyle BackColor="#F7F6F3" Font-Names="verdana" Font-Size="10pt" HorizontalAlign="Left"         />
    <EditRowStyle BackColor="#999999" />
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" />
    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />    
    <AlternatingRowStyle BackColor="#F7F6F3"  />
    </asp:GridView>

-----------------------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim Query_questionSubjects = From t In dbINAP.PEN_QuestionSubjects _
                                     Where t.QuestionSubjectDesc <> "General" _
                                     Select _
                                      t.QuestionSubjectDesc, _
                                      t.QuestionSubjectID

        GridViewCategory.DataSource = Query_questionSubjects
        GridViewCategory.DataBind()
        GridViewCategory.HeaderRow.Visible = False



    End Sub

Protected Sub InnerGridViewLessons_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridViewCategory.RowDataBound

        Dim gv As New GridView()

        gv = e.Row.FindControl("InnerGridViewLessons")

        If e.Row.DataItem Is Nothing Then
            Return
        End If
       

        If e.Row.RowType = DataControlRowType.DataRow Then


            Dim tmpstr As String = Left(e.Row.DataItem("SubSysCode").ToString, 3)

            Dim dbSrc = From t In dbINAP.Pen_Answers _
                                 Select _
                                  t.Answer

            gv.DataSource = dbSrc
            gv.DataBind()
        End If


    End Sub


please help me out i am unable to solve it

naeembhattiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Carl TawnSystems and Integration DeveloperCommented:
You haven't told us what the problem is!

Are you getting an error, incorrect data, no data, or something else?
0
naeembhattiAuthor Commented:
Exception Details: System.MissingMemberException: No default member found for type 'VB$AnonymousType_49(Of String,String)'.
Source Error:
Line 44:         Dim strSort As String = String.Empty
Line 45:
Line 46:         Dim gv As New GridView()
Line 47:         gv = e.Row.FindControl("InnerGridViewLessons")

 
0
naeembhattiAuthor Commented:
i want to get questionsubjectID from the 1st gridview
and then get results to other nested grid view
but getting problem
0
naeembhattiAuthor Commented:
If e.Row.RowType = DataControlRowType.DataRow Then
            Dim gv As GridView = e.Row.FindControl("InnerGridViewLessons")

            'Dim tmpstr As Int64 = e.Row.DataItem("QuestionSubjectID")

            Dim dbSrc = From t In dbINAP.PEN_QuestionSubjects _
                                    Where t.QuestionSubjectDesc <> "General" _
                                    And t.QuestionSubjectID = "S0001" _
                                    Select _
                                     t.QuestionSubjectDesc, _
                                     t.QuestionSubjectID
            '           Response.Write(gv.DataKeyNames)

            Dim l_QsbjID As Label = e.Row.FindControl("lblQsbjID")

            Response.Write(l_QsbjID.Text)
            gv.DataSource = dbSrc
            gv.DataBind()

            '            string value= Gridview1.DataKeys[e.Row.RowIndex]["KeyName"].ToString();

            'Dim nobj As ArrayList = e.Row.DataItem
            'Response.Write(nobj("QuestionSubjectID"))
            'Response.Write(e.Row.DataItem("QuestionSubjectID").)

        End If
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.