public static DataTable Get(string CommandText, SqlParameter[] Params) { try { using (SqlConnection connection = new SqlConnection(Login.getConnection())) { SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = CommandText; cmd.Parameters.AddRange(Params); cmd.Connection = connection; cmd.CommandTimeout = 600; connection.Open(); SqlDataAdapter adapter = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); adapter.Fill(dt); return dt; } } catch (Exception ex) { throw ex; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)