473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Filling a grid

I'm trying to fill a datagrid on a VB ASP web page. No data is
showing up on my grid and I'm not sure why.

The code is as follows

Dim dvMain As DataView
Dim X As Int16
Dim dtMain As New DataTable()
Dim DR As DataRow

'Note - GetDailySales is a function that successfully returns a
dataview.
'I am not worried about this.

dvMain = GetDailySales(txtUnitID.Text, "8/1/04")

dtMain.Columns.Add("Unit")
dtMain.Columns.Add("Date")
dtMain.Columns.Add("User")
dtMain.Columns.Add("Eve Deposit")
dtMain.Columns.Add("EB Desposit")
dtMain.Columns.Add("Day Deposit")
dtMain.Columns.Add("Special Deposit")
dtMain.Columns.Add("Total Deposit")
For X = 0 To dvMain.Count - 1
DR = dtMain.NewRow
DR("Unit") = dvMain(X)("Unit_ID")
DR("Date") = dvMain(X)("Business_Date")
DR("User") = dvMain(X)("User_ID")
DR("Eve Deposit") = dvMain(X)("Deposit_Eve_Amt")
DR("EB Desposit") = dvMain(X)("Deposit_EB_Amt")
DR("Day Deposit") = dvMain(X)("Deposit_Day_Amt")
DR("Special Deposit") = dvMain(X)("Deposit_Special_Amt")
DR("Total Deposit") = dvMain(X)("Deposit_Eve_Amt") +
dvMain(X)("Deposit_EB_Amt") + dvMain(X)("Deposit_Day_Amt") +
dvMain(X)("Deposit_Special_Amt")

Next
dgSummary.DataSource = dtMain
dgSummary.DataBind()
This code is in a button_click. I would expect my grid (dgSummary) to
fill up with the data, yet it doesn't.

I'm sure I'm missing something really obvious here, but it has been
more than a year since I've even looked at .Net... If anyone can tell
what I'm doing wrong, I would greatly appreciate it.

Thanks,
Jennifer
Nov 21 '05 #1
0 961

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Laphan | last post by:
Hi All I know the subject sounds strange, but please bear with me. Using ADO/ASP, I want to retrieve a list of pics from my db (which will be dynamic number of pics as a user will be uploading...
0
by: VM | last post by:
If I wanted to load an ascii file (which contains 400,000+ lines and each line is a table row) to a datatable and then display it to a datagrid, what would the best approach be? I initially had a...
6
by: Materialised | last post by:
Hi All I have been searching the net on this for the last couple of hours to no avail. I need to fill a datagridview control based on the values entered in 2 text boxes. However I cant for...
4
by: gillcleeren | last post by:
I have a datagrid that has to be filled in a WinForms application. The data comes from an Oracle database. The normal procedure would be filling a dataset, but I have the problem that there are...
1
by: WayneM | last post by:
I have compact framework app that I was trying to test out on a windows form, but I cannot get past the very first step of simply filling a DataGrid from a DataSet. My code is Dim sqlStmt As...
2
by: VMI | last post by:
I'm filling up a gridview and the underlying datatable has about 30,000 records, so it takes some time before I can see the page again with the records on the gridview. Is there any type of...
2
by: VMI | last post by:
I'm filling up a gridview and the underlying datatable has about 30,000 records, so it takes some time before I can see the page again with the records on the gridview. Is there any type of...
1
by: bebadgujar | last post by:
hi to all, i have data in large amount say like 500. now i have to show that data in grid. but in grid only 10 data shoul be displayed at a time. means i want 50 grid to disply fro 500 data....
1
mafaisal
by: mafaisal | last post by:
hello Experts I am Using VB.Net2005 See My Code Private Sub Format_Grid() DstMax.Clear() StrSQL = "Select a.SlNo,a.CardID,b.Name,a.MaxLimit From CompanyLimits a,Card...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.