我寫的小WM 6.1的應用程序,其讀取和寫入XML,但我得到以下異常:的Windows Mobile 6 System.PlatformNotSupportedException
System.PlatformNotSupportedException was unhandled
Message="PlatformNotSupportedException"
StackTrace:
at System.Globalization.CompareInfo..ctor(Int32 culture)
at System.Globalization.CompareInfo.GetCompareInfo(Int32 culture)
at System.Globalization.CultureInfo.get_CompareInfo()
at System.CultureAwareComparer..ctor(CultureInfo culture, Boolean ignoreCase)
at System.StringComparer.Create(CultureInfo culture, Boolean ignoreCase)
at System.Data.DataTable.GetSpecialHashCode(String name)
at System.Data.DataColumnCollection.RegisterColumnName(String name, DataColumn column, DataTable table)
at System.Data.DataColumnCollection.BaseAdd(DataColumn column)
at System.Data.DataColumnCollection.AddAt(Int32 index, DataColumn column)
at System.Data.DataColumnCollection.Add(DataColumn column)
at System.Data.DataColumnCollection.Add(String columnName, Type type)
at MyApp.Settings.CreateDT(String Setting, String Key, String Value)
at MyApp.Program.Main()
這裏是CreatDT方法體:
public static DataTable CreateDT(string Setting, string Key, string Value)
{
DataTable dt;
dt = new DataTable(Setting);
dt.Columns.Add("Key", Type.GetType("System.String")); //<-- error here
dt.Columns.Add("Value", Type.GetType("System.String"));
AddRow(ref dt, Key, Value);
return dt;
}
任何機構幫幫我?
嘗試用'typeof(string)'替換Type.GetType(「System.String」)'(我沒有任何測試代碼的方法,只是猜測)。 – Alex 2012-08-13 12:43:33
'typeof(string)'not working – someone 2012-08-13 13:12:01
@PawelZ此選項已經檢查 – someone 2012-08-14 09:19:21