void initCommandDelete(DbDataAdapter pAdp, ITableDescriptor pTabDesc) { if (string.IsNullOrEmpty(pTabDesc.getNameFull())) { throw new MyExceptionError("Db Table Full name is null or empty"); } bool hasRecVers = pTabDesc.getColumn(TableDUMMY.RECVERS) != null; List <SqliteParameter> listPrm = new List <SqliteParameter>(); StringBuilder buffer = new StringBuilder(); // // buffer.Append("DELETE FROM "); //buffer.Append("\""); buffer.Append(pTabDesc.getNameFull()); //buffer.Append("\""); //buffer.Append(pTableFullName); buffer.Append(" WHERE "); string[] arr_ = hasRecVers ? new string[] { TableDUMMY.LOGICALREF, TableDUMMY.RECVERS } : new string[] { TableDUMMY.LOGICALREF }; int prmIndx = 0; buffer.Append("("); for (int i = 0; i < arr_.Length; ++i) { if (i > 0) { buffer.Append(" AND "); } SqliteParameter prm = new SqliteParameter(); ++prmIndx; prm.ParameterName = ToolSqlText.getNewParamName(prmIndx); prm.SourceVersion = DataRowVersion.Original; prm.SourceColumn = arr_[i]; //prm.Size = col.size; listPrm.Add(prm); buffer.Append(string.Format("{0} = {1}", prm.SourceColumn, prm.ParameterName)); } buffer.Append(")"); // pAdp.DeleteCommand = environment.getNewSqlCommand(buffer.ToString(), listPrm.ToArray()); }
public int getColumnSize(string pTableName, string pColName, int pDef) { if (ToolColumn.isColumnFullName(pColName)) { pTableName = ToolColumn.extractTableName(pColName); pColName = ToolColumn.extractColumnName(pColName); } ITableDescriptor tds = getTable(pTableName); if (tds != null) { ColumnDescriptor cds = tds.getColumn(pColName); if (cds != null) { return(cds.size); } } return(pDef); }