473,386 Members | 1,835 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,386 software developers and data experts.

Need help with populating table control with data from a data set

Hi,

I don't have much knowledge of the table control. I am basically trying to
use a table thats populated with data rows from a dataSet but currently
things aren't working for me.

below is the sample HTML that I have:

<asp:TableRow>
<asp:TableCell Text="Company" ID="CompanyCode"
Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="Paygroup" ID="PaygroupCode"
Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="paygroup descr" ID="PaygroupDescr"
Runat="server"></asp:TableCell>
</asp:TableRow>

------------

In addition, I think I need some VB code to assign the particular data rows
to the table columns, but I'm not sure of the syntax:

Table1.ID("Company") = Dr("Company")

Any help would be much appreciated.
Thanks,

Gavin

--
You've got to live and learn...
Nov 19 '05 #1
3 1491
Gavin,

If for whatever reason you are not happy with the datagrid that would do all
the work for you, you can use a repeater and setup the itemtemplate to
resemble the table row (<tr>) with the cells (<td>s) bound to the dataset
columns.

Eliyahu

"gg77" <gg**@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Hi,

I don't have much knowledge of the table control. I am basically trying to
use a table thats populated with data rows from a dataSet but currently
things aren't working for me.

below is the sample HTML that I have:

<asp:TableRow>
<asp:TableCell Text="Company" ID="CompanyCode"
Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="Paygroup" ID="PaygroupCode"
Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="paygroup descr" ID="PaygroupDescr"
Runat="server"></asp:TableCell>
</asp:TableRow>

------------

In addition, I think I need some VB code to assign the particular data rows to the table columns, but I'm not sure of the syntax:

Table1.ID("Company") = Dr("Company")

Any help would be much appreciated.
Thanks,

Gavin

--
You've got to live and learn...

Nov 19 '05 #2
Hi Eliyahu,

Thanks for your help.

Can you please give me an idea of how the syntax would kind of look using a
"repeater"?

Thanks,

Gavin
P.S.--The reason why I don't want to use a datagrid is because I'm trying to
put in logic that collapses rows when there are values of zero or null. I
don't think a datagrid can do this.
"Eliyahu Goldin" wrote:
Gavin,

If for whatever reason you are not happy with the datagrid that would do all
the work for you, you can use a repeater and setup the itemtemplate to
resemble the table row (<tr>) with the cells (<td>s) bound to the dataset
columns.

Eliyahu

"gg77" <gg**@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Hi,

I don't have much knowledge of the table control. I am basically trying to
use a table thats populated with data rows from a dataSet but currently
things aren't working for me.

below is the sample HTML that I have:

<asp:TableRow>
<asp:TableCell Text="Company" ID="CompanyCode"
Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="Paygroup" ID="PaygroupCode"
Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="paygroup descr" ID="PaygroupDescr"
Runat="server"></asp:TableCell>
</asp:TableRow>

------------

In addition, I think I need some VB code to assign the particular data

rows
to the table columns, but I'm not sure of the syntax:

Table1.ID("Company") = Dr("Company")

Any help would be much appreciated.
Thanks,

Gavin

--
You've got to live and learn...


Nov 19 '05 #3
Ok, here is a fregment taken from one of my pages.

<table id="tblCharges" width="100%" cellspacing="3"
style="table-layout:fixed;background-color:#f0ffff">
<colgroup>
<col width="3ex">
<col width="8ex" class="SelectionGridItem">
<col width="18ex" class="SelectionGridItem">
<col width="10ex" class="SelectionGridItem">
<col width="10ex" class="SelectionGridItem">
</colgroup>
<asp:Repeater Runat="server" id="dgCharges" DataSource="<%#
DSChartCharges %>" DataMember="tblChartCharges"
OnItemDataBound="dgCharges_ItemDataBound" >
<HeaderTemplate>
<tr>
<td>&nbsp;</td>
<td class="SelectionGridHeader">CPT</td>
<td class="SelectionGridHeader">Mod</td>
<td class="SelectionGridHeader">ICD-9</td>
<td class="SelectionGridHeader">ICD-9</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><span runat="server" id="lblNumber"><%#
((DataRowView)Container.DataItem) ["Rank"] %></span></td>
<td><input type="text" Runat="server" id=txtCpt
class="ChargeInput"
value='<%# ((DataRowView)Container.DataItem) ["CptCode"] %>'
onfocus="codeGotFocus()" onblur="codeLostFocus()"
onkeypress="return keyPressed();"></td>
<td><input type="text" Runat="server" id="txtMods"
class="ChargeInput"
onfocus="modsGotFocus()" onblur="modsLostFocus()"
onkeypress="return keyPressed();"></td>
<td><input type="text" Runat="server" id="txtIcd91"
class="ChargeInput"
value='<%# ((DataRowView)Container.DataItem) ["Icd91"] %>'
onfocus="codeGotFocus()" onblur="codeLostFocus()"
onkeypress="return keyPressed();"></td>
<td><input type="text" Runat="server" id="txtIcd92"
class="ChargeInput"
value='<%# ((DataRowView)Container.DataItem) ["Icd92"] %>'
onfocus="codeGotFocus()" onblur="codeLostFocus()"
onkeypress="return keyPressed();"></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table
Eliyahu

"gg77" <gg**@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
Hi Eliyahu,

Thanks for your help.

Can you please give me an idea of how the syntax would kind of look using a "repeater"?

Thanks,

Gavin
P.S.--The reason why I don't want to use a datagrid is because I'm trying to put in logic that collapses rows when there are values of zero or null. I
don't think a datagrid can do this.
"Eliyahu Goldin" wrote:
Gavin,

If for whatever reason you are not happy with the datagrid that would do all the work for you, you can use a repeater and setup the itemtemplate to
resemble the table row (<tr>) with the cells (<td>s) bound to the dataset columns.

Eliyahu

"gg77" <gg**@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Hi,

I don't have much knowledge of the table control. I am basically trying to use a table thats populated with data rows from a dataSet but currently things aren't working for me.

below is the sample HTML that I have:

<asp:TableRow>
<asp:TableCell Text="Company" ID="CompanyCode"
Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="Paygroup" ID="PaygroupCode"
Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="paygroup descr" ID="PaygroupDescr"
Runat="server"></asp:TableCell>
</asp:TableRow>

------------

In addition, I think I need some VB code to assign the particular data

rows
to the table columns, but I'm not sure of the syntax:

Table1.ID("Company") = Dr("Company")

Any help would be much appreciated.
Thanks,

Gavin

--
You've got to live and learn...


Nov 19 '05 #4

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

Similar topics

1
by: cloverme | last post by:
Hi, I need help populating a listbox from a database on a webform. I created a an access database with a table, fields and data. Then I created a WebForm in vb.net and added a DropDownList...
0
by: gg77 | last post by:
Hi, I don't have much knowledge of the table control. I am basically trying to use a table thats populated with data rows from a dataSet but currently things aren't working for me. below is...
21
by: Dan | last post by:
Hi, just ran into my first instance of a backend Access97 database not compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on compact. I've narrowed it down to the largest...
1
by: Oliver Gabriel | last post by:
Hello, i have a form with a tab control in it. the tab control has 3 pages. all three pages contain forms as children, and they all use the same table. For example, if a user now enters data in...
1
by: Al Wilkerson | last post by:
Hey, I have a Web Form with a drop down list, textbox, and search button. When click the search button an SQL server database is queried fordata. Once I have the data in a dataset I use the...
5
by: Sonu.NET | last post by:
How to sort Web.UI.WebControl.Table Control in asp.net? Please provide a sample using vb.net! Thanks, XD
1
by: Rohit111111 | last post by:
Hello How can i use the table control ,meanse i have to make rows and coloumn dynamically with proper pagination
2
by: adrin | last post by:
hello, i am a c# newbie, and i'm writing an application that requires to show some numerical data in a table(it is a distance matrix). i wonder if there is any component that serves such...
2
by: Geary | last post by:
I am porting my first traditional app to a web-based app using VS2005 and ASP.NET 2.0. I have a page that will replace a data entry form. To have complete control of layout, I want to use a table...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.