Пример #1
0
    public static DataTable Execute_Query(SqlCommand cmd)
    {
        cmd.Connection  = Create_Connection.open_Connection();
        cmd.CommandType = CommandType.StoredProcedure;
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataTable      dt = new DataTable();

        da.Fill(dt);
        return(dt);
    }
Пример #2
0
 public static int Execute_Non_Query(SqlCommand cmd)
 {
     try
     {
         cmd.Connection  = Create_Connection.open_Connection();
         cmd.CommandType = CommandType.StoredProcedure;
         return(cmd.ExecuteNonQuery());
     }
     finally
     {
         Create_Connection.close_Connection();
     }
 }