Universal stored procedure function

zhaozj2021-02-16  159

///

// / execute stored procedure, CNN database connection object /// /// parameter array /// Stored Procedure Name

Public void excdupro (String Procudurename, parameter [] Proparameter

{

SqlCommand cmd = new SqlCommand (); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = procudureName; for (int i = 0; i

Try {if (cnn.state == system.data.connectionState.closed) cnn.open (); return cmd.executeReader ();} catch (system.data.sqlclient.sqlexception e) {throw new exception (E.MESSAGE } Finally {cmd.dispose ();}}

转载请注明原文地址:https://www.9cbs.com/read-7770.html

New Post(0)