Hi sureshMGR,
Check this example. Now please take its reference and correct your code.
Database
For this example I have used of Northwind database that you can download using the link given below.
Download Northwind Database
C#
protected void Page_Load(object sender, EventArgs e)
{
NorthwindEntities db = new NorthwindEntities();
List<Employee> employees = new List<Employee>();
int id = 0;
string employeeId = id > 0 ? id.ToString() : "";
int ext = 0;
string extension = ext > 0 ? ext.ToString() : "";
employees = db.Employees.ToList()
.Where(x => x.EmployeeID.ToString().StartsWith(employeeId.ToString()))
.Where(x => x.Extension.ToString().StartsWith(extension.ToString()))
.ToList();
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim db As NorthwindEntities = New NorthwindEntities()
Dim employees As List(Of Employee) = New List(Of Employee)()
Dim id As Integer = 0
Dim employeeId As String = If(id > 0, id.ToString(), "")
Dim ext As Integer = 0
Dim extension As String = If(ext > 0, ext.ToString(), "")
employees = db.Employees.ToList() _
.Where(Function(x) x.EmployeeID.ToString().StartsWith(employeeId.ToString())) _
.Where(Function(x) x.Extension.ToString().StartsWith(extension.ToString())) _
.ToList()
End Sub