By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,512 Members | 3,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,512 IT Pros & Developers. It's quick & easy.

In Form Load Grid is not filling

mafaisal
100+
P: 142
hello Experts

I am Using VB.Net2005

See My Code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Format_Grid()
  2.          DstMax.Clear()
  3.         StrSQL = "Select a.SlNo,a.CardID,b.Name,a.MaxLimit From CompanyLimits a,Card b," & _
  4.                  "CompanySub c Where a.CompanySubID = c.Id And a.CardId = b.Id And a.CompanySubID = " & Val(TxtId.Text) & " Order By SlNo"
  5.         Dap = New OleDb.OleDbDataAdapter(StrSQL, Con)
  6.         Dap.Fill(DstMax, "DstMax")
  7.         For i As Integer = 0 To DstMax.Tables(0).Rows.Count - 1
  8.             With DGView2
  9.                 .Rows.Add()
  10.                 .Rows(i).Cells(0).Value = DstMax.Tables(0).Rows(i).Item(0)
  11.                 .Rows(i).Cells(1).Value = DstMax.Tables(0).Rows(i).Item(1)
  12.                 .Rows(i).Cells(2).Value = DstMax.Tables(0).Rows(i).Item(2)
  13.                 .Rows(i).Cells(3).Value = DstMax.Tables(0).Rows(i).Item(3)
  14.             End With
  15.         Next
  16.     End Sub
  17.  
  18.  
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
Feb 22 '08 #1
Share this Question
Share on Google+
1 Reply


mafaisal
100+
P: 142
Hello Experts

Any Soln To This Problem,

Faisal
Feb 24 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.