Example #1
0
        public static void Update(Dictionary <string, object> values, string tableName, string whereStatement, SqlConnection connection, SqlTransaction transaction)
        {
            string sql = SqlGeneralAccess.GetSqlUpdateStatement(values.Keys.ToList(), tableName, whereStatement);
            IList <SqlParameter> parameters = SqlGeneralAccess.GetParemeters(values);

            SqlRequest sqlRequest = new SqlRequest(sql, parameters);

            Update(sqlRequest, connection, transaction);
        }
Example #2
0
        public static DataTable Select(Dictionary <string, object> values, string tableName, string whereStatement, string connectionString)
        {
            string         sql        = SqlGeneralAccess.GetSqlSelectStatement(values.Keys.ToList(), tableName, whereStatement);
            SqlConnection  connection = new SqlConnection(connectionString);
            SqlCommand     command    = new SqlCommand(sql, connection);
            SqlDataAdapter adapter    = new SqlDataAdapter(command);
            DataTable      table      = new DataTable();

            adapter.Fill(table);
            return(table);
        }