DataAccessBlock, DataView and conflict SQLReader

G

Guest

I am seeing how the DataView ( dVue1) control works with this code - but
something must be wrong since I am getting no rows.

dVue1.DataSource = SqlHelper.ExecuteReader(strDefConnTxt, CommandType.Text,
strSql);
dVue1.Refresh();
int rc =dVue1.DisplayedRowCount(false);


Then I added this line :
SqlDataReader myReader;
& it would no longer compile -
What should I do ?

Error 1 The type 'System.Data.SqlClient.SqlDataReader' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll' and
'c:\Program Files\Microsoft Visual Studio
8\Common7\IDE\PublicAssemblies\System.Data.SqlClient.dll' C:\Documents and
Settings\wattsa\My Documents\Visual Studio 2005\Projects\SQL Tables
Viewer\SQL Tables Viewer\TableViewer.cs 49 13 SQL Tables Viewer


Thanks !
 
N

Nicholas Paldino [.NET/C# MVP]

Andrew,

Are you referring to the DataGrid (the DataView helps provide client
side filtering of data tables), rather?

Also, is this an ASP.NET page? Only data grids in ASP.NET can use
DataReaders as data sources. If this is a windows forms grid, then you will
want to return a data set/data table and bind to that.

Hope this helps.
 
G

Guest

Thanks yes I was using WINFORMS and I can get a DATASET back with the MDAB.
But I thought the ocntrol I was using was a WINform control. Thanks for the
tip - I'll keep working at it until something is visible !
--
Andrew


Nicholas Paldino said:
Andrew,

Are you referring to the DataGrid (the DataView helps provide client
side filtering of data tables), rather?

Also, is this an ASP.NET page? Only data grids in ASP.NET can use
DataReaders as data sources. If this is a windows forms grid, then you will
want to return a data set/data table and bind to that.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

andrewcw said:
I am seeing how the DataView ( dVue1) control works with this code - but
something must be wrong since I am getting no rows.

dVue1.DataSource = SqlHelper.ExecuteReader(strDefConnTxt,
CommandType.Text,
strSql);
dVue1.Refresh();
int rc =dVue1.DisplayedRowCount(false);


Then I added this line :
SqlDataReader myReader;
& it would no longer compile -
What should I do ?

Error 1 The type 'System.Data.SqlClient.SqlDataReader' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll' and
'c:\Program Files\Microsoft Visual Studio
8\Common7\IDE\PublicAssemblies\System.Data.SqlClient.dll' C:\Documents and
Settings\wattsa\My Documents\Visual Studio 2005\Projects\SQL Tables
Viewer\SQL Tables Viewer\TableViewer.cs 49 13 SQL Tables Viewer


Thanks !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top