Beispiel #1
0
        private void UpdateTextField(LanguageTableInfo languageTable)
        {
            string SqlQuery = string.Empty;

            try
            {
                if (languageTable.TextColumnSize == -1)
                {
                    SqlQuery = " UPDATE " + languageTable.TableName
                               + " SET " + languageTable.ColumnName + " = '#' & " + languageTable.ColumnName;
                }
                else
                {
                    SqlQuery = " UPDATE " + languageTable.TableName
                               + " SET " + languageTable.ColumnName + " = '#' &" +
                               " iif( len(" + languageTable.ColumnName + ")>" + languageTable.TextColumnSize + " ,left(" + languageTable.ColumnName + ", " + languageTable.TextColumnSize + " ) ," + languageTable.ColumnName + ") ";
                }

                this.DBConnection.ExecuteNonQuery(SqlQuery);
            }
            catch (Exception ex)
            {
                ExceptionFacade.ThrowException(ex);
            }
        }
        private void UpdateTextField(LanguageTableInfo languageTable)
        {
            string SqlQuery = string.Empty;
            try
            {
                if (languageTable.TextColumnSize == -1)
                {
                    SqlQuery = " UPDATE " + languageTable.TableName
                                  + " SET " + languageTable.ColumnName + " = '#' & " + languageTable.ColumnName;
                }
                else
                {
                    SqlQuery = " UPDATE " + languageTable.TableName
                              + " SET " + languageTable.ColumnName + " = '#' &" +
                    " iif( len(" + languageTable.ColumnName + ")>" + languageTable.TextColumnSize + " ,left(" + languageTable.ColumnName + ", " + languageTable.TextColumnSize + " ) ," + languageTable.ColumnName + ") ";
                }

                this.DBConnection.ExecuteNonQuery(SqlQuery);
            }
            catch (Exception ex)
            {
                ExceptionFacade.ThrowException(ex);
            }
        }