Пример #1
0
        public void DeleteRow(DataRow row)
        {
            SqlMaker gen = new SqlMaker(TableName.FormalName);

            if (hasPhysloc)
            {
                gen.PrimaryKeys = new string[] { PHYSLOC };
                int    rowId = (int)row[colRowID, DataRowVersion.Original];
                byte[] loc   = LOC[rowId];
                gen.Add(PHYSLOC, loc);
            }
            else
            {
                gen.PrimaryKeys = parimaryKeys;
                gen.AddRange(row, DataRowVersion.Original);
            }

            string SQL = gen.Delete();

            new SqlCmd(TableName.Provider, SQL).ExecuteNonQuery();
            row.AcceptChanges();
        }
Пример #2
0
        private SqlBuilder UpdateClause(string column, DataRow row, object value)
        {
            SqlMaker gen = new SqlMaker(TableName.FormalName);

            if (hasPhysloc)
            {
                gen.PrimaryKeys = new string[] { PHYSLOC };
                int    rowId = (int)row[colRowID];
                byte[] loc   = LOC[rowId];
                gen.Add(PHYSLOC, loc);
                gen.Add(column, value);
            }
            else
            {
                gen.PrimaryKeys = parimaryKeys;
                gen.AddRange(row);
                gen.Add(column, value);
                gen.Remove(ROWID_HEADER);
            }

            gen.Update();
            return(new SqlBuilder(TableName.Provider).Append(gen.Update()));
        }