SPWeb web = SPContext.Current.Web;
SPList customerList = web.Lists.TryGetList("MyList");
if (customerList != null)
{
SPQuery query = new SPQuery();
query.Query =
string.Format(
"<Where><BeginsWith><FieldRef Name='ProductNumber' /><Value Type='Text'>{0}</Value></BeginsWith></Where>");
query.RowLimit = 10;
SPListItemCollection items = customerList.GetItems(query);
foreach (SPListItem customer in items)
{
TextBox_Name.Text = customer["Title"].ToString();
TextBox_ProdNum.Text = customer["ProductNumber"].ToString();
TextBox_Color.Text = customer["Color"].ToString();
TextBox_ListPrice.Text = customer["ListPrice"].ToString();
TextBox_MoreInfo.Text = customer["More Info"] != null
? customer["More Info"].ToString()
: string.Empty;
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
|
|||||||||||
|
|
Maybe I am just stupid but you aren't formatting any variable into the CAML statement at all.
|
|||
|
|
