Код: Выделить всё
public byte[] Output()
{
byte[] temp = null;
int col = Columns + 1;
if(read.Read())
{
read.GetBytes(col, 0, temp, 0, 2048); //exception is thrown here
}
return temp;
}
РЕДАКТИРОВАТЬ: новая информация. Вот трассировка стека из исключения:
Код: Выделить всё
StackTrace:
at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
at System.Data.SQLite.SQLiteDataReader.GetBytes(Int32 i, Int64 fieldOffset, Byte[] buffer, Int32 bufferoffset, Int32 length)
at SQLiteSort.Sort.Output() in C:\Users\cjones\Documents\Visual Studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\Sort.cs:line 192
at SQLiteSort.Sort.Main(String[] args) in C:\Users\cjones\Documents\Visual Studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\Sort.cs:line 72
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Похоже, что исключение создается SQLiteDataReader.VerifyType(), это смотрит на столбец используется для типа DbType.Binary и выдает исключение, если столбец не является DbType.Binary, DbType.String или DbType.Guid. Я проверял таблицу снова и снова, и она по-прежнему показывает тип столбца как большой двоичный объект.
Подробнее здесь: https://stackoverflow.com/questions/107 ... g-getbytes
Мобильная версия