Himukesh1,
Check this example. Now please take its reference and correct your code.
SQL
CREATE TABLE Org_Leisure(ID INT IDENTITY PRIMARY KEY,Mode_no VARCHAR(20))
INSERT INTO Org_Leisure VALUES('111')
INSERT INTO Org_Leisure VALUES('112')
INSERT INTO Org_Leisure VALUES('113')
INSERT INTO Org_Leisure VALUES('114')
INSERT INTO Org_Leisure VALUES('115')
INSERT INTO Org_Leisure VALUES('116')
HTML
Start:<asp:TextBox ID="txtstartchk" runat="server" />
<br />
End:<asp:TextBox ID="txtendchk" runat="server" />
<asp:Button Text="Search" runat="server" OnClick="Search" />
<br />
<asp:GridView runat="server" ID="gvDetails" EmptyDataText="No record found" />
C#
protected void Search(object sender, EventArgs e)
{
TestEntities db = new TestEntities();
int startchk = Convert.ToInt32(txtstartchk.Text.Trim());
int endchk = Convert.ToInt32(txtendchk.Text.Trim());
var chklists = db.Org_Leisure.AsEnumerable()
.Where(s =>
{
var val = 0;
if (int.TryParse(s.Mode_no, out val))
{
return val >= startchk && val <= endchk;
}
else { return false; }
});
gvDetails.DataSource = chklists;
gvDetails.DataBind();
}
Screenshot