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

bind a dynamically created dataTable to a repeater

Hi alll,

How can I bind a dynamically created dataTable to a repeater? I do not know
the number of columns and the column names at design time. I try to do the
same thing as for datagrid:
Repeater1.DataSource = values;
Repeater1.DataBind();
but it does not return anything.

Thanks.
Frank
Nov 17 '05 #1
2 7446
The datagrid should work.

DataGrid1.AutoGenerateColumns = true;
DataGrid1.DataSource = values;
DataGrid1.DataBind();

Make sure you set the autogeneratecolumns to true.

bill

"Frank" <fr*******@yahoo.com> wrote in message
news:uz*************@TK2MSFTNGP10.phx.gbl...
Hi alll,

How can I bind a dynamically created dataTable to a repeater? I do not know the number of columns and the column names at design time. I try to do the
same thing as for datagrid:
Repeater1.DataSource = values;
Repeater1.DataBind();
but it does not return anything.

Thanks.
Frank

Nov 17 '05 #2
Maybe I did not make it clear. It works for datagrid, but not work for
repeater.

Thanks a lot.
Frank

"William F. Robertson, Jr." <wf*********@kpmg.com> wrote in message
news:ut**************@tk2msftngp13.phx.gbl...
The datagrid should work.

DataGrid1.AutoGenerateColumns = true;
DataGrid1.DataSource = values;
DataGrid1.DataBind();

Make sure you set the autogeneratecolumns to true.

bill

"Frank" <fr*******@yahoo.com> wrote in message
news:uz*************@TK2MSFTNGP10.phx.gbl...
Hi alll,

How can I bind a dynamically created dataTable to a repeater? I do not

know
the number of columns and the column names at design time. I try to do the same thing as for datagrid:
Repeater1.DataSource = values;
Repeater1.DataBind();
but it does not return anything.

Thanks.
Frank


Nov 17 '05 #3

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

Similar topics

0
by: John Crowley | last post by:
I'm having an odd problem with viewstate and a dynamically created control inside a repeater template. Basically, I have a repeater setup like this in the aspx:
6
by: Zenobia | last post by:
Hello folks, How do I bind an array to a repeater? or bind an array to a hyperlink (which is repeated inside a repeater) ? I get this message: Compiler Error Message: BC30456: 'DataItem'...
2
by: A Traveler | last post by:
Hi, I have a custom collection class i wrote, LineItemsCollection, which is a strongly typed collection of objects of my LineItem class. The LineItem class is a simple class with just a couple...
5
by: Jaybuffet | last post by:
a custom object. Similar to how I bind a collection of objects to a repeater. Is there a way to bind a single object to a Table? I could use a repeater, but seems over kill for a single object....
2
by: John Haycock | last post by:
Hi All I have a user control that uses a repeater to build a list of menu links: <itemtemplate> <li> <a href='news.aspx?newsID=<%# DataBinder.Eval(Container.DataItem,"newsID") %>'> <%#...
2
by: shapper | last post by:
Hello, I am binding a Repeater as follows: Private Sub rFeedback_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles rFeedback.Load If Not Page.IsPostBack Then...
1
by: weird0 | last post by:
I have created a GridView and dynamically added data to it by creating a DataTable(as advised) and bound it with a reader. Then, assigned the DataSource of GridView to DataTable. But even that aint...
4
by: Pieter | last post by:
Hi, I want to bind a proeprty of a child object to a DataGridView, but it doesn't work. For instance: Imagen that I have an object Company, and this object company has a child object...
2
by: akshalika | last post by:
Hi, I have a repeater control. it dynamically bind textbox or dropdown base on some condition. i want to bind required field validator dynamically for validate textbox or dropdown. here is my...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.