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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

CAML query on external list is not working

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :SharePoint
 
Hi, I have an external list, display data from SQLServer 2008. Table on SQL have an UniqueIdentifire (GUID) type column as a Primary key. It also has one identifier column, Its value is increased by 1, as the item is created. In share point server side code, I want to fetch single record against the primary key GUID value. I write down the CAML query on GUID column and run without any error. But all the external list data is returned instead of Single list item. I also try to filter on Auto Incremented column, but same problem is occurred.


View Complete Post


More Related Resource Links

How to join two sharepoint list in c# by CAML query?

  
Hii All,
 
   I am using wss 3.0 and i have one site and site has 4 to 5 lists. lists are interconnected with lookup column and same column. I need to display some column fron one list and some from another.. i need to join that lists by where condition like project =project..

So how can i join??



Thank You
Dips
Patel

Caml query not working

  
Hi, I'm trying to query a SPListItem from a sharepoint list but it doesn't seem to work:   SPDocumentLibrary myDocuments = (SPDocumentLibrary)site.Lists["Documents"]; SPQuery query = new SPQuery() { Query = " <Where>" + " <Eq>" + " <FieldRef Name='DocumentPath' />" + " <Value Type='Text'>" + source + "</Value>" + " </Eq>" + " </Where>" }; var result = myDocuments.GetItems(query); I get no result, but there's an item with the specified "source" that does exist.

CAML query to access List data across multiple site collection.

  
Hi   Is there any way to get the Task List data across multiple site collection using CAML query. Currently, I have the code which will retrieve the data from a single site collection. Below is the code.                           /***************************************************I am using Moss2007.Thanks!Ravi             SPSiteDataQuery q = new SPSiteDataQuery();             q.ViewFields = "<FieldRef Name=\"Title\" />" "<FieldRef Name=\"Status\" Nullable=\"TRUE\"/>";             q.Lists = "<Lists ServerTemplate=\"107\"/>";             q.Webs = "<Webs Scope=\"SiteCollection\"/>";             q.Query = "<Where>" +                                "<Eq>" +                                     "<FieldRef Name=\"Status\" />" + "<Value Type=\"Choice\">Not  Started</Value>" +                                     "</Eq>" +                         "</Where>";             DataTable dt=null;             using (SPSite s = new SPSite("http://banglabguest1:31000/"))             {                 SPWeb w = s.OpenWeb();                 dt = w.GetSiteData(q);                 w = null;             }                              *************************

Fetching Task List for the logged in User with LINQ/CAML/SQL query

  

Hi All,

We have some workflows which are been created already. The tasks are been assigned to users for their approval. Now, when the approver logs in it should display the Tasks List which are belonging to that particular user only. OR if the normal user logs inn, it should display Tasks belonging to that User only. A web part should display this. Pls. note that I have to show the Tasks from both "Workflow Task" & "Task".

The Task list should come from across site collections of a Web Application.

Hence,The Scopen should be WebApplication.
How do I achieve the same? Need help ASAP.

Thnx,

Alex


alex

Task List for the logged in User with LINQ/CAML/SQL query

  

Hi All,

We have some workflows which are been created already. The tasks are been assigned to users for their approval. Now, when the approver logs in it should display the Tasks List which are belonging to that particular user only. OR if the normal user logs inn, it should display Tasks belonging to that User only. A web part should display this. Pls. note that I have to show the Tasks from both "Workflow Task" & "Task".

The Task list should come from across site collections of a Web Application.

Hence,The Scopen should be WebApplication.
How do I achieve the same? Need help ASAP.

Thnx,

Alex


alex

Fetching Task List for the logged in User with LINQ/CAML/SQL query

  

Hi All,

We have some workflows which are been created already. The tasks are been assigned to users for their approval. Now, when the approver logs in it should display the Tasks List which are belonging to that particular user only. OR if the normal user logs inn, it should display Tasks belonging to that User only. A web part should display this. Pls. note that I have to show the Tasks from both "Workflow Task" & "Task".

The Task list should come from across site collections of a Web Application.

Hence,The Scopen should be WebApplication.
How do I achieve the same? Need help ASAP.

Thnx,

Alex


alex

Connect to Outlook not working for an External List in 64-bit Office 2010

  

I've used Business Connectivity Services in SharePoint 2010 to create an External Content Type with Office Item Type 'Contact'. I then created an External List in a SharePoint site to display the items in the External Content Type (after granting permissions on the ECT). When I click 'Connect to Outlook', a VSTO is created and installed. It says, the install is succesful. However, I do not see the contacts in my External List in Outlook. This is a 64-bit version of Outlook 2010. When I click 'Connect to Outlook' again, I get an error: "Cannot install or update this external list on client machine because another update is already in progress".

From another client machine where I installed the 32-bit version of Office 2010, this functionality works great. It seems the VSTO SharePoint BCS creates when you click 'Connecto to Outlook' on an external list, is not compatible with 64-bit versions of Office. Just to make sure there were no other differences between my two machines, I went back to the 64-bit Office client, uninstalled all Office software, then installed the 32-bit version of Office 2010. I then did my test again, and everything worked just great.

So, my conclusion is: Connect ot Outlook does not work on a SharePoint 2010 External List when you are running 64-bit Office 2010.


CAML Query for ListItemCollection within a Folder ListItem in a List (Not "SPList")

  

Hey all,

 

I'm in the process of creating a Silverlight Application that needs to pull data from a SharePoint list.  Unfortunately, some of the data is within sub-folders, and calling the List.GetItems(CamlQuery) function is only returning the root level (no sub-folder content).

 

I noticed from searching around for the solution to this that an attribute exists for doing a recursive check, so all the list items could be returned, but all the times this solution is mentioned is in regards to getting an SPList and using an SPQuery. The SPQuery variable has a ViewAttributes property to do this, apparently, but I don't seem to have that specific of a choice with the CamlQuery variable type here.

 

Any help?


Caml Query to fetch the data from Sharepoint List for a specific date.

  

Hello,

I have a sharepoint list with one of hte columns being Created Date of Type DateTime and value allowed is OnlyDate.

The submitted date in my column is 05/18/2011. When I perform a search using the below CAML query, it does not give any results though I have two items with this date.

<Where><Eq><FieldRef Name='Date_x0020_Created' /><Value Type='DateTime'>5/18/2011</Value></Eq></Where>

I dont understand what is wrong with this query. Someone please help


Janaki Thakur

Query an arraylist of array list using linq

  

I have an array list called Customer. I t holds a list of array list which has the account details.

proj.customer -> collection of arraylist of type customer

proj.customer.account -> collection of arraylist of type account


Account array list holds type account and it has a poperty account balance. How can I query all accounts which has account balance  >100


I tried the following one

var Accountlist= from Account accountdetails in proj.customer.account

where accountid.balance >100

select accountdetails.id

But it is always throwing an error saying cannot cast type customer to type account

Please help


Delete not working on List.aspx - out of box

  

Hello,


I'am trying to use Dynamic data web site on my project. I have Visual Studio 2010 enf Framework 4.0. I create the default project with the wizard. I add my own Entity Data Model.

When I try to use the "delete" autogenerated button on List.aspx, on the table ServerSetting (see image below), I receive a null exception.  I have no custom code involved in this operation and cannot seem to determine what is Null.

Any help would be appreciated!



Thanks,




Ben

[NullReferenceException: Object reference not set to an instance of an object.]
   System.Data.Objects.Internal.ForeignKeyFactory.CreateConceptualNullKey(EntityKey originalKey) +30
   System.Data.Objects.DataClasses.EntityReference.NullAllForeignKeys() +722
   System.Data.Objects.EntityEntry.NullAllForeignKeys() +235
   System.Data.Objects.EntityEntry.Delete(Boolean doFixup) +77
   System.Data.Objects.EntityEntry.Delete() +9
   System.Data.Objects.ObjectContext.DeleteObject(Object entity, EntitySet expectedEntitySet) +169
   System.Data.Objects.ObjectContext.DeleteObject

SharePoint Designer: insert custom list not working anymore

  

Hello,

Suddenly sharepoint designer decided today that it doesn't want to insert a custom list form anymore...
To be more specific, it doesn't work anymore in a site that uses the Microsoft budgeting and tracking template. In a website that uses an out of the box template, it still works.

It did work before, because I did it in other websites using the same template (it's broken there as well now).

Why oh why does SharePoint refuse to do this now?
I searched google and here on the forums, but all I could find was some issues after installing SP1, but we did that already long time ago and it was still working after that. I checked with our infrastructure guys and they didn't install new updates they say.

I also tried the solutions listed here: http://blogs.msdn.com/spdsupport/archive/2008/07/03/how-to-fix-custom-list-forms-will-not-insert-or-show-up-on-the-design-surface-of-sharepoint-designer.aspx
But they don't fix the problem.

So my problem is, I can go to Insert > SharePoint Controls > Custom List Form
I pick my list, content type and form type, I hit OK and... nothing happens.

Slow page load during a list query one time during the day

  

We have a monitoring tool set to check to see if the home pages for our 3 web apps load in under 60 seconds every 10 minutes.  All 3 web apps load in under 3 seconds on every 10 minute check except for one exception.  One check every day one of the web app's home page takes longer than 60 seconds to load.  This happens at 11:45PM when there is very little user usage on the environment.  The characteristics of this page are as follows: The only thing on the page is a list view web part which was added by the browser.  The page has not been customized with SPD or code at all.  The list that it pulls is a simple links list that has 281 items on it.  The view pulls all 281 items and displays them in sets of 100.  I cannot find any associated event in the server events and/or SharePoint ULS logs nor are there any daily sharepoint timer jobs running at that time.  Our full index happens at midnight with incremental happening hourly.  Our enviroment is 2 WFEs, 1 App/indexer and we have a separate SQL cluster backend.  

Could someone lead me possibly in the direction I should take next in my troubleshooting?   


Linq query results to List collection

  

Hello

I have a GridView in my page. I want to use below code in code beind. query nothwing DB using linq . add linq query result to new list and then bind list as gridview Datasource

I use below code . But I don't know how to add results to List? Could any one tell me how !


Public Class OrderCity
        Private _name As String
        Private _city As String
        Public Property name As String
            Get
                Return _name
            End Get
            Set(ByVal value As String)
                _name = value

            End Set
        End Property
        Public Property city As String
            Get
                Return _city
            End Get
            Set(ByVal value As String)
                _city = value

            End Set
        End Property
    End Class
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim dbe As New SFFAV1DataContext
        Dim latestadsDs = From p In dbe.Products _
                            Select New With {p.Title, p.ProducedCity} _
                             Take (2)

        Dim FilteredList As New List(Of OrderCity)()
        For Each result In latestadsDs
            Dim Menedfcou = Nothing
            FilteredList.Insert(0, Menedfcou)
        Next
     
         GridView1.Da

Video: SharePoint 2010 Lists, List Data, and CAML

  
This demonstration illustrates how to work with list data and the Collaborative Application Markup Language (CAML). (Length: 5:05)

Pivot w/o aggregation...query not working

  
Hi all--Given this query, I need to make this query into a pivot table: select Personnel_id, First Name, Last Name, E-mail, Division, Region, Country, Manager, Question, Answer, Date Completed from #pivot where Question Answer 01. Received File No 02. Read File Yes 03. Signed File Yes ... Needs to look like this: Personnel_id First Name ... 01. Received File 02. Read File 03. Signed File ... Test01 Test No Yes Yes I have the following pivot query: SELECT [Personnel_id] ,[First Name] ,[Last Name] ,[Email] ,[Division] ,[Region] ,[Country] ,[Manager] ,[Question] ,[Answer] ,[Date Completed] FROM (SELECT [Personnel_id] ,[First Name] ,[Last Name] ,[Email] ,[Division] ,[Region] ,[Country] ,[Manager] ,[Question] ,[Answer] ,[Date Completed] FROM #pivot) topvt PIVOT (MAX([Personnel_id]) FOR Answer in ([1],[2], [3], [4], [5], [6], [7], [8] , [9], [10])) as pvt ORDER BY pvt.[Personnel_id] I get this error: Msg 207, Level 16, State 1, Line 83 Invalid column name 'Personnel_id'. Any ideas? Thanks!

Transact-sql - tricky query to get a list of people from a table where i belong too.

  
I've no idea how to manage and optimize this query: I've four table. - User (userId, name) - Member (memberId, name, ownerId) The ownerId = user.userId - PresentPeople (activityId, presentId, ...) so presentId = memberId - Activity (activityId, ownerId, startDate...) and ownerId = user.userId So here for an user, I need members created by this user, and for this members I need the list of presentPeople for the activity that theyjoined. But I don't know how to get this list because they are in the list. Not sure if i'm clear there, Big help would be very helpfull :)) thanks
Categories: 
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