I'm new to LINQ to SQL world - So I'm sorry if the question is stupid :) - I just could not find any answer on the internet:
I have a table with two columns - "Batch_Name" and "Batch_id". The user select the batch id and the application needs to return its name.
I have this C# Code to extract the batch name according to the batch id ("myBatchNum"):
var thisBatch = from x in gridDB.batches
where x.batch_id == myBatchNum
select new { x.batch_name };
lblBatchName.Text = thisBatch.First().ToString();
This extract from the proper batch name, but when I try to display the name on a label control, I get this result ("NightBatch is the name in the DB):
{batch_name = NightBatch }
How do I extract the batch name from "thisBatch" properly to the label control?
Thank you so much, Nim.