Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Dim strSQL17 As String = "SELECT FeesType FROM FeeMaster WHERE Class='" & cboClass.Text & ""
            Dim DaAp17 As New SqlDataAdapter(strSQL17, con)
        Dim Dset17 As New DataTable
        DaAp17.Fill(Dset17)
 

        With Me.DataGridView2
            .Columns.Add("Regno", "RegNo")
            .Columns.Add("sname", "Name")
            .Columns.Add("Class", "Class")
            For i As Integer = 0 To Dset17.Rows.Count - 1
                .Columns.Add(i, Dset17.Rows(i).Item("FeesType"))
            Next
 
      End With
 

 
        If RBPaid.Checked = True Then
            Dim strSQL11 As String
            strSQL11 = "SELECT * FROM (SELECT  stdAdmission.Regno, stdAdmission.Sname, stdAdmission.Class , Fees_Transaction.FeeType," & _
                "Fees_Transaction.Amount_Paid FROM Fees_Transaction INNER JOIN stdAdmission ON Fees_Transaction.Regno=stdAdmission.Regno) as FT " & _
                " PIVOT (Sum(Amount_Paid) FOR FeeType in ([Jan],[Team-1]))as PVT where Class='" & cboClass.Text & "'"
 
            Dim DaAp11 As New SqlDataAdapter(strSQL11, con)
            Dim DSet11 As New DataTable
            DaAp11.Fill(DSet11)
           
            For Each dr As DataRow In DSet11.Rows
                Me.DataGridView2.Rows.Add()
                With Me.DataGridView2.Rows(Me.DataGridView2.Rows.Count - 1)
                    .Cells("Regno").Value = dr("Regno")
                    .Cells("Sname").Value = dr("Sname")
                    .Cells("Class").Value = dr("Class")
                  
 'THIS CODE ERROR---CANNOT SHOW AMOUNT PAID FOR PARTICULAR COLUMN
                    For j As Integer = 4 To DataGridView2.Columns.Count - 3
                        ' .Cells(j).Value = dr("Amount_Paid")
                    Next                End With
            Next
 
  End If
 
How CAN i Display Amount_Paid Data Form Above Query.. Please tell me..
 
[edit]Code block added - OriginalGriff[/edit]
Posted 16-Feb-13 4:53am
Edited 16-Feb-13 5:25am
(no name)1.1M
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100