Click here to Skip to main content
13,592,891 members

Comments by Navas Khanj (Top 81 by date)

Navas Khanj 5-Dec-13 13:31pm View
   
Thanks
Navas Khanj 21-Apr-13 2:12am View
   
not try Catch
Navas Khanj 19-Apr-13 10:43am View
   
Thanks
Navas Khanj 31-Mar-13 14:25pm View
   
thanks for your valuable Replay.
Navas Khanj 31-Mar-13 13:03pm View
   
over 35
Navas Khanj 22-Mar-13 15:59pm View
   
For Example, "S100", everytime, when i click the command button, it will automatically + 1, S101
S102
Navas Khanj 22-Mar-13 15:49pm View
   
once add ID next time not increment
Navas Khanj 22-Mar-13 15:45pm View
   
hi..i want Auto INCREMENT ID Number

HEre i use Code

con.Open()
Dim query As String = "Select IsNULL(MAX(cast(SUBSTRING(F_ID,3,len(F_ID))+1,100 )) F_ID from Table2"
Dim dr As SqlClient.SqlDataReader
Dim cmd As New SqlCommand(query, con)
dr = cmd.ExecuteReader
dr.Read()
'txt_FID.Text = dr(("F_ID").ToString)

Dim result = String.Format("R{0:D3}", 100)
txt_FID.Text = result
con.Close(
Navas Khanj 21-Mar-13 17:42pm View
   
i have two data on DGV. that data want to CHART (For Example A600 Value One Chare and A700 need another Chart)
Navas Khanj 19-Mar-13 12:26pm View
   
i Get Data Form StudnetData and ADD to MarkEntry
Navas Khanj 19-Mar-13 12:24pm View
   
Mr.Maciej
Wht i need Add Missing Record for Both Table need Cross Check then only i want to Add Record.
Navas Khanj 11-Mar-13 13:50pm View
   
i need Address Column Want to After Comman one by one
Navas Khanj 9-Mar-13 9:42am View
   
thanks for your Advice
Navas Khanj 8-Mar-13 14:30pm View
   
just now only i check Vote.. i think full vote ..before..
Navas Khanj 8-Mar-13 12:17pm View
   
i move update but not work
Navas Khanj 6-Mar-13 14:06pm View
   
hi.
What I need..
txtPeriodDisplay.Text = "2" means i want Display CB1 and CB2
txtPeriodDisplay.Text = "5" means i want Display CB1,CB2,CB3,CB4,CB5
But u Code is working txtPeriodDisplay.Text = "2" means CB2 only Display..Please tell me how i do..
Navas Khanj 6-Mar-13 11:43am View
   
nice.. but i want (txtPeriodDisplay.Text = "2") means want to CB1 and CB2 Want Display.Please tell me any idea.
Navas Khanj 6-Mar-13 9:13am View
   
Table Data and Condition Data is Match means I want to CheckBox Visible is True
Navas Khanj 6-Mar-13 7:19am View
   
Thanks for Quick Replay..
Navas Khanj 6-Mar-13 7:13am View
   
i placed checkbox at Panel
Navas Khanj 6-Mar-13 6:56am View
   
hi.. above code is not working.. can u tell me any other options..
Navas Khanj 5-Mar-13 9:23am View
   
yes dear.. my Issue is Solve. your code help for my issue
Navas Khanj 5-Mar-13 3:37am View
   
thanks for your Replay..
Navas Khanj 5-Mar-13 2:50am View
   
Hi.. above code New Record Add function only working UPDate not working.. pls tell me some idea..
Navas Khanj 4-Mar-13 12:09pm View
   
above condition ok means i need update Recored

condition not match means Add New Record
Navas Khanj 4-Mar-13 10:18am View
   
Public Class Form2
Dim workbook1 As New Workbook()
Dim workbook2 As New Workbook()

Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
workbook1.LoadFromFile("D:\Data\Studnet.xlsx")
workbook2.LoadFromFile("D:\Data\Language.xlsx")
End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim sheet1 As Worksheet = workbook2.Worksheets(0)
Dim datatable As DataTable = sheet1.ExportDataTable()

Dim sheet2 As Worksheet = workbook1.CreateEmptySheet("MergeData")
sheet2.InsertDataTable(datatable, True, 1, 1)

workbook1.SaveToFile("MergeExcel.xlsx", ExcelVersion.Version2010)
System.Diagnostics.Process.Start("MergeExcel.xlsx")
End Sub
here i used this code.. but i want single sheet for language related data only want display new execl file .. Please Tell me any idea how can i do for this
Navas Khanj 24-Feb-13 9:17am View
   
Wht i need SUM from DataGridView selected cells
Navas Khanj 24-Feb-13 5:09am View
   
Thanks
Navas Khanj 23-Feb-13 14:41pm View
   
Thanks
Navas Khanj 23-Feb-13 1:54am View
   
It' s Show ERROR : Incorrect syntax near 'Substract'.
Navas Khanj 21-Feb-13 4:51am View
   
Thanks for Your Response.
Navas Khanj 21-Feb-13 4:51am View
   
Deleted
Thanks for Your Response.
Navas Khanj 21-Feb-13 3:04am View
   
Please Tell me.. how can i do
Navas Khanj 21-Feb-13 3:03am View
   
Dim strSQL1 As String = "SELECT * FROM ( SELECT [Regno], [FeeType], [SName], [AmountPaid], [Class] FROM FeeTrans) AS DT " & _
" PIVOT(SUM([AmountPaid]) FOR [FeeType] IN ([Jan],[Feb],[Mar],[Apr])) as PT WHERE Class='" & cboClass.Text & "'"
Dim DaAp1 As New SqlDataAdapter(strSQL1, con)
Dim Dset1 As New DataTable
DaAp1.Fill(Dset1)

Dset1.Columns.Add("TOTAL")
DataGridView1.DataSource = Dset1



Dim total As Integer = 0
For j1 As Integer = 0 To DataGridView1.Rows.Count - 1
For ij As Integer = 3 To DataGridView1.Columns.Count - 1
With Me.DataGridView1.Rows.GetFirstRow(Me.DataGridView1.Rows.Count - 1)
If IsDBNull(DataGridView1(ij, j1).Value) <> True Then
total = total + DataGridView1(ij, j1).Value
End If

End With
Next ij
DataGridView1.Rows(j1).Cells("TOTAL").Value = total
Next j1
HI Here I am using Full Code..
Navas Khanj 21-Feb-13 2:50am View
   
Hi Jan,feb,Mar,etc.. This Hearder Texy I am using PIVOT Table so above code is not work for this condiction..

please tell me.. any other way..
Navas Khanj 19-Feb-13 14:22pm View
   
Table
Navas Khanj 17-Feb-13 13:11pm View
   
Wht And..?
Navas Khanj 15-Feb-13 9:39am View
   
It's not Work For Seperate
Navas Khanj 14-Feb-13 14:15pm View
   
DGV headertext want to display colum3 seperate
Navas Khanj 14-Feb-13 12:04pm View
   
Thanks
Navas Khanj 11-Feb-13 16:17pm View
   
Thanks
Navas Khanj 9-Feb-13 15:02pm View
   
ok
Navas Khanj 9-Feb-13 14:59pm View
   
Dim strSQL27 As String = "SELECT [FeesType] FROM FeeMaster WHERE Class='" & cboClass.Text & "'" '
Dim DaAp27 As New SqlDataAdapter(strSQL27, con)
Dim Dset27 As New DataTable
DaAp27.Fill(Dset27)


Dim VF As Object
For i = 0 To Dset27.Rows.Count - 1
VF = Dset27.Rows(i).Item("FeesType")
' MessageBox.Show(VF)
Dim strSQL11 As String
strSQL11 = "SELECT * FROM (SELECT SA.Regno, SA.Sname, SA.Class, SA.Section , FT.FeeType," & _
" FT.Amount_Paid,SA.mobile1 FROM Fees_Transaction as FT INNER JOIN stdAdmission as SA ON FT.Regno=SA.Regno) FeeMaster" & _
" PIVOT (Sum(Amount_Paid) for FeeType in ( [" + VF + "] ))as PVT where Class='" & cboClass.Text & "'"
Dim DaAp11 As New SqlDataAdapter(strSQL11, con)
Dim DSet11 As New DataTable
DaAp11.Fill(DSet11)

DGV1.DataSource = DSet11
Next

Above Code I USE "PIVOT (Sum(Amount_Paid) for FeeType in ( [" + VF + "] ))as PVT

if any Other Way to Get Table Field..?
Navas Khanj 9-Feb-13 14:56pm View
   
i need one more help..
Navas Khanj 9-Feb-13 14:51pm View
   
Thanks
Navas Khanj 8-Feb-13 14:49pm View
   
PIVOT (Sum(Amount_Paid) for FeeType in ( [" & VF & "] ))as PVT where Class='" &
it's working ..
One more Error is I have Two Data For Exampel (Team-1, Team-2). Now DGV Column Show One Column. Frist Team-1 Data Display again Same Column Show Team-2 Data.. how to make Team-1 and Team-2 Please Tell me u Advice..
Navas Khanj 2-Feb-13 1:08am View
   
My Error Is : i declar PIVOT code in (VFeeType)that one get data from table.
my DGV Want Display
Regno SName Class (FeeType Data(VFeeType)) For Example

Regno SName Class Jan Feb Mar
how can i get (Jan Feb Mar , etc..) TableFiled want show to DGV.. Please tell me some idea how can i get..
Navas Khanj 31-Jan-13 11:27am View
   
VFeeType show error.how can I get data from database. But working code [jan],[feb] here I meson datatable file that one error please tell me how can I get data
Navas Khanj 30-Jan-13 13:06pm View
   
Dim strSQL8 As String = "select * from (select Regno, FeeType, FeeAmount, SName, Class from FeesMaster) FeesMaster PIVOT(Sum(FeeAmount) for [FeeType] in ([JAN],[FEB],[marr]))as FeeAmount where Class='" & cboClass.Text & "'"

here i use PIVOT Command it's working.. and more help
how can i change ([JAN],[FEB],[marr])) i don't want manual code that check database i use this code but not working (' + FeeType + ') please tell me u advise..
Navas Khanj 30-Jan-13 7:26am View
   
How Can i Get My Table3 Data in DGV (DGV Header Related Data want Display ) LIKE
Team-1 Team-2 BUSFEE
750 0 0
like this
Navas Khanj 30-Jan-13 7:23am View
   
I want DGV LIKE THIS

Pleae Check my TABLE 1 ,Table2 and Table 3

Regno Name Class Section Team-1 Team-2 BUSFEE
A101 AAAA I A 750 0 0
A102 BBBB I A 750 300 125
A103 CCCC I A 500 350 0
Navas Khanj 30-Jan-13 0:54am View
   
Thanks. But I need DGV header text related data want show dgv
Navas Khanj 27-Jan-13 4:54am View
   
I use DGV .columns.headertext=ds.rows(I).item(I)
Navas Khanj 27-Jan-13 3:26am View
   
select * from DailyIncome
pivot (max (IncomeAmount) for IncomeDay in ([MON],[TUE],[WED],[THU],[FRI],[SAT],[SUN])) as MaxIncomePerDay
where VendorId in ('SPIKE')
Above code mon tue... It's use manul code . But I want that my table data.
Navas Khanj 27-Jan-13 3:17am View
   
How to show
table data on DGV Header
Navas Khanj 27-Jan-13 2:03am View
   
Yes. Thanks. But I need one more help. DGV header want display table field. How can I get that suppose I add some filed use window form that also I want show DGV. please tell me how can I do for that.
Navas Khanj 26-Jan-13 11:09am View
   
Wht I need table data want to show DGV header
Navas Khanj 24-Jan-13 16:02pm View
   
Thanks
Navas Khanj 24-Jan-13 16:01pm View
   
Thanks
Navas Khanj 21-Jan-13 12:30pm View
   
UNION command show one by one Record.. but i want Like this
Regno ST_Name Amount_Paid Class Section FeeAmount
Navas Khanj 21-Jan-13 11:59am View
   
Dim strSQL4, strSQL5 As String
con.Open()
strSQL4 = "Select Regno, ST_Name, SUM(Amount_Paid) as Amount_Paid,Class,Section FROM Fees_Transaction WHERE class='" & cboClass.Text & "' GROUP By Regno, ST_Name, Class, Section"
strSQL5 = "Select Regno, SUM(FeeAmount) as FeeAmount FROM FeesMaster WHERE class='" & cboClass.Text & "' GROUP By Regno"
Dim DaAp4 As New SqlDataAdapter(strSQL4, con)
Dim DSet4 As New DataSet
DaAp4.Fill(DSet4, "Fees_Transaction")
Dim DaAp5 As New SqlDataAdapter(strSQL5, con)
Dim DSet5 As New DataSet

DSet4.Merge(DSet5, True)
DataGridView2.DataSource = DSet4.Tables(0)
con.Close()
I want Merge this two table please tell me how can i do..
Navas Khanj 21-Jan-13 11:59am View
   
Dim strSQL4, strSQL5 As String
con.Open()
strSQL4 = "Select Regno, ST_Name, SUM(Amount_Paid) as Amount_Paid,Class,Section FROM Fees_Transaction WHERE class='" & cboClass.Text & "' GROUP By Regno, ST_Name, Class, Section"
strSQL5 = "Select Regno, SUM(FeeAmount) as FeeAmount FROM FeesMaster WHERE class='" & cboClass.Text & "' GROUP By Regno"
Dim DaAp4 As New SqlDataAdapter(strSQL4, con)
Dim DSet4 As New DataSet
DaAp4.Fill(DSet4, "Fees_Transaction")
Dim DaAp5 As New SqlDataAdapter(strSQL5, con)
Dim DSet5 As New DataSet

DSet4.Merge(DSet5, True)
DataGridView2.DataSource = DSet4.Tables(0)
con.Close()
I want Merge this two table please tell me how can i do..
Navas Khanj 21-Jan-13 11:59am View
   
Dim strSQL4, strSQL5 As String
con.Open()
strSQL4 = "Select Regno, ST_Name, SUM(Amount_Paid) as Amount_Paid,Class,Section FROM Fees_Transaction WHERE class='" & cboClass.Text & "' GROUP By Regno, ST_Name, Class, Section"
strSQL5 = "Select Regno, SUM(FeeAmount) as FeeAmount FROM FeesMaster WHERE class='" & cboClass.Text & "' GROUP By Regno"
Dim DaAp4 As New SqlDataAdapter(strSQL4, con)
Dim DSet4 As New DataSet
DaAp4.Fill(DSet4, "Fees_Transaction")
Dim DaAp5 As New SqlDataAdapter(strSQL5, con)
Dim DSet5 As New DataSet

DSet4.Merge(DSet5, True)
DataGridView2.DataSource = DSet4.Tables(0)
con.Close()
I want Merge this two table please tell me how can i do..
Navas Khanj 19-Jan-13 16:07pm View
   
I try to DIdtinct also but value calculate two time
Navas Khanj 19-Jan-13 15:35pm View
   
My FeesMaster.FeeAmount Calculate Two Time.. For Example My FeeAmount Data(750 + 650)=1400 but that one not Show Correct Value on DGV It Show 2800.. But Amount_Paid is Show Correct Value on DGV.
Navas Khanj 18-Jan-13 9:59am View
   
This Join Two Table Ok.. But How to Match and Where Condition..? and TotolSum..
Navas Khanj 18-Jan-13 6:06am View
   
Hi Tanks for Yor Replay.. But Wht i want.. Table 1 and Table 3 data Show to DataGirdView.. and Table 2 Data Show to DataGridView Column Header Text..

Please Tell Me
Navas Khanj 16-Jan-13 8:58am View
   
Thanks
Navas Khanj 16-Jan-13 8:58am View
   
Thanks
Navas Khanj 16-Jan-13 8:57am View
   
Thanks
Navas Khanj 15-Jan-13 14:27pm View
   
FeesMaster : Table Data
Reg no Class Section Sname FeeType FeeAmount ID
A600 I A BBBB Team-1 750 1
A700 I A DSDSDSDSD Team-1 750 2
A900 I A PPPP Team-1 750 3
A600 I A BBBB Jan 650 4
A700 I A DSDSDSDSD Jan 650 5
A900 I A PPPP Jan 650 6


Fees_Transaction Table Data
Regno ST_Name Class Section Amount_Paid FeeType ID
A600 BBBB I A 500 Team-1 1
A900 PPPP I A 750 Team-1 2
A700 DSDSDSDSD I A 500 Team-1 3
A700 DSDSDSDSD I A 250 Team-1 4
A700 DSDSDSDSD I A 300 Jan 5
A700 DSDSDSDSD I A 350 Jan 6
A600 BBBB I A 150 Team-1 7
A900 PPPP I A 200 Jan 8

I am Using Code
Class , Section and FeeType Same Means Display I want to DataGridView Like This

Reg no ST_Name Amount_Paid FeeAmount FeeType Class Section

A700 DSDSDSDSD 650 750 Jan I A
A900 PPPP 200 650 Jan I A

But Now Display Like This

Reg no ST_Name Amount_Paid FeeAmount FeeType Class Section
A700 DSDSDSDSD 650 750 Jan I A
A700 DSDSDSDSD 650 750 Jan I A
A900 PPPP 200 650 Jan I A
A900 PPPP 200 650 Jan I A

My Code is
DataGridView1.DataSource = Nothing
DataGridView1.Rows.Clear()
DataGridView1.Columns.Clear()
Dim strSQL7 As String = "SELECT Fees_Transaction.Regno, Fees_Transaction.ST_Name, Sum(Fees_Transaction.Amount_Paid)as TotalAmountPaid, FeesMaster.FeeAmount, Fees_Transaction.FeeType, Fees_Transaction.Class, Fees_Transaction.Section FROM Fees_Transaction INNER JOIN FeesMaster ON Fees_Transaction.Regno=FeesMaster.Regno WHERE Fees_Transaction.class='" & cboClass.Text & "' and Fees_Transaction.section='" & cboSection.Text & "' and Fees_Transaction.FeeType='" & cboFeeType.Text & "' GROUP BY Fees_Transaction.Regno, Fees_Transaction.ST_Name, Fees_Transaction.FeeType, Fees_Transaction.Class, Fees_Transaction.Section, FeesMaster.FeeAmount"
Dim DaAp7 As New SqlDataAdapter(strSQL7, con)
Dim DSet7 As New DataTable
DaAp7.Fill(DSet7)

'========================================
With Me.DataGridView1
.Columns.Add("Regno", "RegNo")
.Columns.Add("ST_Name", "Student Name")
.Columns.Add("Amount_Paid", "Amount Paid")
.Columns.Add("Remaining", "Remaining")
.Columns.Add("TotalAmt", "Total Amount")
.Columns.Add("FeeType", "Fee Type")
.Columns.Add("Class", "Class")
.Columns.Add("Section", "Section")
.Columns(0).Width = 85
.Columns(1).Width = 250
.Columns(2).Width = 150
.Columns(3).Width = 150
.Columns(4).Width = 140
.Columns(5).Width = 150
.Columns(6).Width = 90
.Columns(7).Width = 90
' .AllowUserToAddRows = False
.EditMode = DataGridViewEditMode.EditProgrammatically
.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.TopCenter
End With

For Each dr As DataRow In DSet7.Rows
Me.DataGridView1.Rows.Add()
With Me.DataGridView1.Rows(Me.DataGridView1.Rows.Count - 1)
.Cells("Regno").Value = dr("Regno")
.Cells("ST_Name").Value = dr("ST_Name")
.Cells("Amount_Paid").Value = dr("TotalAmount")
'.Cells("TotalAmt").Value = dr("FeeAmount")
.Cells("FeeType").Value = dr("FeeType")
.Cells("Class").Value = dr("Class")
Navas Khanj 15-Jan-13 12:36pm View
   
Wht I need :
Regno ST_Name FeeAmount
A100 AAA 1500
A100 AAA 1500 -- This is Duplicate Data Come to DataGridView.. Why This Come to DataGridView.. Please tell me..
Navas Khanj 15-Jan-13 9:56am View
   
Hello Bert.

Really I tried..For this Code...

Dim strSQL6 As String = "SELECT FeesTransaction.Regno, FeesTransaction.ST_Name, FeesMaster.FeeAmount FROM FeesTransaction INNER JOIN FeesMaster ON FeesTransaction.Regno = FeesMaster.Regno WHERE FeesTransaction.class='" & cboClass.Text & "' and FeesTransaction.section='" & cboSection.Text & "' and FeesTransaction.FeeType='" & cboFeeType.Text & "' GROUP BY FeesTransaction.Regno, FeesTransaction.ST_Name, FeesMaster.FeeAmount"

When i Join New Table(FeesMaster) After that DataGridView Come Like this

Regno ST_Name FeeAmount
A100 AAA 1500
A100 AAA 1500


Please Wht Problem my Code.. Please Tell me..
Navas Khanj 15-Jan-13 1:27am View
   
I am Using Code this for DatagridView .. datagrid compain two talbel(Table1, Table2).
Table1 Filed is: Regno, ST_Name, AmountPaid, FeeType, Class, Section
Table2 Filed is: Regno, Sname, FeeAmount, FeeType, Class, Section. Below I used code..please tell me.. wht problem that..



Dim strSQL7 As String = "SELECT Fees_Transaction.Regno,Fees_Transaction.ST_Name,Sum(Fees_Transaction.Amount_Paid)as TotalAmountPaid,FeesMaster.FeeAmount,Fees_Transaction.FeeType,Fees_Transaction.Class,Fees_Transaction.Section FROM Fees_Transaction INNER JOIN FeesMaster ON Fees_Transaction.Regno=FeesMaster.Regno WHERE Fees_Transaction.class='" & cboClass.Text & "' and Fees_Transaction.section='" & cboSection.Text & "' and Fees_Transaction.FeeType='" & cboFeeType.Text & "' GROUP BY Fees_Transaction.Regno,Fees_Transaction.ST_Name,Fees_Transaction.FeeType,Fees_Transaction.Class,Fees_Transaction.Section,FeesMaster.FeeAmount"
Dim DaAp7 As New SqlDataAdapter(strSQL7, con)
Dim DSet7 As New DataTable
DaAp7.Fill(DSet7)
'========================================
With Me.DataGridView1
.Columns.Add("Regno", "RegNo")
.Columns.Add("ST_Name", "Student Name")
.Columns.Add("Amount_Paid", "Amount Paid")
.Columns.Add("Remaining", "Remaining")
.Columns.Add("TotalAmt", "Total Amount")
.Columns.Add("FeeType", "Fee Type")
.Columns.Add("Class", "Class")
.Columns.Add("Section", "Section")
.Columns(0).Width = 85
.Columns(1).Width = 250
.Columns(2).Width = 150
.Columns(3).Width = 150
.Columns(4).Width = 140
.Columns(5).Width = 150
.Columns(6).Width = 90
.Columns(7).Width = 90
' .AllowUserToAddRows = False
.EditMode = DataGridViewEditMode.EditProgrammatically
.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.TopCenter
End With

For Each dr As DataRow In DSet7.Rows
Me.DataGridView1.Rows.Add()
With Me.DataGridView1.Rows(Me.DataGridView1.Rows.Count - 1)
.Cells("Regno").Value = dr("Regno")
.Cells("ST_Name").Value = dr("ST_Name")
.Cells("Amount_Paid").Value = dr("TotalAmountPaid")
'.Cells("TotalAmt").Value = dr("FeeAmount")
.Cells("FeeType").Value = "Total"
.Cells("Class").Value = dr("Class")
.Cells("Section").Value = dr("Section")
End With
Next
Navas Khanj 14-Jan-13 13:14pm View
   
Table1 Name is (Fees_Transaction)

RegNO ST_Name Amount_Paid Class Section
A100 AAAA 750 I A
A200 BBBB 500 I B
A300 CCCC 800 I A
A400 DDDD 450 I A

Table2 Name is (FeesMaster)

RegNO SName TotalAmount Class Section
A100 AAAA 1500 I A
A200 BBBB 1500 I B
A300 CCCC 1500 I A
A400 DDDD 1500 I A


I Want DataGridView Like This


RegNO ST_Name PaidAmount TotalAmount Class Section
A100 AAAA 750 1500 I A
A200 BBBB 500 1500 I B
A300 CCCC 800 1500 I A
A400 DDDD 450 1500 I A
Navas Khanj 14-Jan-13 13:08pm View
   
This Code DataGridView Display 2 time .
Navas Khanj 14-Jan-13 13:08pm View
   
DataGridView1.Rows.Clear()
DataGridView1.Columns.Clear()

Dim strSQL7 As String = "SELECT Fees_Transaction.Regno,Fees_Transaction.ST_Name,Sum(Fees_Transaction.Amount_Paid)as TotalAmountPaid,FeesMaster.FeeAmount,Fees_Transaction.FeeType,Fees_Transaction.Class,Fees_Transaction.Section FROM Fees_Transaction INNER JOIN FeesMaster ON Fees_Transaction.Regno=FeesMaster.Regno WHERE Fees_Transaction.class='" & cboClass.Text & "' and Fees_Transaction.section='" & cboSection.Text & "' and Fees_Transaction.FeeType='" & cboFeeType.Text & "' GROUP BY Fees_Transaction.Regno,Fees_Transaction.ST_Name,Fees_Transaction.FeeType,Fees_Transaction.Class,Fees_Transaction.Section,FeesMaster.FeeAmount"
Dim DaAp7 As New SqlDataAdapter(strSQL7, con)
Dim DSet7 As New DataTable
DaAp7.Fill(DSet7)
'========================================
With Me.DataGridView1
.Columns.Add("Regno", "RegNo")
.Columns.Add("ST_Name", "Student Name")
.Columns.Add("Amount_Paid", "Amount Paid")
.Columns.Add("Remaining", "Remaining")
.Columns.Add("TotalAmt", "Total Amount")
.Columns.Add("FeeType", "Fee Type")
.Columns.Add("Class", "Class")
.Columns.Add("Section", "Section")
.Columns(0).Width = 85
.Columns(1).Width = 250
.Columns(2).Width = 150
.Columns(3).Width = 150
.Columns(4).Width = 140
.Columns(5).Width = 150
.Columns(6).Width = 90
.Columns(7).Width = 90
' .AllowUserToAddRows = False
.EditMode = DataGridViewEditMode.EditProgrammatically
.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.TopCenter
End With

For Each dr As DataRow In DSet7.Rows
Me.DataGridView1.Rows.Add()
With Me.DataGridView1.Rows(Me.DataGridView1.Rows.Count - 1)
.Cells("Regno").Value = dr("Regno")
.Cells("ST_Name").Value = dr("ST_Name")
.Cells("Amount_Paid").Value = dr("TotalAmountPaid")
.Cells("TotalAmt").Value = dr("FeeAmount")
.Cells("FeeType").Value = dr("FeeType")
.Cells("Class").Value = dr("Class")
.Cells("Section").Value = dr("Section")
End With
Next
i send Code for U..
Navas Khanj 14-Jan-13 11:46am View
   
I am Using this Code..
Dim strSQL6 As String = "SELECT Fees_Transaction.Regno, Fees_Transaction.ST_Name, SUM(Fees_Transaction.Amount_Paid) As TotalAmountPaid, Fees_Transaction.FeeType, Fees_Transaction.Class, Fees_Transaction.Section, FeesMaster.FeeAmount FROM Fees_Transaction INNER JOIN FeesMaster ON Fees_Transaction.Regno = FeesMaster.Regno WHERE Fees_Transaction.class='" & cboClass.Text & "' and Fees_Transaction.section='" & cboSection.Text & "' and Fees_Transaction.FeeType='" & cboFeeType.Text & "' GROUP BY Fees_Transaction.Regno, Fees_Transaction.ST_Name, Fees_Transaction.Class, Fees_Transaction.Section, Fees_Transaction.FeeType,FeesMaster.FeeAmount"
.. But DataGridView Display twice . how to slove it.. Please tell me.
Navas Khanj 14-Jan-13 3:43am View
   
Thanks
Navas Khanj 14-Jan-13 1:30am View
   
Dim strSQL6 As String = "SELECT Regno, SName, SUM(AmountPaid), FeeType, Class, Section FROM FeeTrans where class='" & cboClass.Text & "' and section='" & cboSection.Text & "' and FeeType='" & cboFeeType.Text & "' GROUP BY Regno, SName, FeeType, Class, Section"
Dim DaAp6 As New SqlDataAdapter(strSQL6, con)
Dim DSet6 As New DataTable
DaAp6.Fill(DSet6)

'========================================
With Me.DataGridView1

.Columns.Add("Regno", "RegNo")
.Columns.Add("SName", "Student Name")
.Columns.Add("AmountPaid", "Amount_Paid")
.Columns.Add("FeeType", "Fee Type")
.Columns.Add("Class", "Class")
.Columns.Add("Section", "Section")
.Columns(0).Width = 60
.Columns(1).Width = 150
.Columns(2).Width = 100
.Columns(3).Width = 100
.Columns(4).Width = 80
.Columns(5).Width = 80

' .AllowUserToAddRows = False
.EditMode = DataGridViewEditMode.EditProgrammatically
.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.TopCenter
End With

For Each dr As DataRow In DSet6.Rows
Me.DataGridView1.Rows.Add()
With Me.DataGridView1.Rows(Me.DataGridView1.Rows.Count - 1)
.Cells("Regno").Value = dr("Regno")
.Cells("SName").Value = dr("SName")
.Cells("Amount_Paid") = dr("AmountPaid")
.Cells("FeeType").Value = dr("FeeType")
.Cells("Class").Value = dr("Class")
.Cells("Section").Value = dr("Section")
End With
Next
My Error is Not Show Amount Filed in DatagridView.. Please tell me how to slove this proble.
Navas Khanj 13-Jan-13 10:53am View
   
Thanks..It's Working.. DataSet.. but when i use DataTable that time this Error Show This Line .Cells("Amount_Paid") = dr("AmountPaid") Error Is:(Column 'AmountPaid' does not belong to table .)

Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180618.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid