.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

REST Query Batch Issue

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :SharePoint

Hi All,

I've got an issue when querying the listdata.svc from a Silverlight client.   

I construct the query as follows:

var parametersQuery = context.Parameters.Expand("AssociatedTask") as DataServiceQuery<ParametersItem>;

If I execute the query individually and then process the results then the AssociatedTask collection gets populated, if I include it as a batch then it does not.

I've examined the query in Fiddler and as far as I can tell the request and response are identical.

Anyone shed any light on the issue?

View Complete Post

More Related Resource Links

WCF Rest Security Issue

I have developed a wcf Rest application and I have prepared a web client in which I am using simple javascript embed over html pages now I want to implement some security to my pages how can I do so can any one explain me. I am not using asp.net as client. I am trying to implement some security to secure my data but I am not able find the way to do it.

Data query task issue

Hi Someone help me undersand how to implement a Data meaning query  in SSIS project step by step. even a small package for testing this task ThanksThe complexity resides in the simplicity

Sql query inner join issue

so i have a datagridview in a vb from. my plan is to display a table named emplyees, having the following fields: [employees] ([lastname], [firstname], [cost_center], [division], [job_title], [hiring_date], [exit_date], [functional_manager], [member_of], [backup_by], [out_of_office], [desk_phone], [mobile_phone], [comments]. But I need to make an inner join with 3 other tables. job_titles, divisons and rss. How should i writethe select command for this, having the inner join forthe follwing fields: division- division.name,job_title-job_titles.name , and member_of- rss.group_name. I have no idea how to do it. pls help Thanks

Issue with CAML Query

I am having a RadGrid in Sharepoint Webpart with each row having a checkbox and multiple Columns where one of the Columns is ColumnID. When a multiple checkboxes are selected, their respective ColumnID Value is used to Query and generate report. I am using CAML Query to pass in the ColumnID of each checkbox selected and generate report based on the ColumnID Value. But I am having issue with the Query I have written. I have tried two ways: One of the ways was to Hardcode just two ColumnID Values as I was not sure how to read array of multiple columnID values. But I was wondering where I was going wrong since it was throwing following error: "Multiple with same name ColumnID were used" Telerik.Reporting.ReportParameter param1 = new Telerik.Reporting.ReportParameter(); param1.Name = "ColumnID"; param1.Type = Telerik.Reporting.ReportParameterType.Integer; param1.AllowBlank = false; param1.AllowNull = true; param1.Text = "ColumnID"; param1.Visible = true; param1.Value = "200"; this.ReportParameters.Add(param1); Telerik.Reporting.ReportParameter param2 = new Telerik.Reporting.ReportParameter(); param2.Name = "ColumnID"; param2.Type = Telerik.Reporting.ReportParameterType.Integer; param2.AllowBlank = false; param2.AllowNull = true; param2.Text = &qu

Issue with one of simple query

Hi team, I have a issue in the one of my query select   * from Prod3 where pnumber in (select distinct Policy from prod3_excel) order by pnumber This query gives me 8361 records and there are 8419 records in Prod3 how can i get the remaining records in Prod3 that is 58? select * from Prod3 where pnumber not in (select distinct Policy from prod3_excel) order by pnumber why this is not working? Thanks, Eshwar

SQL query issue

Hi, I have a question that is pricking me as to how to solve it? Here is my requirement and table structures: create table #docs ( docid int, setupid int, docfname varchar(20), docmname varchar(20), doclname varchar(20), ) create table #setups ( docid int, setupid int ) -- A single doc can have multiple setups insert into #docs select 1, 100, 'Spock', 'Moreau', 'Livingston' union select 2, 101, 'Demento', 'Dolittle', 'Kevorkian' union select 3, 103, 'Faust', 'Zhivago', 'Jekyll' union select 4, 104, 'Freud', 'Laura', 'Phil' insert into #setups select 1, 200 union select 1, 300 union select 2, 200 union select 2, 400 union select 4, 200 union select 4, 500 /* If the doc has multiple setups I would like to copy over the data for the all the setupids as below */ select * from #docs select * from #setups drop table #docs drop table #setups I am trying to get this result using union and left out join etc., using a query and not using cursors/loops. Please help me and thanks for the responses. docid setupid docfname docmname doclname 1 100 Spock Moreau Livingston 1 200 Spock Moreau Livingston  --- data copied over 1 300 Spock Moreau Livingston  --- data copied over 2 101 Demento Dolittle Kevorkian 2 200 Demento Dolittle Kevorkian    --- data copied over 2 400 Demento Dolittle&n

How to avoid "'CREATE VIEW' must be the first statement in a query batch" when I need to use SET Q

I have a problem that I have been unable to solve.  I have a stored procedure in a database on server A that needs to create an indexed view in a database on server B.  (The environment is SQL Server 2005.)  The procedure on server A does the following:  (The EXEC statement inside the quotes is really a variable in my procedure, I've just substituted the value to make the example understandable.) EXEC sp_executesql 'EXEC [ServerB].[Database].dbo.sp_executesql @sqlStatement;' The "outer" sp_executesql causes the "inner" sp_executesql to be execute within the database on server B.  (@sqlStatement contains the CREATE VIEW syntax.)  I am able to create the view that I want to index with no problem.  However, when I attempt to create an index on the view in a subsequent step, it fails with the message "Cannot create index. Object '_dta_mv_51' was created with the following SET options off: 'QUOTED_IDENTIFIER'".  Fair enough, but if I attempt to precede my CREATE VIEW statement with the required QUOTED_IDENTIFIER, I receive an error to the effect that "'CREATE VIEW' must be the first statement in a query batch".  I'm not sure how to get around this problem.  Does anyone have the answer? SQL Server 2008 doesn't object to indexing a view that was created with QUOTED_IDENTIFIER

REST Starter Kit - parsing issue with ampersand in element

We built a REST web service using the REST Starter Kit.  We want to allow XML post elements that contain ampersands.   How can we modify the code to have the parsing at the element level so that when an XML post element contains an ampersand we don't generate an error?

Query help required - before I pull out the rest of my hair!!


I have a query that I am running from a Table Function....

FROM dbo.FN(@p1, @p2)
WHERE cValue IN (1)

And I get the following error message..

Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value '= 31' to data type int.

Yet if I run the following query with the only change being in the WHERE clause.....

FROM dbo.FN(@p1, @p2)
WHERE cValue IN (1, 9)

It runs OK. Now please can somebody explain the logic of that to me?!?! Basically if I put in a single value into the brackets it fails. it only runs when I put in more than 1 value. I will be bald before the day is over!



Another Issue with CAML Query



I know this question has to be put in Telerik Forums but its something related to CAML and data being bound programmatically. So, please take a minute to share your thoughts on my issue. Thanks.

In my previous post here , I had issue with CAML Query, which works great now. So, here is one of my issue related to it: I am using a Report which has Subreport. So, I have set the datasource of Main Report to be a DataTable that holds the CAML Query (the result CAML Query from previous post here ). Now, for the same parameter values, for each Report, I want its subsequent subreport to be be populate programmatically. But, this CAML Query do

Issue with CAML Query regarding date comparision.

I have a below query in one the eventhandlers. All I do in the query is to get all records where Next_Date column is < CurrentDateTime ( I have shown current date below in full date format but it will be variable).

What I am observing is the comparision seems to be failing or not considering time format. For example the below query should not return any records when NEXT_DATE is 9/30/2010 23:59:59 and CurrentDateTime is 9/30/2010 06:22:22. However the query does return records. It looks like the comparision is just happening with Date and not time. What could be the problem? Please suggest.

         <FieldRef Name='Next_x0020_Date' />
         <Value Type='DateTime'>2010-09-30T13:13:13Z</Value>
      <FieldRef Name='Next_x0020_Date' Ascending='False' />

Query String Issue


Hello everyone,

I just started with learning MVC so please bear with me. I have a grid displayed on my Main page(Index) and when I click on the Details Link for a particular row(suppose productID=1) it should invoke the following action otherwise redirectToAction("Index"):


        // GET: /Home/Details
        public ActionResult Details(int? ProductID)
            if (!ProductID.HasValue)
                return RedirectToAction("Index");
                return View("Details");

The ProductID in my case is always Null and it actually ends up redirecting back to the main page as expected. Why is that happening. Somebody please help.

Thank You

Upgrading - SP2010 batch query limitations?


According to technet (http://technet.microsoft.com/en-us/library/cc262787.aspx) the below applies when executing queries to lists even though the list item hard limitations are set in the millions...

My question is, are there any other changes in regards to the limitations when processing batch queries on lists in Sharepoint 2010? What was the below limit in 2007?

It is essential for me to be able to inform my partners if anything did change, so that they can prepare there applications for any extended limitations, when we are upgrading.

List view threshold



Specifies the maximum number of list or library items that a database operation, such as a query, can process at the same time outside the daily time window set by the administrator during which queries are unrestricted.


Thank you in advance/Jesper Wilfing


A query plan issue


There are 3 paths in stored procedure p2:

create proc p2
 @n int
 declare @sql varchar(100)
 if @n=1
 set @sql='select *from ta where id='+cast(@n as varchar(10))
 else if @n=2
 set @sql='select *from tb where id='+cast(@n as varchar(10))
 set @sql='select *from tc where id='+cast(@n as 

Performance issue with select query



I have simple select query as below

SELECT DISTINCT BCEGPrsLinesCd, BCEGCmlLinesCd,CountyFedInfoPrcStdNbr

FROM TPSeleBCEGAddress WITH(nolock)




AND LTRIM(RTRIM(PrefixStreetDirCd))='E'






AND LTRIM(RTRIM(BCEGEffectiveYr))='1998'

Table TPSeleBCEGAddress has 64 Lakhs records in it and it takes around 22 Seconds to execute this query. Please let me know a way to improve performance of this select query.

Primary key defined on this table comprises of 16 columns.






List query in ASP.NET app using REST service


I cannot get this to work.  Getting an exception that provides no information.  I want to use an external ASP.NET app to query a single list in SP2010 using C# and the REST service listdata.svc, and bind the data to a gridview control.  Here's the code I have that does not work:

MySiteDataContext context = new MySiteDataContext(new Uri("http://mydevserver:1000/_vti_bin/listdata.svc"));
context.Credentials = new NetworkCredential("xxxx", "xxxx", "xxxx");

//the list name is actually Source
List<SourceItem> allSourceItems = context.Source.ToList();
var sourceItems = from c in allSourceItems
              select new {c.Id, c.Title };
GridView1.DataSource = sourceItems;

I already know the service works.  I can see the data in my browser when I go directly to the service

Query issue - Pivot?


I a query that returns the following:

Day    TypeID     Product A     Product B
1        1            10               20 
1        2            30               40
2        1            50               60 
2        2            70               80

But, i need to return the following:
Day    Product A Type1     Product A Type2     Product B Type1
     Product B Type2
1       10                        30                        20                        40

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend