I am trying to search DB using LINQ to SQL and display it. I tried below code but it not showing record matching to criteria on console.
Here Details is table name
Detail detail = new Detail();
Console.Write("\nEnter ID to Search Record :");
int id = Convert.ToInt32(Console.ReadLine());
var searchbyId = from search in db.Details
where search.Id == id
select search;
db.SubmitChanges();
Console.WriteLine("\n Search Results \n");
Console.WriteLine(String.Format("Id \t | Name \t | Last Name \n"));
Console.WriteLine(String.Format("{0} \t | {1} \t | {2} ",
detail.Id,detail.Name, detail.LastName));
Newbie trying to learn LINQ
detailhere?db.SubmitChanges();?