Richard Heyes wrote:
> > I've done a c++ wrapper around sqlite and have no problem with count(*),
> do you
> > check NULL values ?
>
> I check for null pointers in the argv values. Thing is the callback appears
> to run just as it should, the column name is returned as "count(*)", number
> of columns is 1, and the correct value is returned.
>
> My callback function is this:
>
> private unsafe int ExecuteCallback(IntPtr pArg,
> int argc,
> sbyte **argv,
> sbyte **columnNames)
> {
> string column;
> DataRow newRow = this.dt.NewRow();
> string[] data = new string[argc];
>
> //First time in, add the columns to the DataTable object
> if (dt.Columns.Count == 0) {
> for (int i=0; i<argc; ++i) {
> column = new String(columnNames[i]);
> dt.Columns.Add(column);
> }
> }
>
> for (int i=0; i<argc; ++i) {
> // Make an ArrayList of the row data
> if (argv[i] != ((sbyte *)0)) {
> data[i] = new String(argv[i]);
> } else {
> data[i] = null;
> }
> }
>
> // Add the array to the DataRow
> newRow.ItemArray = data;
> dt.Rows.Add(newRow);
> return 0;
> }
>
> Cheers.
> --
> Richard Heyes
I don't know what unsafe is, but shouldnt it be static (since no 'this' pointer
can be expected) ?
--
GISTEK software
Gis consultant.
[EMAIL PROTECTED]
www.gistek.net
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]