/// <summary> /// Convert TableColumn to Pascal Form /// </summary> /// <param name="dtColumns"></param> /// <returns>All TableColumn has Pascal Form return true,else return false</returns> public static bool GetColRelaPascalName(DataTable dtColumns) { Dictionary <string, string> dic = XmlControl.ReadXml(); for (int i = 0; i < dtColumns.Rows.Count; i++) { string colName = dtColumns.Rows[i]["Column_Name"].ToString(); if (dic.ContainsKey(colName)) { dtColumns.Rows[i]["PascalName"] = dic[colName]; } else { return(false); } } return(true); }
public static DataTable GetColumnAndPascalNameFromXml(string tableName, EnumDbType dbType) { DataTable dtColumns = ColumnControl.GetTableColumnsByTableName(tableName, dbType); XmlControl.CreateCorrespondingXmlWhenNotExist(); var dic = XmlControl.ReadXml(); for (int i = 0; i < dtColumns.Rows.Count; i++) { string name = dtColumns.Rows[i]["Column_Name"].ToString(); if (dic.ContainsKey(name)) { dtColumns.Rows[i]["PascalName"] = dic[name]; } } dtColumns.AcceptChanges(); return(dtColumns); }