在Visual Studio 2010 C++中将行写入数据集时出现问题
problems with writing rows to a DataSet in Visual Studio 2010 C++
我是Visual Studio 2010的新手,在MSDN上看到的C++示例很少,因此非常感谢您的帮助。
我使用ToolBox窗口中的DataSet函数创建了一个包含三列的表(为了简洁起见,我在下面的示例中省略了其中两列
我得到以下错误:
错误C3293:"Item":使用"default"访问类"System::Data::DataRow"的默认属性(索引器)
以下是VS2010实例化表生成的代码:
this->GraphInput->DataSetName = L"GraphDataIn";
this->GraphInput->Tables->AddRange(gcnew cli::array< System::Data::DataTable^ >(1) {this->RefElectInput});
//RefElectInput
this->RefElectInput->Columns->AddRange(gcnew cli::array< System::Data::DataColumn^ >(3) {this->RefElect0Av, this->RefElect0Max, this->RefElect0Min});
this->RefElectInput->MinimumCapacity = 7;
this->RefElectInput->TableName = L"RefElecInput";
//
// RefElect0Av
//
this->RefElect0Av->ColumnName = L"RefElect0Av";
this->RefElect0Av->DataType = System::Double::typeid;
以下是我尝试拖到行的代码(我只显示了一列):
DataRow^ myRow;
myRow = RefElectInput->NewRow();
myRow->Item[L"RefElect0Av"] = peUnPackDataRec->saeRefElec0.adfRefElecAv[i];
//the error data is of type doubleoccurs here.
//other column's removed.
RefElectInput->Rows->Add(myRow);
我将感谢你的帮助。
感谢Simon
您尝试过吗:
DataRow^ myRow;
myRow = RefElectInput->NewRow();
myRow->default[L"RefElect0Av"] = peUnPackDataRec->saeRefElec0.adfRefElecAv[i];
相关文章:
- 如何实现高效的算法来计算大型数据集的多个不同值?
- HDF5Cpp 扩展复合数据集超板问题
- C++:__aligned(__alignof__) 导致字符数组数据出现问题?
- HDF5 简单读取数据集失败
- std::bad_alloc 在大数据集的 Dijkstra 计算期间
- C++中的多维数据集:从 std::vector 的 2D 数据到 std::vector 的 2D 网格的最干净方法?
- C++创建空 HDF5 文件而不是数据集的代码
- 跨线程共享数据集与拆分每个线程的数据
- 多维数据集ai中的ai_float是什么
- 适用于频繁更改的大型数据集的最佳数据结构
- 面临在 if 语句之外打印变量数据的问题 完成使用 Qt 编程
- 面对迭代矢量<矢量<string>>和打印数据的问题
- C++中从客户端到服务器的数据传输问题
- 将数据集从 R 传递到C++(使用 .呼叫)
- 将数据集几乎平均分配给工作线程
- 如何解决在 clr 项目的特定文件中写入数据的问题?
- 我将 c++ 矢量数据集转换为 c 数组.我将相同的数据集传递到一个应该给出相同输出的函数中
- 翻译多维数据集时出现问题
- 在Visual Studio 2010 C++中将行写入数据集时出现问题
- 简单数据集(Opencv 2.4.9)的SVM训练问题