473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Trouble with DataViews in VC++

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[i];
dr=Drv->Row;*/
for(j=0;j<dt->Columns->Count;j++){
//cout<<Drv->Item[j]<<",";
//cout<<dr->get_Item(j)->ToString()<<",";
//cout<<Training->Item[i]->Row->Item[j]->ToString()<<",";

//cout<<Training->get_Item(i)->get_Item(j)<<",";
}
}
Nov 16 '05 #1
1 1298
hi yall,

no1 responded to my desparate plea for help, forcing me to find the
solution myself!! apparently, all i had to do was use Console::write
instead of cout!! my badd.

who knew..

Vix
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: softengine | last post by:
Can and how do you alter a data view to include a look up field from another data table? The data table of the dataview only has the key, the value I need is in another data table. Can and how...
2
by: Pablo | last post by:
Hi people, Necesito crear n dataviews en tiempo de ejecucion. I need to create "n" DataViews in runtime. I tried creating an array this way: Dim LDView As Array =...
1
by: KR.KIM | last post by:
Hi! When I compile my code and try to debugging, i met one trouble in watch window. i can't see some buffer values, it looks filled by 0x00(null) in watch window. but,buffer was filled by real...
16
by: scorpion53061 | last post by:
Well as some of you know I was using a tab control for a project I was building for my boss. Today he tells me that he wants: When he switches tabs to be able to switch back and see whatever...
4
by: Bo Diddly | last post by:
This is what I've done so far: I have a DataBase with: tblBook BookID... key Book... All the book titles of the Bible tblChapter ChapterID... key Chapter... chapter numbers (1 - 150)
1
by: Brian Henry | last post by:
I have a strange problem... I have a junction table that i need to filter based on a id, then take the filtered data and join it to a description table then show the data that was filtered in a...
3
by: Jerry | last post by:
Hi, I have a couple of datagrids that are based on dataviews. If I filter dataview1 I would like to automatically filter dataview2. I posted something about this before but I think I didn't...
4
by: Bernie Hunt | last post by:
I currently have a datagrid that I'm feeding with a DataSet, which contains three tables. I would like to use a DataView to format the DataTables but I'm not sure how to go about this. Currently...
5
by: bg_ie | last post by:
Hi all, I'm trying to use the following kit - http://ccrma.stanford.edu/software/stk/ but I'm having trouble building the code. I've tried isolating the problem by deleting code and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.