示例#1
0
        private string GenerateUpdateSetStatement(DataSet dsTableColumns)
        {
            string str = string.Empty;

            for (int index = 0; index < dsTableColumns.Tables[0].Rows.Count; ++index)
            {
                string strColumnName = dsTableColumns.Tables[0].Rows[index]["COLUMN_NAME"].ToString();
                if (!SqlDatabaseHelper.ColumnIsPrimaryKey(this.TableName, strColumnName))
                {
                    if (index == dsTableColumns.Tables[0].Rows.Count - 1)
                    {
                        str = str + "[" + strColumnName + "] = @" + strColumnName;
                    }
                    else
                    {
                        str = str + "[" + strColumnName + "] = @" + strColumnName + ",";
                    }
                }
            }
            return(str);
        }