Solved

Create a dynamic table in ASP.net

Posted on 2006-07-13
9
195 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
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!

 

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

733 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