The first part of the attached code works and finds a random RecordId. I also need the EmployeeId. Since there is only one EmpId for each RcdId, I'm trying to find code to retrieve one record with a RecId of txtRcdId (which is the end result of the code).
I added the last 2 lines to try and accomplish this but I get the error...
' does not contain a definition for 'Tables' and no
extension method 'Tables' accepting a first argument of
' could be found (are you missing a using
directive or an assembly reference?)
I 'm really new to C# and could really use some detailed help. My environment is Visual Studio, the language is C# and I'm attached to a SQL Server db.
var dbTimeClockPlus = new TimeClockPlusDataContext();
var SearchInfo = (from c in dbTimeClockPlus.EmployeeLists where c.Suspend == false select c.RecordId).FirstOrDefault();
Random r = new Random();
int RcdId = SearchInfo == 0 ? 1 : SearchInfo;
RcdId = r.Next(1, RcdId);
txtRcdId.Text = Convert.ToString(RcdId);
//This part does not work...
returnedRows = dbTimeClockPlus.Tables["EmployeeLists"].Select(txtRcdId);