jeff Lee
asked on
Send field name and DataTable as parameters to Function in C#
Hi,
When I insert data to some table, I must get the max serial number on the table for now. I create a function to get max serial number on the table.
How to write the following code to send field name and DataTable as parameters to Function.
vs_seriesno = U_MaxSN(some field name, some table name);
Thanks.
jeff
When I insert data to some table, I must get the max serial number on the table for now. I create a function to get max serial number on the table.
How to write the following code to send field name and DataTable as parameters to Function.
public static int U_MaxSN(string vfield, string vTable)
{
cmd = "select max(vfield) seriesno from vTable" <-----here is my problem.
}
If I want to get the max serial number on some table .vs_seriesno = U_MaxSN(some field name, some table name);
Thanks.
jeff
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's correct. You are the best.
Thanks.
jeff