Solved

Create a dynamic table in ASP.net

Posted on 2006-07-13
9
191 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
9 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
Comment Utility
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
Comment Utility
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
Comment Utility
In fact, I suggest you use datasets to create your table instead of SQL table...
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:daze10
Comment Utility
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
Comment Utility
SORRY ITS NOT A PLACE HOLDER ITS A   PANEL
0
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 250 total points
Comment Utility
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
Comment Utility
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

763 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now