Hi Dave,
In my first reply, I mentioned some suggestion about the two problems you
said in your initial messsage.
1. About the ConnectionStringData. It is apparently that, from .net
framework 2.0, this class type will not be used (also for the new
enterprise library). And since .net framework 2.0 application's app.config
file has built-in connection string support, the entlib will also utlize
it. The typical code that establish database connection and perform command
operation is like below:
=========================
Public Function UpdateProducts() As Integer
' Create the Database object, using the default database service.
The
' default database service is determined through configuration.
Dim db As Database = DatabaseFactory.CreateDatabase()
Dim productsDataSet As DataSet = New DataSet
Dim sqlCommand As String = "Select ProductID, ProductName,
CategoryID, UnitPrice, LastUpdate " & _
"From Products"
Dim dbCommand As DbCommand = db.GetSqlStringCommand(sqlCommand)
.........................
=========================
it use a DatabaseFactory to direclty get a DataBase object(the default one
or you can supply a name).
And for the ConfigurationManager class, it doesn't have a
"GetConfiguration" method, only a "GetSection" method is available. You can
refer to the available member list of ConfigurationManager class:
#ConfigurationManager Members
http://msdn.microsoft.com/en-us/libr...onfigurationma
nager_members.aspx
Also, I think you can refer to some of the samples in the enterprise
library 4.0(such as the data access ones) and convert those old style
code(in entlib 1.1) to the new style ones.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Subject: RE: Type 'ConnectionStringData' is not defined.
Date: Wed, 2 Jul 2008 05:06:01 -0700
>Steven,
No I haven't tried your supposed code change because your response is the
same as what I had. Could you please repost it?
Here is the line of code and the error it yields:
authConnectString =
dbSettings.ConnectionStrings.Item(String.Concat(Co mmon.Constants.AuthDbInsta
nceName, "_CS"))
>
Error: 'ConnectionStrings' is not a member of
'Microsoft.Practices.EnterpriseLibrary.Data.Confi guration.DatabaseSettings'
..
>
--
Dave B.
"Steven Cheng [MSFT]" wrote:
>Thanks for your reply Dave,
Yes, .NET 2.0 and .NET 3.5 doesn't have much difference, however, since
your original code is coupled with .NET framework 1.1, the framework and
enterprise library for that framework has changed much. Therefore, I
suggeset you check any of those classes which is no longer used in the
new
>framework or new enterprise library and replace them with the new syntax
or
>code style. Have you tried changing the database accessing code as I
mentioned in previous message to see whether the error disappears?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
>suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.