| | |
How to combine two tables into a single datagrid
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2009
Posts: 45
Reputation:
Solved Threads: 8
0
#2 Oct 14th, 2009
Try this Merge option,
ds.Merge(DataSet);
Splitting that two datatables in separate dataset.
ds.Merge(DataSet);
Splitting that two datatables in separate dataset.
Chandru
SilverlightScripting.com
SilverlightScripting.com
•
•
Join Date: Oct 2009
Posts: 6
Reputation:
Solved Threads: 0
0
#3 Oct 19th, 2009
Hi Chandru, Thank you very much for your kind reply. I did that method, but in that my problem is, i have 3 rows, 8 columns in table1 and 3 rows, 8 columns in table2. First 2 columns of both the tables are same. Always i will get row count is same for both the tables. So, if i use this merge method then it creates a table with 6 rows, and also after the 8th columns has no values in first 3 rows and first 8 columns has empty values in second 3 rows.
•
•
Join Date: Sep 2009
Posts: 45
Reputation:
Solved Threads: 8
1
#4 Oct 19th, 2009
Hi,
i will work if both structure's or same.For different structure just try like this,
In that same way Add second datatable to third.
i will work if both structure's or same.For different structure just try like this,
ASP.NET Syntax (Toggle Plain Text)
if(firstDataTable.Rows.Count > 0) { //Add all Coulmns and values to 3rd datatable. }
In that same way Add second datatable to third.
Last edited by peter_budo; 33 Days Ago at 6:17 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Chandru
SilverlightScripting.com
SilverlightScripting.com
•
•
Join Date: Sep 2007
Posts: 66
Reputation:
Solved Threads: 12
0
#5 Oct 19th, 2009
Hello there
If i understand u correctly, u need a Nested/group dataset in a single dataset
Do the following, i have created an eg for you.
follow the steps
1) In solution explorer Add-> new Items -> Select "XML Schema"
2) Give the name eg : CommonDS Set
3) Go to the properities of "CommonDS" and Change Custom tool Property: MsDataSetGenerator
4) Right Click CommonDS -> View Code
5) Paste the following code Then change the Table NAme & Column names as per your requirement.
Pls. Mark as solved if it helps you
If i understand u correctly, u need a Nested/group dataset in a single dataset
Do the following, i have created an eg for you.
follow the steps
1) In solution explorer Add-> new Items -> Select "XML Schema"
2) Give the name eg : CommonDS Set
3) Go to the properities of "CommonDS" and Change Custom tool Property: MsDataSetGenerator
4) Right Click CommonDS -> View Code
5) Paste the following code Then change the Table NAme & Column names as per your requirement.
ASP.NET Syntax (Toggle Plain Text)
<?xml version="1.0" encoding="utf-8"?> <xs:schema id="CommonDS" targetNamespace="http://tempuri.org/CommonDS.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/CommonDS.xsd" xmlns:mstns="http://tempuri.org/CommonDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="CommonDS"> <xs:complexType> <xs:sequence> <xs:element name="Table1"> <xs:complexType> <xs:sequence> <xs:element name="Col1" type="xs:string" /> <xs:element name="Col2" type="xs:int" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Table2"> <xs:complexType> <xs:sequence> <xs:element name="Column1" type="xs:string" /> <xs:element name="Column2" type="xs:int" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Pls. Mark as solved if it helps you
![]() |
Similar Threads
- combine three tables (MySQL)
- Can i use two tables in a single query (PHP)
- Searching Multiple tables... Please help me!!!!! (PHP)
- How to properly use tables in db? (PHP)
- how to get the difference between the data of the two files (Visual Basic 4 / 5 / 6)
- Datas from different tables in one crystal report.. (Visual Basic 4 / 5 / 6)
- Joining two tables in VB 6 (Visual Basic 4 / 5 / 6)
- Searching for a record in multiple tables (VB.NET)
- Working with datagrid (Visual Basic 4 / 5 / 6)
Other Threads in the ASP.NET Forum
- Previous Thread: calling javascript after databse validation??
- Next Thread: thumbnails for flv
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv formview gridview gudi iis javascript list listbox login menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order panelmasterpagebuttoncontrols problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming webservice wizard xsl





