一个SQLite表声明如下:Vici CoolStorage支持MonoTouch的UniqueIdentifier密钥?
CREATE TABLE Note(Id UNIQUEIDENTIFIER, Title TEXT)
正确的维西CoolStorage在Windows上阅读,但对MonoTouch的,下面的异常被抛出:
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidCastException: Cannot cast from source type to destination type. at Vici.CoolStorage.CSDataProviderSQLite.GetSchemaColumns (System.String tableName) [0x00000] in <filename unknown>:0 at Vici.CoolStorage.CSSchema.CreateColumns() [0x00000] in <filename unknown>:0 at Vici.CoolStorage.CSSchema..ctor (System.Type objType) [0x00000] in <filename unknown>:0 at Vici.CoolStorage.CSSchema.Get (System.Type objectType) [0x00000] in <filename unknown>:0 at Vici.CoolStorage.CSList``1[Store.CoolStorage.Note]..ctor() [0x00000] in <filename unknown>:0
它看起来像代码基于类型ID检测列的数据类型不处理Vici的CSDataProviderSqlite for MonoTouch中的UNIQUEIDENTIFIER类型:
From CSSqliteConnection.GetSch ema:
switch (dbType)
{
case "TEXT": dataType = typeof(string); break;
case "VARCHAR": dataType = typeof(string); break;
case "INTEGER": dataType = typeof(int); break;
case "BOOL": dataType = typeof(bool); break;
case "DOUBLE": dataType = typeof(double); break;
case "FLOAT": dataType = typeof(double); break;
case "REAL": dataType = typeof(double); break;
case "CHAR": dataType = typeof(string); break;
case "BLOB": dataType = typeof(byte[]); break;
case "NUMERIC": dataType = typeof(decimal); break;
case "DATETIME": dataType = typeof(DateTime); break;
}
这里没有UNIQUEIDENTIFIER的处理函数。这是Vici CoolStorage中的一个错误吗?
这不是一个错误,但它没有明确支持 – 2013-02-11 10:04:42
@Philippe,有没有解决这个异常在MonoTouch?谢谢。 – bright 2013-02-11 10:29:01