sureshcd10 Posted May 5, 2004 Posted May 5, 2004 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 Quote ima
Moderators Robby Posted May 5, 2004 Moderators Posted May 5, 2004 Don't you want to use a DataGrid or DataList? Quote Visit...Bassic Software
sureshcd10 Posted May 6, 2004 Author Posted May 6, 2004 Don't you want to use a DataGrid or DataList? No. I 'm trying use only Table Control Quote ima
Administrators PlausiblyDamp Posted May 6, 2004 Administrators Posted May 6, 2004 Any reason why you only want to use the table control? A DataList or DataGrid would be so much easier. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
shahab Posted May 8, 2004 Posted May 8, 2004 We must use the buit In controls in order to increase the performance! Quote
Administrators PlausiblyDamp Posted May 8, 2004 Administrators Posted May 8, 2004 DataList and DataGrid are part of ASP.Net - is that not built-in enough for you? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.