Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }