Friday, June 8, 2012

[sharepointdiscussions] Digest Number 4460

Messages In This Digest (3 Messages)

Messages

1a.

Sharepoint lists to datatables to gridview

Posted by: "Badarinath" kp_badari@yahoo.co.in   kp_badari

Thu Jun 7, 2012 7:05 am (PDT)





Hi all,
I have 3 data tables . dt1, dt2, dt3 . The requirement is i have to
join 3 data tables.. and place into dtfullone(another temporary
datatable) to bind to gridview. Plz help me urgently how to write code
for this..
the code i am copiying plz  tell me i am strucking to get data from
third table. Plz give me pseudo code if possible..thanks in advance
1.                          DataTable dt = list1.GetItems(oQuery).GetDataTable();   // getting data to data tablefrom Sharepoint list using CAML query
                            DataTable dt1 = list2.GetItems(oQuery1).GetDataTable();// getting data to data tablefrom Sharepoint list using CAML query
                            DataTable dt2 = list3.GetItems(oQuery).GetDataTable();// getting data to data tablefrom Sharepoint list using CAML query

                                                    
 
                            DataRow dr = dtFullone.NewRow();
                            dr["Column1"] = dt.Rows[0]["Column1"];  // Column1 is from dt
                            dr["Column2"] = dt.Rows[0]["Column2"];  // Column2 is from dt1
                            dr["Column3"] = dt.Rows[0]["Column3"];//column3 is from dt2//here needs to write code to join 3 data tables..Plz tell me here i am strucking
                            
                            dtFullone.Rows.Add(dr);
                        }
                    }
                }
                gridview.DataSource = dtFullone;
                gridview.DataBind();

[Non-text portions of this message have been removed]

1b.

Re: Sharepoint lists to datatables to gridview

Posted by: "shahzeb khan" shahzebkn@hotmail.com   shahzebkn

Thu Jun 7, 2012 8:14 am (PDT)




add these datatables in dataset and bind to grid

Regards
Shahzeb
To: sharepointdiscussions@yahoogroups.com
From: kp_badari@yahoo.co.in
Date: Thu, 7 Jun 2012 11:59:13 +0800
Subject: [sharepointdiscussions] Sharepoint lists to datatables to gridview

Hi all,

I have 3 data tables . dt1, dt2, dt3 . The requirement is i have to

join 3 data tables.. and place into dtfullone(another temporary

datatable) to bind to gridview. Plz help me urgently how to write code

for this..

the code i am copiying plz tell me i am strucking to get data from

third table. Plz give me pseudo code if possible..thanks in advance

1. DataTable dt = list1.GetItems(oQuery).GetDataTable(); // getting data to data tablefrom Sharepoint list using CAML query

DataTable dt1 = list2.GetItems(oQuery1).GetDataTable();// getting data to data tablefrom Sharepoint list using CAML query

DataTable dt2 = list3.GetItems(oQuery).GetDataTable();// getting data to data tablefrom Sharepoint list using CAML query

DataRow dr = dtFullone.NewRow();

dr["Column1"] = dt.Rows[0]["Column1"]; // Column1 is from dt

dr["Column2"] = dt.Rows[0]["Column2"]; // Column2 is from dt1

dr["Column3"] = dt.Rows[0]["Column3"];//column3 is from dt2//here needs to write code to join 3 data tables..Plz tell me here i am strucking

dtFullone.Rows.Add(dr);

}

}

}

gridview.DataSource = dtFullone;

gridview.DataBind();

[Non-text portions of this message have been removed]



[Non-text portions of this message have been removed]

1c.

Re: Sharepoint lists to datatables to gridview

Posted by: "Venkatesh H" venkat82.h@gmail.com   venkat_82_20012001

Thu Jun 7, 2012 9:16 am (PDT)



If all the tables have the same schema, then you can do "datatable.Merge".

On Wed, Jun 6, 2012 at 11:59 PM, Badarinath <kp_badari@yahoo.co.in> wrote:

> **
>
>
>
>
> Hi all,
> I have 3 data tables . dt1, dt2, dt3 . The requirement is i have to
> join 3 data tables.. and place into dtfullone(another temporary
> datatable) to bind to gridview. Plz help me urgently how to write code
> for this..
> the code i am copiying plz tell me i am strucking to get data from
> third table. Plz give me pseudo code if possible..thanks in advance
> 1. DataTable dt =
> list1.GetItems(oQuery).GetDataTable(); // getting data to data tablefrom
> Sharepoint list using CAML query
> DataTable dt1 =
> list2.GetItems(oQuery1).GetDataTable();// getting data to data tablefrom
> Sharepoint list using CAML query
> DataTable dt2 =
> list3.GetItems(oQuery).GetDataTable();// getting data to data tablefrom
> Sharepoint list using CAML query
>
>
>
> DataRow dr = dtFullone.NewRow();
> dr["Column1"] = dt.Rows[0]["Column1"]; //
> Column1 is from dt
> dr["Column2"] = dt.Rows[0]["Column2"]; //
> Column2 is from dt1
> dr["Column3"] =
> dt.Rows[0]["Column3"];//column3 is from dt2//here needs to write code to
> join 3 data tables..Plz tell me here i am strucking
>
> dtFullone.Rows.Add(dr);
> }
> }
> }
> gridview.DataSource = dtFullone;
> gridview.DataBind();
>
> [Non-text portions of this message have been removed]
>
>
>

[Non-text portions of this message have been removed]

Recent Activity
Visit Your Group
Find helpful tips

for Moderators

on the Yahoo!

Groups team blog.

Yahoo! Groups

Parenting Zone

Resources and tips

for parents

Ads on Yahoo!

Learn more now.

Reach customers

searching for you.

Need to Reply?

Click one of the "Reply" links to respond to a specific message in the Daily Digest.

Create New Topic | Visit Your Group on the Web

No comments: