From: dmbuso on
I'm migrating a VB.NET 2003 application to VB.NET 2008. The 2003 app used the
June 2005 Enterprise Library while I'm going to use the latest EntLib, 4.0 -
May 2008.

I copied the 2003 app to a new 2008 folder structure, recreated the
app.config using the new 4.0 EntLib config tool, and referenced the 4.0
Microsoft.Practices.EnterpriseLibrary.Data.dll file.

The problem is there is a Function that has errors in it and I'm not sure
how to fix these.

Here are the lines of code and their respective errors:

Dim authConnectString As ConnectionStringData
Error: Type 'ConnectionStringData' is not defined.

authConnectString =
dbSettings.ConnectionStrings.Item(String.Concat(Common.Constants.AuthDbInstanceName, "_CS"))
Error: 'ConnectionStrings' is not a member of
'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings'.

authInstance = New InstanceData(Common.Constants.AuthDbInstanceName)
Error: Argument not specified for parameter 'sample' of 'Public Sub
New(instanceName As String, sample As System.Diagnostics.CounterSample)'.

There are a few more. Please contact me and I'll send you the Function so
you can take a look at it.

--
Thanks,
Dave B.
From: Cor Ligthert[MVP] on
dmbuso-

Have a look at this one, which is a special VB method

http://msdn.microsoft.com/en-us/library/ms379611(VS.80).aspx

-Cor

"dmbuso" <dmbuso1(a)community.nospam> schreef in bericht
news:E9CB37DC-6747-4928-B26B-56C52A5D1156(a)microsoft.com...
> I'm migrating a VB.NET 2003 application to VB.NET 2008. The 2003 app used
> the
> June 2005 Enterprise Library while I'm going to use the latest EntLib,
> 4.0 -
> May 2008.
>
> I copied the 2003 app to a new 2008 folder structure, recreated the
> app.config using the new 4.0 EntLib config tool, and referenced the 4.0
> Microsoft.Practices.EnterpriseLibrary.Data.dll file.
>
> The problem is there is a Function that has errors in it and I'm not sure
> how to fix these.
>
> Here are the lines of code and their respective errors:
>
> Dim authConnectString As ConnectionStringData
> Error: Type 'ConnectionStringData' is not defined.
>
> authConnectString =
> dbSettings.ConnectionStrings.Item(String.Concat(Common.Constants.AuthDbInstanceName,
> "_CS"))
> Error: 'ConnectionStrings' is not a member of
> 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings'.
>
> authInstance = New InstanceData(Common.Constants.AuthDbInstanceName)
> Error: Argument not specified for parameter 'sample' of 'Public Sub
> New(instanceName As String, sample As System.Diagnostics.CounterSample)'.
>
> There are a few more. Please contact me and I'll send you the Function so
> you can take a look at it.
>
> --
> Thanks,
> Dave B.

From: dmbuso on
Cor,

Thanks for the article. I read it, but I don't think this is really the
route I should go. I viewed the app.config with XML Notepad and I think what
I need to do is to read the 'connectionStrings' node contained in the
app.config.

Here's what it looks like in XML Notepad:

<connectionStrings>
<add name="LocalAuth_CS" connectionString="Server=.;Integrated
Security=True" providerName="System.Data.SqlClient"/>
<add name="RAID_CS" connectionString="Database=RAID;Server=.;Integrated
Security=False;User ID=RaidApp;Password="";Connect Timeout=30"
providerName="System.Data.SqlClient"/>
<add name="RAIDAuth_CS" connectionString="Database=RAID;Server=.;Integrated
Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

Also and as a side note, I created the app.config with the EntLib 4.0 config
tool.

This function is giving me an error also. It is telling me that that
GetConfiguration is not a member of Sytem.Configuration.ConfigurationManager.
I think this is where I need to read the connection strings.

Private Shared Function ReadDBSettings() As DatabaseSettings
Return
CType(ConfigurationManager.GetConfiguration("dataConfiguration"),
DatabaseSettings)
End Function


Here is my email: David.M.Busovicki(a)usdoj.gov
and Work Phone: (814) 532-4925
--
Dave B.


"Cor Ligthert[MVP]" wrote:

> dmbuso-
>
> Have a look at this one, which is a special VB method
>
> http://msdn.microsoft.com/en-us/library/ms379611(VS.80).aspx
>
> -Cor
>
> "dmbuso" <dmbuso1(a)community.nospam> schreef in bericht
> news:E9CB37DC-6747-4928-B26B-56C52A5D1156(a)microsoft.com...
> > I'm migrating a VB.NET 2003 application to VB.NET 2008. The 2003 app used
> > the
> > June 2005 Enterprise Library while I'm going to use the latest EntLib,
> > 4.0 -
> > May 2008.
> >
> > I copied the 2003 app to a new 2008 folder structure, recreated the
> > app.config using the new 4.0 EntLib config tool, and referenced the 4.0
> > Microsoft.Practices.EnterpriseLibrary.Data.dll file.
> >
> > The problem is there is a Function that has errors in it and I'm not sure
> > how to fix these.
> >
> > Here are the lines of code and their respective errors:
> >
> > Dim authConnectString As ConnectionStringData
> > Error: Type 'ConnectionStringData' is not defined.
> >
> > authConnectString =
> > dbSettings.ConnectionStrings.Item(String.Concat(Common.Constants.AuthDbInstanceName,
> > "_CS"))
> > Error: 'ConnectionStrings' is not a member of
> > 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings'.
> >
> > authInstance = New InstanceData(Common.Constants.AuthDbInstanceName)
> > Error: Argument not specified for parameter 'sample' of 'Public Sub
> > New(instanceName As String, sample As System.Diagnostics.CounterSample)'.
> >
> > There are a few more. Please contact me and I'll send you the Function so
> > you can take a look at it.
> >
> > --
> > Thanks,
> > Dave B.
>
>
From: Steven Cheng [MSFT] on
Hi Dave,

Since the project is converted from VS 2003 to VS 2008 and it has changed
much from .NET framework 1.1 to 2.0(or 3.5), especially for the
configuration management architecture, it is possible that many such
configuration related code will get broken.

As for the code snippet you provided:

===================
>authConnectString =
>dbSettings.ConnectionStrings.Item(String.Concat(Common.Constants.AuthDbInst
anceName, "_CS"))
>Error: 'ConnectionStrings' is not a member of
>'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings'
From: dmbuso on
Huh?

PS - I'm using framework 3.5 also.
--
Dave B.


"Steven Cheng [MSFT]" wrote:

> Hi Dave,
>
> Since the project is converted from VS 2003 to VS 2008 and it has changed
> much from .NET framework 1.1 to 2.0(or 3.5), especially for the
> configuration management architecture, it is possible that many such
> configuration related code will get broken.
>
> As for the code snippet you provided:
>
> ===================
> >authConnectString =
> >dbSettings.ConnectionStrings.Item(String.Concat(Common.Constants.AuthDbInst
> anceName, "_CS"))
> >Error: 'ConnectionStrings' is not a member of
> >'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings'
>