Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

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

  Asked By: Joshua Scott         Date: Oct 02, 2009      Category: Sharepoint      Views: 653
 

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.

Tagged:                    

 

3 Answers Found

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

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, 2009       

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, 2009       

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.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].