473,386 Members | 1,766 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.

dataset - table question

I have a dataset that has 8 tables in it, (table, table1, table2, table3,
....) how can i have each table populate a seperate datagrid on my one web
form without having to put 8 seperate datagrids on my page?

I want 1 grid but have each table populate a grid on my form.
May 11 '06 #1
3 1061
I am not sure what exactly you want to do.
Bind all the 8 tables to a single datagrid ?

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"CSharpguy" <CS*******@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
I have a dataset that has 8 tables in it, (table, table1, table2, table3,
...) how can i have each table populate a seperate datagrid on my one web
form without having to put 8 seperate datagrids on my page?

I want 1 grid but have each table populate a grid on my form.

May 11 '06 #2
no,,
here is what i have,
i have my dataset it has 8 tables in it
table0, table1, table2, table3

I want to have a seperate grid for each table so table0 is shown in one
grid, table1 in another, and so on, BUT I dont want to have 8 seperate grid
controls on my page, so is there a way to loop through them all and create a
new grid for each table in my dataset?


"Swanand Mokashi" wrote:
I am not sure what exactly you want to do.
Bind all the 8 tables to a single datagrid ?

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"CSharpguy" <CS*******@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
I have a dataset that has 8 tables in it, (table, table1, table2, table3,
...) how can i have each table populate a seperate datagrid on my one web
form without having to put 8 seperate datagrids on my page?

I want 1 grid but have each table populate a grid on my form.


May 11 '06 #3
Sure --

Something like this :

You can put a placeholder control on the page (say called as placeHolder1

Now assuming your dataset name is Dataset1
Datagrid datagrid1;
foreach (DataTable dataTable in Dataset1.Tables)
{
datagrid1 = new Datagrid();
datagrid1.DataSource = dataTable;
datagrid1.DataBind();
placeHolder1.Controls.Add(datagrid1);
}

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"CSharpguy" <CS*******@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com...
no,,
here is what i have,
i have my dataset it has 8 tables in it
table0, table1, table2, table3

I want to have a seperate grid for each table so table0 is shown in one
grid, table1 in another, and so on, BUT I dont want to have 8 seperate
grid
controls on my page, so is there a way to loop through them all and create
a
new grid for each table in my dataset?


"Swanand Mokashi" wrote:
I am not sure what exactly you want to do.
Bind all the 8 tables to a single datagrid ?

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"CSharpguy" <CS*******@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
>I have a dataset that has 8 tables in it, (table, table1, table2,
>table3,
> ...) how can i have each table populate a seperate datagrid on my one
> web
> form without having to put 8 seperate datagrids on my page?
>
> I want 1 grid but have each table populate a grid on my form.
>
>


May 11 '06 #4

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

Similar topics

3
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
0
by: Neo | last post by:
I was wondering what is the "right" way to deal with datasets is. Particularly sharing DataSets between forms. Here is my situation. I have a simple Customer Database, that holds some information...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
2
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
3
by: Mojtaba Faridzad | last post by:
Hi, I am a newbie! I am wondering how DataSet keeps the data. I am using MySQL as database engine. when I use "Fill" method to set a table in DataSet, does C# retreive all data (base on Select...
1
by: stormogulen | last post by:
Hi! I'm hoping someone can help me come up with a 'best possible solution' for the following problem: I'm trying to design an addressbook, i.e a storage for adresses. I would like my adresses...
7
by: Jason Huang | last post by:
Hi, The SQL string is "select * from Customer where 0 > 1", and the DataSet should be null. Why MyDataSet.Tables.Count is 1, not 0? What kind of DataTable in this place? Thanks for help. ...
15
by: JIM.H. | last post by:
Hello, Can I send a dataset as a parameter into stored procedure and import data to a table in the stored procedure? Thanks, Jim.
2
by: Carl Summers | last post by:
I have a table in an Access database that has no sort applied in Access. When I fill a dataset with data from that table (the entire one dimensional table) my dataset is sorted differently than...
2
by: JT | last post by:
I have an SQL database with one table in it. I want to load the table into a DataSet, add new records to the DataSet, then commit the changes back to the database. Using C#.NET, the following...
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: 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: 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
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...
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
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.