473,796 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataAccessBlock , DataView and conflict SQLReader

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

dVue1.DataSourc e = SqlHelper.Execu teReader(strDef ConnTxt, CommandType.Tex t,
strSql);
dVue1.Refresh() ;
int rc =dVue1.Displaye dRowCount(false );
Then I added this line :
SqlDataReader myReader;
& it would no longer compile -
What should I do ?

Error 1 The type 'System.Data.Sq lClient.SqlData Reader' exists in both
'c:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\System.Data.d ll' and
'c:\Program Files\Microsoft Visual Studio
8\Common7\IDE\P ublicAssemblies \System.Data.Sq lClient.dll' C:\Documents and
Settings\wattsa \My Documents\Visua l Studio 2005\Projects\S QL Tables
Viewer\SQL Tables Viewer\TableVie wer.cs 49 13 SQL Tables Viewer
Thanks !
--
Andrew
Nov 17 '05 #1
2 1836
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]
- mv*@spam.guard. caspershouse.co m

"andrewcw" <an******@acw.c om> wrote in message
news:3B******** *************** ***********@mic rosoft.com...
I am seeing how the DataView ( dVue1) control works with this code - but
something must be wrong since I am getting no rows.

dVue1.DataSourc e = SqlHelper.Execu teReader(strDef ConnTxt,
CommandType.Tex t,
strSql);
dVue1.Refresh() ;
int rc =dVue1.Displaye dRowCount(false );
Then I added this line :
SqlDataReader myReader;
& it would no longer compile -
What should I do ?

Error 1 The type 'System.Data.Sq lClient.SqlData Reader' exists in both
'c:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\System.Data.d ll' and
'c:\Program Files\Microsoft Visual Studio
8\Common7\IDE\P ublicAssemblies \System.Data.Sq lClient.dll' C:\Documents and
Settings\wattsa \My Documents\Visua l Studio 2005\Projects\S QL Tables
Viewer\SQL Tables Viewer\TableVie wer.cs 49 13 SQL Tables Viewer
Thanks !
--
Andrew

Nov 17 '05 #2
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 [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard. caspershouse.co m

"andrewcw" <an******@acw.c om> wrote in message
news:3B******** *************** ***********@mic rosoft.com...
I am seeing how the DataView ( dVue1) control works with this code - but
something must be wrong since I am getting no rows.

dVue1.DataSourc e = SqlHelper.Execu teReader(strDef ConnTxt,
CommandType.Tex t,
strSql);
dVue1.Refresh() ;
int rc =dVue1.Displaye dRowCount(false );
Then I added this line :
SqlDataReader myReader;
& it would no longer compile -
What should I do ?

Error 1 The type 'System.Data.Sq lClient.SqlData Reader' exists in both
'c:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\System.Data.d ll' and
'c:\Program Files\Microsoft Visual Studio
8\Common7\IDE\P ublicAssemblies \System.Data.Sq lClient.dll' C:\Documents and
Settings\wattsa \My Documents\Visua l Studio 2005\Projects\S QL Tables
Viewer\SQL Tables Viewer\TableVie wer.cs 49 13 SQL Tables Viewer
Thanks !
--
Andrew


Nov 17 '05 #3

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

Similar topics

0
1588
by: RPI_alum | last post by:
I've been experiencing some frustrating behavior that I believe may be a MS bug in the Framework. Has anyone else experienced this, know a better way to resolve it, or if it is an actual MS bug *) I have a DataSet containing 2 tables, A and B *) There is a 1-to-1 relation between the tables with table A being the parent. (ABrel *) A DataView is created on table A to allow filtering of the result se *) 2 Text Boxes are created and Bound...
2
3312
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit the selected lie item at which case I would pop up a separate dialog box to do so, in the debugging code, the dataview.count would return 0. I get a error message because I tried to get values out of a dataview that holds 0 items. Does anyone...
0
1542
by: Chris Morse | last post by:
Hi, Following is a function I wrote to export the rows of an arbitrary table. It's not complete yet, in that it currently does not output to a file (it uses Debug.WriteLine() at the moment) and it currently assumes MS-SQL Server database types (int, bit, varchar, etc) and only handles a few of the datatypes. It works, but it's rather slow. The problem being that every field of every row must be checked for the datatype, so that the...
5
8834
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it happen. Dim objKeys(2) as Object objKeys(0) = "CL" objKeys(2) = 4000 Dim posView As DataView = New DataView(posDS.Tables("Positions"), _
3
1201
by: Agnes | last post by:
drBranchForm = sqldatareader For Each drBranch In dtUserBranch Do While drBranchForm.Read .......... Problem (A) Loop Next I found that the datarreader only loop onces , ?? How can I make it restart the sqldatareader ??? Thanks
5
2562
by: c676228 | last post by:
Hi all, I am stuck with this problem. the code is like this: Dim sqlreader As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection) sqlreader.GetValue(sqlreader.GetOrdinal(columnname) give me the following in the watch window: sqlreader.GetValue(sqlreader.GetOrdinal("enrolldate")) Run-time exception
3
3010
by: Saurabh Prabhu | last post by:
Hi there, I am using a SQL reader to read data from a table. Here is how I use it. SqlDataReader lobj_Table = SqlHelper.ExecuteReader(ConnectionObject,CommandType.Text,lstr_SQL); Now I need to confirm a few points here. If I am reading the data from a single table then the sqlreader works fine. But one of my collegues mentioned that sql reader does not always work if my sql query consists of one or more joins. Is it true? It is...
14
6908
lotus18
by: lotus18 | last post by:
Hello all I have these records on my Day Table for my complete database table please click here 1. M 2. T 3. W 4. TH 5. F 6. S
0
2151
by: Pravin Pujari | last post by:
Hi All, I am using .net framework 1.1 and c#. I have one problem regarding dataview. I have one dataview to which sorting may be applied or may not be applied. I have one UI component where I am displaying the dataview. All rows in dataview are displayed in the sequence as they appear in dataview. i.e. there is direct mapping between dataview rows and UI rows. I have subscribed ColumnChanged event of the datatable on which dataview is...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10461
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10019
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.