Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have one datatable which is displaying using gridview and i have one dropdown list which contain some records . when i select the item from dropdown list then on the basis of selection i get i data table with one datarow and i want to add that data table to first data table which is already shown into gridview and i want show old and new added records into same gridview again . how it could be possible any body help me ??
Posted

As you said you're getting a datatrow, you can use the DataTable.NewRow()[^] method for adding it to the datatable.

-KR
 
Share this answer
 
Comments
nitinkumar06 18-Sep-15 4:07am    
ok..
Hi,

As per my understand the post you want to return 2 DataTables result into 1 DataTable, right.?

If your requirement is like this, you can Merge both DataTable's in the below manner.

C#
dt1=dt1.Merge(dt2);


Hope this will helpful to you..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900