public static int smethod_8(string string_0, ref Exception exception_0, string string_1) { int num; DBA.serlog(string_0); using (SqlConnection sqlConnection = new SqlConnection(DBA.smethod_3(null))) { using (SqlCommand sqlCommand = new SqlCommand(string_0, sqlConnection)) { try { sqlConnection.Open(); } catch (Exception exception) { exception_0 = exception; num = -1; return(num); } int num1 = sqlCommand.ExecuteNonQuery(); sqlCommand.Dispose(); sqlConnection.Close(); sqlConnection.Dispose(); return(num1); } } return(num); }
public static int smethod_7(string string_0, string string_1) { int num; DBA.serlog(string_0); using (SqlConnection sqlConnection = new SqlConnection(DBA.smethod_3(string_1))) { using (SqlCommand sqlCommand = new SqlCommand(string_0, sqlConnection)) { int num1 = -1; try { sqlConnection.Open(); } catch { num = -1; return(num); } try { num1 = sqlCommand.ExecuteNonQuery(); } catch (Exception exception) { DBA.smethod_2(string_0, null, exception); } sqlCommand.Dispose(); sqlConnection.Close(); sqlConnection.Dispose(); return(num1); } } return(num); }
public static ArrayList smethod_14(string string_0, string string_1) { ArrayList arrayLists; DBA.serlog(string_0); using (SqlConnection sqlConnection = new SqlConnection(DBA.smethod_3(null))) { using (SqlCommand sqlCommand = new SqlCommand(string_0, sqlConnection)) { try { sqlConnection.Open(); } catch { arrayLists = null; return(arrayLists); } SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(); if (sqlDataReader.HasRows) { ArrayList arrayLists1 = new ArrayList(); if (sqlDataReader.Read()) { for (int i = 0; i < sqlDataReader.FieldCount; i++) { arrayLists1.Add(sqlDataReader[i]); } } sqlDataReader.Close(); sqlDataReader.Dispose(); sqlConnection.Close(); sqlConnection.Dispose(); return(arrayLists1); } else { sqlDataReader.Close(); sqlDataReader.Dispose(); sqlConnection.Close(); sqlConnection.Dispose(); arrayLists = null; } } } return(arrayLists); }
public static DataTable smethod_9(string string_0, SqlParameter[] sqlParameter_0) { DataTable dataTable; DBA.serlog(string_0, sqlParameter_0); using (SqlConnection sqlConnection = new SqlConnection(DBA.smethod_3(null))) { using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter()) { SqlCommand sqlCommand = SqlDBA.smethod_7(sqlConnection, string_0, sqlParameter_0); SqlCommand sqlCommand1 = sqlCommand; sqlDataAdapter.SelectCommand = sqlCommand; using (sqlCommand1) { try { sqlConnection.Open(); } catch (Exception exception1) { Exception exception = exception1; Form1.WriteLine(100, string.Concat("DBA数据层_错误", exception.Message, " ", string_0)); dataTable = null; return(dataTable); } DataTable dataTable1 = new DataTable(); try { sqlDataAdapter.Fill(dataTable1); } catch (Exception exception2) { DBA.smethod_2(string_0, sqlParameter_0, exception2); } sqlDataAdapter.Dispose(); sqlConnection.Close(); sqlConnection.Dispose(); return(dataTable1); } } } return(dataTable); }
public static DataTable GetDBToDataTable(string string_0, string string_1) { DataTable dataTable; DBA.serlog(string_0); using (SqlConnection sqlConnection = new SqlConnection(DBA.smethod_3(string_1))) { using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter()) { SqlCommand sqlCommand = new SqlCommand(string_0, sqlConnection); SqlCommand sqlCommand1 = sqlCommand; sqlDataAdapter.SelectCommand = sqlCommand; using (sqlCommand1) { try { sqlConnection.Open(); } catch { dataTable = null; return(dataTable); } DataTable dataTable1 = new DataTable(); try { sqlDataAdapter.Fill(dataTable1); } catch (Exception exception) { DBA.smethod_2(string_0, null, exception); } sqlDataAdapter.Dispose(); sqlConnection.Close(); sqlConnection.Dispose(); return(dataTable1); } } } return(dataTable); }
public static object smethod_18(string string_0, string string_1) { object obj; DBA.serlog(string_0); object obj1 = null; using (SqlConnection sqlConnection = new SqlConnection(DBA.smethod_3(string_1))) { using (SqlCommand sqlCommand = new SqlCommand(string_0, sqlConnection)) { try { sqlConnection.Open(); } catch { obj = null; return(obj); } try { obj1 = sqlCommand.ExecuteScalar(); } catch (Exception exception1) { Exception exception = exception1; Form1.WriteLine(100, string.Concat("DBA数据层_错误", exception.Message, " ", string_0)); } sqlCommand.Dispose(); sqlConnection.Close(); sqlConnection.Dispose(); return(obj1); } } return(obj); }