Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to get the Values from two Lists what have i dont wrong? i dont get any errors the site is only updating nothing more just like it dont fel that i press the button

protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {

            if (DropDownListFeeds.SelectedValue=="0")
            {
                SPWeb web = SPContext.Current.Web;

                SPSiteDataQuery query = new SPSiteDataQuery();
                query.Lists =
                    "<Lists><List ID=\"98B914FA%2DA714-44DB-9A44%2D80ADE288F18E\"/><List ID=\"D1E0691B-33E3%2D49EF%2DA0B9-F96C1F166AFD\"/></Lists>";

                query.Query =
                    string.Format("<OrderBy><FieldRef Name='Modified' Ascending='FALSE'></FieldRef></OrderBy>");
                query.Webs = "<Webs Scope=\"SiteCollection\" />";

                query.RowLimit = 10;


                DataTable dataTable = web.GetSiteData(query);





                Repeater2.DataSource = dataTable;

                Repeater2.DataBind();


            }

        }
        catch (Exception x)
        {

            Label1.Text = x.Message;
        }
share|improve this question
add comment

2 Answers

MS Documentation has it as

query.Webs = "<Webs Scope=\"SiteCollection\" />";

Instead of:

query.Webs = "<Webs Scope=\"SiteCollection\">";

Not sure if that is what is blowing up your code though. As mentioned above the ID's do look off.

share|improve this answer
add comment

You List IDs are not looking right, Here's an example of how it should be like,

<Lists>
  <List ID="7A9FDBE6-0841-430a-8D9A-53355801B5D5" />
  <List ID="3D18F506-FCA1-451e-B645-2D720DC84FD8" />
</Lists>

Source

If after fixing it, it still doesn't work then try to debug it and find where exactly its getting error.

Hope it helps.

share|improve this answer
    
i know wrote it wrong but i dont get Any error Messages i have debugged –  Martin Jan 29 '13 at 23:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.