Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I m faced with the problem of displaing contents from DataTable to to webform.I got the following details

.Im using asp.net and VB.net

 

Experience Table

===============

Fields in Experience Table: CandID,CompanyName,Desig,Role

Sample Data in ExperienceTable

CandID CompanyName Desig Role

---- ----------- ------ -----

1 Camco SalesMan Role 4 Salesman

1 Amco Superviser Role of Superviser

1 Wesco Captain Roles of Captain

2 Evia CustCare Roles of CustCare

 

 

Now I am passing

select * from ExpTable where candId=1

to the DataTable

Then I wanted to get the following output on my WebForm

 

Experience Details

 

1) Company Name:Camco

Designation :Salesman

Role :Role 4 Salesman

2) Company Name:Amco

Designation :Superviser

Role :Role of Superviser

3) Company Name:Wesco

Designation :Captain

Role :Roles of Captain

 

Any better idea 4 getting the output neatly formatted on a webForm

 

I tried the following way .But I couldn't add rows dynamically.Help me to solve this or suggest me some better way of dislaying a neatly formatted output

 

I placed one HTml Table control on my web form.Now I Rightclicked this table and made Run as server control.

Now I used DataTable to read data from ExperienceTable

 

And based on Candid I retrieved records from this ExpDetails Table

Based on the Number of rows retrieved from the DataTable .I wanted to Dynamically add rows for my html table on the webform.

 

And the data from the dataTable are to be displayed on to these rows and colums in these HtmlTable

 

First Check if any records are there in DataTable If No records Then it should not create any Table on the Form.

 

Or if 3 records are in the dataTable Then It should

First Create one Table with 1 row and 1 column

and Display a heading "Experience Details" in it

 

Then insert Required no.of rows and columns to the heading 4 displaying the results

 

If my DataTable has only one row then createan HtmlTable with 3 rows and 2 columns

 

If my DataTable has Three rows then create an HtmlTable with 9 rows and 2 columns

:o :o

ima

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...