Click here to Skip to main content
14,832,945 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionproblems with webservices Pin
shankbond18-Sep-09 3:40
Membershankbond18-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
Membershankbond18-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
Membershankbond21-Sep-09 1:22 
QuestionLooping to find LoginView controls Pin
NoirWD18-Sep-09 3:34
MemberNoirWD18-Sep-09 3:34 
QuestionDatatable Concatination Pin
sekannak18-Sep-09 2:56
Membersekannak18-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
Memberarkiboys18-Sep-09 2:52 
AnswerRe: Export to Excel Pin
Arun Jacob18-Sep-09 2:57
MemberArun Jacob18-Sep-09 2:57 
GeneralRe: Export to Excel Pin
arkiboys18-Sep-09 3:53
Memberarkiboys18-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
Membernagendrathecoder18-Sep-09 2:04 
AnswerRe: Error while transferring data to Excel Pin
Arun Jacob18-Sep-09 2:19
MemberArun Jacob18-Sep-09 2:19 
GeneralRe: Error while transferring data to Excel Pin
nagendrathecoder18-Sep-09 2:31
Membernagendrathecoder18-Sep-09 2:31 
AnswerRe: Error while transferring data to Excel Pin
Arun Jacob18-Sep-09 2:33
MemberArun Jacob18-Sep-09 2:33 
GeneralRe: Error while transferring data to Excel Pin
nagendrathecoder18-Sep-09 2:36
Membernagendrathecoder18-Sep-09 2:36 
QuestionProblum In Javascript Pin
Sachin Dubey18-Sep-09 1:50
MemberSachin Dubey18-Sep-09 1:50 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:08
MemberArun Jacob18-Sep-09 2:08 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:10
MemberSachin Dubey18-Sep-09 2:10 
GeneralRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:14
MemberArun Jacob18-Sep-09 2:14 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:19
MemberSachin Dubey18-Sep-09 2:19 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:23
MemberArun Jacob18-Sep-09 2:23 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:31
MemberSachin Dubey18-Sep-09 2:31 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:34
MemberArun Jacob18-Sep-09 2:34 

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.