472,374 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 1444
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.