Reputation: 627
I have the below code to search by EmployeeID to find BirthDate but it doesn't seem to work and I'm unsure why, it says something about invalid arguments. Any ideas?
String birthDate = dsEmployees.Employees.FindByEmployeeID(ID).BirthDate.ToString();
Just says :
1 The best overloaded method match for 'Northwind.dsEmployees.EmployeesDataTable.FindByEmployeeID(int)' has some invalid arguments C:\Users\Kimmy\Documents\Visual Studio 2008\Projects\Northwind\Northwind\frmSignIn.cs 43 33 Northwind
Upvotes: 0
Views: 165
Reputation: 108937
try
String birthDate =
dsEmployees.Employees.FindByEmployeeID(Convert.ToInt32(ID.ToString())).BirthDate.ToString();
Upvotes: 1
Reputation: 740
I'm not sure how your FindByEmployeeID() function work but taking the value of a single cell in a dataset is usually done this way :
dataSet.Tables["tablename"].Rows["rowNumber"]["ColumnName"].toString();
Upvotes: 0
Reputation: 7332
Invalid Argument often means that you are passing a wrong parameter to a function. This probably means the variable ID is not ok :)
But you have provided less than enough information to solve your problem.
Upvotes: 1