For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > March 2004 > Datasets, Datatables, Managed C++









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Datasets, Datatables, Managed C++
Murray Foxcroft

2004-03-28, 10:32 pm

Hey there, right - stuck again with a bit of data operations.

The following code does not build:

<CODE>

DataSet *datasetHDTConfig = new DataSet();

DataTable *datatableHDTConfig = new DataTable();


datasetHDTConfig = new DataSet();

datasetHDTConfig->ReadXml("C:\\temp\\config.xml");


datatableHDTConfig = datasetHDTConfig->Tables[0];

</CODE>



It returns :

error C2845: '[' : cannot perform pointer arithmetic on __gc pointer
'System::Data::DataTableCollection __gc *'

Any idea what I am doing wrong?



Thanks in advance





Murray Foxcroft

2004-03-28, 10:32 pm

Getting good at this asked and answered thing....

datarowHDTConfig = datasetHDTConfig->Tables->Item[0]->Rows->Item[0];

You have to add the Item pointer / reference in to each object.



"Murray Foxcroft" <murray.foxcroft@ast.co.za> wrote in message
news:utWqDYQEEHA.2088@TK2MSFTNGP10.phx.gbl...
> Hey there, right - stuck again with a bit of data operations.
>
> The following code does not build:
>
> <CODE>
>
> DataSet *datasetHDTConfig = new DataSet();
>
> DataTable *datatableHDTConfig = new DataTable();
>
>
> datasetHDTConfig = new DataSet();
>
> datasetHDTConfig->ReadXml("C:\\temp\\config.xml");
>
>
> datatableHDTConfig = datasetHDTConfig->Tables[0];
>
> </CODE>
>
>
>
> It returns :
>
> error C2845: '[' : cannot perform pointer arithmetic on __gc pointer
> 'System::Data::DataTableCollection __gc *'
>
> Any idea what I am doing wrong?
>
>
>
> Thanks in advance
>
>
>
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com