Click here to Skip to main content
15,913,944 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Row Filter Pin
Manas Bhardwaj18-Sep-09 9:41
professionalManas Bhardwaj18-Sep-09 9:41 
GeneralRe: Row Filter Pin
Abhishek Sur18-Sep-09 11:37
professionalAbhishek Sur18-Sep-09 11:37 
GeneralRe: Row Filter Pin
Manas Bhardwaj18-Sep-09 11:43
professionalManas Bhardwaj18-Sep-09 11:43 
GeneralRe: Row Filter Pin
Abhishek Sur18-Sep-09 11:48
professionalAbhishek Sur18-Sep-09 11:48 
GeneralRe: Row Filter Pin
Manas Bhardwaj18-Sep-09 11:54
professionalManas Bhardwaj18-Sep-09 11:54 
GeneralRe: Row Filter Pin
Abhishek Sur18-Sep-09 11:58
professionalAbhishek Sur18-Sep-09 11:58 
Questionfilter datagrid rows nested within datalist Pin
janetb9918-Sep-09 7:46
janetb9918-Sep-09 7:46 
Questionmaintaining session Pin
laziale18-Sep-09 6:41
laziale18-Sep-09 6:41 
AnswerRe: maintaining session Pin
Christian Graus18-Sep-09 11:38
protectorChristian Graus18-Sep-09 11:38 
QuestionDefault Positioning Pin
Alireza Loghmani18-Sep-09 4:11
Alireza Loghmani18-Sep-09 4:11 
AnswerRe: Default Positioning Pin
sashidhar18-Sep-09 5:42
sashidhar18-Sep-09 5:42 
Questionproblems with webservices Pin
shankbond18-Sep-09 3:40
shankbond18-Sep-09 3:40 
AnswerRe: problems with webservices Pin
Abhishek Sur18-Sep-09 5:26
professionalAbhishek Sur18-Sep-09 5:26 
GeneralRe: problems with webservices Pin
shankbond18-Sep-09 5:43
shankbond18-Sep-09 5:43 
GeneralRe: problems with webservices Pin
Abhishek Sur19-Sep-09 7:08
professionalAbhishek Sur19-Sep-09 7:08 
GeneralRe: problems with webservices Pin
shankbond21-Sep-09 1:22
shankbond21-Sep-09 1:22 
QuestionLooping to find LoginView controls Pin
NoirWD18-Sep-09 3:34
NoirWD18-Sep-09 3:34 
QuestionDatatable Concatination Pin
sekannak18-Sep-09 2:56
sekannak18-Sep-09 2:56 
AnswerRe: Datatable Concatination Pin
Abhishek Sur18-Sep-09 5:50
professionalAbhishek Sur18-Sep-09 5:50 
Use this :

DataTable dt = datatable1.clone();

foreach(DataColumn dc in datatable2.Columns)
{
   DataColumn dc1 = new DataColumn(dc.Caption,dc.DataType);
   dt.Columns.add(dc1);
}

foreach(DataColumn dc in datatable3.Columns)
{
   DataColumn dc1 = new DataColumn(dc.Caption,dc.DataType);
   dt.Columns.add(dc1);
}


Now to merge the data you need to

for(i=0;i<datatable1.rows.count;i++)
{
DataRow drNew = dt.NewRow();
for(j=0;i<dt.columns.count;j++)
{
  if(j< datatable1.Columns.count)
   drNew[j] = datatable1.rows[i][j];
  else if(j<(datatable1.Columns.count + datatable2.Columns.count))
  drNew[j] = datatable2.rows[i][j-datatable1.columns.count-1];
...
}


Finally
dt.Rows.Add(drNew)

You can also make it more cleaner. Also change it according to your need.
Hope it works Smile | :) Smile | :) Smile | :)

Abhishek Sur

My Latest Articles
Create CLR objects in SQL Server 2005
C# Uncommon Keywords
Read/Write Excel using OleDB

Don't forget to click "Good Answer" if you like to.

modified on Friday, September 18, 2009 1:49 PM

QuestionExport to Excel Pin
arkiboys18-Sep-09 2:52
arkiboys18-Sep-09 2:52 
AnswerRe: Export to Excel Pin
Arun Jacob18-Sep-09 2:57
Arun Jacob18-Sep-09 2:57 
GeneralRe: Export to Excel Pin
arkiboys18-Sep-09 3:53
arkiboys18-Sep-09 3:53 
AnswerRe: Export to Excel Pin
Abhishek Sur18-Sep-09 5:23
professionalAbhishek Sur18-Sep-09 5:23 
QuestionError while transferring data to Excel Pin
nagendrathecoder18-Sep-09 2:04
nagendrathecoder18-Sep-09 2:04 
AnswerRe: Error while transferring data to Excel Pin
Arun Jacob18-Sep-09 2:19
Arun Jacob18-Sep-09 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.