Solved

Create a dynamic table in ASP.net

Posted on 2006-07-13
9
196 Views
Last Modified: 2008-01-09
Hi,
I need to create a table that in Asp.net 1.1, that will have 2 colunn and X amount of rows.
I need this table to be fill from my database, and it many have one item to display or 8,9,... to display.
how can I do this in a place holder.
0
Comment
Question by:daze10
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17098870
daze10,
> I need to create a table that in Asp.net 1.1, that will have 2 colunn
> and X amount of rows.

You can create  it at the back end , using the CREATE table statement

CREATE TABLE tableName (
urcolumn1 varchar(100)
,urColumn2 varchar(100) )
Go

in order to insert use the insert statement

INSERT INTO tablename
SELECT value1, Value2


B/w i am still confused , why you need to create it at the front end side

0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 17099099
Just keep in mind that a SQL Table is not RAM.  All its accesses are made on disk.
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 17099114
In fact, I suggest you use datasets to create your table instead of SQL table...
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:daze10
ID: 17099580
the database X number of enters and this enter I need to display in the table in 2 columms and X numbers of rows. What would be the statment that to create a dynamic table in asp.net to get the information from the database.

I have created the sqlconnection, dataset, and the sqlDataAdapter created
then in the design layout I have add the tap for a Plase holder and in it I have placed the table for in to be X size.
now at the other page I have  declared the a values
values for the datarow, number of row, number of cells, ...

But how can I tell the table to go to the database look to see if there is a value in the database then to get one value and place it in the table and then to look at the database once more and if there is a other value to get it and place it in a other colunn and thengo back to the database look once more to add a new row if there is info to add then comtinue on.

how can I do so thing like this
0
 

Author Comment

by:daze10
ID: 17099761
SORRY ITS NOT A PLACE HOLDER ITS A   PANEL
0
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 250 total points
ID: 17115351
u have already used the adapter right then u could use the adpater.fill(dataset) option to fill the dataset

u could alter the adpater.selectciommand to provide a custom select


if u want to update that table back to db u must also write adapter.insercommand and other commands
0
 
LVL 23

Assisted Solution

by:Racim BOUDJAKDJI
Racim BOUDJAKDJI earned 250 total points
ID: 17116988
Keep in mind that tables in a dataset do *not* have to have a corresponding SQL table in server side.  The main advantage is that they are pure RAM representations with filter capabilities.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question