troubleshooting Question

Send field name and DataTable as parameters to Function in C#

Avatar of jeff Lee
jeff Lee asked on
C#
2 Comments1 Solution10 ViewsLast Modified:
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.
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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros