Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

How to write caml queries to get all columns from a list

  Asked By: Joshua    Date: Oct 02    Category: Sharepoint    Views: 7269

By using SPQuery, how to get all details from a list.

//Filtered Query
“SPQueryquery = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='State' /> <Value Type='Text'>" +
strState + "</Value> </Eq></Where>";”

In a custom list called “State”, I have created 2 columns.
1) State Id, 2) State

I need to get 2 columns data without any filter. How/what should I write a query
for this.

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Emerson Franks     Answered On: Oct 02

Unless you are trying to limit the columns  returned to just those two columns
you won't need a query. Just access the SPListItems collection of the list.

 
Answer #2    Answered By: Ned Storm     Answered On: Oct 02

That's correct,, since you are not applying any filter  or order by..
you don't need any caml  query.

 
Answer #3    Answered By: Myron Calhoun     Answered On: Oct 02

Solution:SPWeb........................

 
Didn't find what you were looking for? Find more on How to write caml queries to get all columns from a list Or get search suggestion and latest updates.




Tagged: