hello Experts
I am Using VB.Net2005
See My Code
Tis Sub is I Call in form Load Event Then Grid is not Filling
But in Form Activate Event we call Grid Fill
I want This Sub in When Form Load Only
Also Using Datasource No Problem
But I Want this Way, Not using datasource
Any soln
Faisal
I am Using VB.Net2005
See My Code
Code:
Private Sub Format_Grid()
DstMax.Clear()
StrSQL = "Select a.SlNo,a.CardID,b.Name,a.MaxLimit From CompanyLimits a,Card b," & _
"CompanySub c Where a.CompanySubID = c.Id And a.CardId = b.Id And a.CompanySubID = " & Val(TxtId.Text) & " Order By SlNo"
Dap = New OleDb.OleDbDataAdapter(StrSQL, Con)
Dap.Fill(DstMax, "DstMax")
For i As Integer = 0 To DstMax.Tables(0).Rows.Count - 1
With DGView2
.Rows.Add()
.Rows(i).Cells(0).Value = DstMax.Tables(0).Rows(i).Item(0)
.Rows(i).Cells(1).Value = DstMax.Tables(0).Rows(i).Item(1)
.Rows(i).Cells(2).Value = DstMax.Tables(0).Rows(i).Item(2)
.Rows(i).Cells(3).Value = DstMax.Tables(0).Rows(i).Item(3)
End With
Next
End Sub
But in Form Activate Event we call Grid Fill
I want This Sub in When Form Load Only
Also Using Datasource No Problem
But I Want this Way, Not using datasource
Any soln
Faisal
Comment