- Moderator
- #71
I do not understand the logic of this procedure, why do we always ask the number of columns? MediaPortal/MediaPortal-1
Maybe it would be easier and more logical to move this to the line MediaPortal/MediaPortal-1
And then the source code will be like this:
We delete this lines - MediaPortal/MediaPortal-1 MediaPortal/MediaPortal-1
And MediaPortal/MediaPortal-1 change to:
Maybe it would be easier and more logical to move this to the line MediaPortal/MediaPortal-1
And then the source code will be like this:
We delete this lines - MediaPortal/MediaPortal-1 MediaPortal/MediaPortal-1
And MediaPortal/MediaPortal-1 change to:
C#:
// We have some data; lets read it
if (set1.ColumnNames.Count == 0)
{
pN = sqlite3_column_count(pVm);
if (pVm == IntPtr.Zero)
{
ThrowError("sqlite3_column_count:pvm=null", query, res);
}
for (int i = 0; i < pN; i++)
{
string colName;
IntPtr pName = sqlite3_column_name16(pVm, i);
if (pName == IntPtr.Zero)
{
ThrowError(String.Format("SqlClient:sqlite3_column_name16() returned null {0}/{1}", i, pN), query, res);
}
colName = Marshal.PtrToStringUni(pName);
set1.columnNames.Add(colName);
set1.ColumnIndices[colName] = i;
}
}