DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 14 Aug 2007 14:47:40 -0500,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    TJ am
          2    TJ am


ExecuteXmlReader not available in .net 1.1 Enterprise Library Data Access Block ??   
I'm trying to upgrade old code in .NET 1.0 to use the data access 
application block (June 2005 version).
I'm trying to do this:

SqlCommand custCMD = new SqlCommand(sql, conn);
conn.Open();
XmlTextReader rdr = (XmlTextReader)custCMD.ExecuteXmlReader();

But guess what, there is no ExecuteXmlReader in data access app block, at 
least the way I use it, I try this:

Database db = DatabaseFactory.CreateDatabase("myDatabaseName");
DBCommandWrapper dbc = db.GetSqlStringCommandWrapper(mySql);
XmlTextReader rdr = (XmlTextReader)db.ExecuteXmlReader(dbc);  <----- THIS 
DOESNT EXIST

There is no ExecuteXmlReader off the db object, so what I've written above 
won't work.

How do I implement the ExecuteXmlReader using the data access app block in 
1.0?
Date:Tue, 14 Aug 2007 14:47:40 -0500   Author:  

Re: ExecuteXmlReader not available in .net 1.1 Enterprise Library Data Access Block ??   
Got it.

SqlDatabase db = (SqlDatabase)DatabaseFactory.CreateDatabase();
SqlCommandWrapper cmd = 
(SqlCommandWrapper)db.GetStoredProcCommandWrapper(myProc);
XmlReader xmlRdr = db.ExecuteXmlReader(cmd);

Duh...because the ExecuteXmlReader was originally off the SqlCommand,
I just had to cast the Database object to a SqlDatabase object.

Here's a great article that pointed out the obvious to me:
http://msdn.microsoft.com/msdnmag/issues/05/08/DataPoints/



"TJ" <teejay@newsgroups.nospam> wrote in message 
news:OiTUevq3HHA.1188@TK2MSFTNGP04.phx.gbl...

> I'm trying to upgrade old code in .NET 1.0 to use the data access 
> application block (June 2005 version).
> I'm trying to do this:
>
> SqlCommand custCMD = new SqlCommand(sql, conn);
> conn.Open();
> XmlTextReader rdr = (XmlTextReader)custCMD.ExecuteXmlReader();
>
> But guess what, there is no ExecuteXmlReader in data access app block, at 
> least the way I use it, I try this:
>
> Database db = DatabaseFactory.CreateDatabase("myDatabaseName");
> DBCommandWrapper dbc = db.GetSqlStringCommandWrapper(mySql);
> XmlTextReader rdr = (XmlTextReader)db.ExecuteXmlReader(dbc);  <----- THIS 
> DOESNT EXIST
>
> There is no ExecuteXmlReader off the db object, so what I've written above 
> won't work.
>
> How do I implement the ExecuteXmlReader using the data access app block in 
> 1.0?
> 
Date:Wed, 15 Aug 2007 08:29:30 -0500   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us