V
Vee Kay
hi,
this is my first post here. i'm in desparate need of resources for
VC++.NET; the code in MSDN is only directed for VB/C#.. for C++ its
very few and faar in between!! the web is no good either!! :'(
now that my rant is over, here is my question:
i have applied 2 dataviews on a datatable. now i want to iterate thru
this dataview to see the underlying values. the views are being
applied correctly(i cross checked the number from access). the problem
is, instead of showing me the data, all i see are: 1,1,1,1,1,1!!
please tell me where i'm goin wrong.
Thanx,
Vix
``````````````````````````````````````````````
DataTable *dt=new DataTable();
DataSet *ds;
DataView *Training;
DataView *Testing;
DataRowView *Drv;
DataRow *dr;
OleDbConnection* myConn = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Documents and Settings\\Administrator\\My
Documents\\DATA\\ABC.MDB");
OleDbDataAdapter *da=new OleDbDataAdapter(" SELECT * FROM tbl1
",myConn);
ds = new DataSet("Table1");
da->Fill(ds);
dt = ds->Tables->get_Item(0);
Training =new DataView(dt);
Testing=new DataView(dt);
Testing->RowFilter = " Sex = 'M'";
Training->RowFilter = "Sex = 'F'";
cout <<" Training Count " << Training->Count <<endl;
cout <<" Testing Count " << Testing->Count <<endl;
for (int i=0;i < Training->Count ; i++){
/*Drv=Training->Item;
dr=Drv->Row;*/
for(j=0;j<dt->Columns->Count;j++){
//cout<<Drv->Item[j]<<",";
//cout<<dr->get_Item(j)->ToString()<<",";
//cout<<Training->Item->Row->Item[j]->ToString()<<",";
//cout<<Training->get_Item(i)->get_Item(j)<<",";
}
}
this is my first post here. i'm in desparate need of resources for
VC++.NET; the code in MSDN is only directed for VB/C#.. for C++ its
very few and faar in between!! the web is no good either!! :'(
now that my rant is over, here is my question:
i have applied 2 dataviews on a datatable. now i want to iterate thru
this dataview to see the underlying values. the views are being
applied correctly(i cross checked the number from access). the problem
is, instead of showing me the data, all i see are: 1,1,1,1,1,1!!
please tell me where i'm goin wrong.
Thanx,
Vix
``````````````````````````````````````````````
DataTable *dt=new DataTable();
DataSet *ds;
DataView *Training;
DataView *Testing;
DataRowView *Drv;
DataRow *dr;
OleDbConnection* myConn = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Documents and Settings\\Administrator\\My
Documents\\DATA\\ABC.MDB");
OleDbDataAdapter *da=new OleDbDataAdapter(" SELECT * FROM tbl1
",myConn);
ds = new DataSet("Table1");
da->Fill(ds);
dt = ds->Tables->get_Item(0);
Training =new DataView(dt);
Testing=new DataView(dt);
Testing->RowFilter = " Sex = 'M'";
Training->RowFilter = "Sex = 'F'";
cout <<" Training Count " << Training->Count <<endl;
cout <<" Testing Count " << Testing->Count <<endl;
for (int i=0;i < Training->Count ; i++){
/*Drv=Training->Item;
dr=Drv->Row;*/
for(j=0;j<dt->Columns->Count;j++){
//cout<<Drv->Item[j]<<",";
//cout<<dr->get_Item(j)->ToString()<<",";
//cout<<Training->Item->Row->Item[j]->ToString()<<",";
//cout<<Training->get_Item(i)->get_Item(j)<<",";
}
}