Darth_Vader
New Member
here is the image of the model. You can see the column i am searching is type string.! http://imgur.com/kU1T7now i just want to take input from a text box and match it with the desired column.\[code\]protected void Button1_Click(object sender, EventArgs e){ String val = Convert.ToString(TextBox1.Text.Trim()); Entities query = new Entities(); var txn = (from p in query.MAINs where p.PAN.Equals(val, StringComparison.OrdinalIgnoreCase) select p).ToList(); GridView1.DataSource = txn.ToList(); GridView1.DataBind();}\[/code\]but the query returns null(rowcount=0). i have checked the val variable. its sending the exact parameter. when i am giving the value direct then its returning result.\[code\]protected void Button1_Click(object sender, EventArgs e){ String val = Convert.ToString(TextBox1.Text.Trim()); Entities query = new Entities(); var txn = (from p in query.MAINs where p.PAN.Equals("1010170000000030", StringComparison.OrdinalIgnoreCase) select p).ToList(); GridView1.DataSource = txn.ToList(); GridView1.DataBind();}\[/code\]i am newbie to linq and entity framework. This thing driving me nuts. Have no idea why taking input from a text box is not working. Any kinda help will be greatly appreciated as i am stuck in this for 3 days.please help me out.