using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;
namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SPList mylist=new SPSite ("http://sharepointblog").OpenWeb ().Lists ["Products"];
SPQuery query=new SPQuery ();
query.Query = "
SPListItemCollection items=mylist.GetItems (query);
foreach (SPListItem proditem in items )
{
Response.Write(proditem["Title"].ToString ());
Response.Write(proditem["Cost"]);
}
}
}
}
No comments:
Post a Comment