using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class crudoperations : System.Web.UI.Page { inventoryDataContext obj = new inventoryDataContext(); protected void Page_Load(object sender, EventArgs e) { } protected void btnDisplay_Click(object sender, EventArgs e) { //displaying the product information based onn the entered by user with in textbox1 var result = from p in obj.products where p.prodid=txtprodid.Text*************here iam getting the error****** select p; if (result.Count() == 0) Response.Write("<h1>no products</h1>"); else { foreach (var pp in result) { txtProddesc.Text = pp.proddesc; txtPrice.Text = pp.price.ToString() ; } } } }
var result = from p in obj.products where p.prodid==Convert.ToBoolean(txtprodid.Text.Trim())//Corrected here select p;
Quote:txtprodid.Text.Trim()
var result = from p in obj.products where p.prodid=txtprodid.Text*************here iam getting the error****** select p;
var result = from p in obj.products where p.prodid==txtprodid.Text select p;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)