473,785 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Type 'ConnectionStri ngData' is not defined.

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.Pract ices.Enterprise Library.Data.dl l 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 authConnectStri ng As ConnectionStrin gData
Error: Type 'ConnectionStri ngData' is not defined.

authConnectStri ng =
dbSettings.Conn ectionStrings.I tem(String.Conc at(Common.Const ants.AuthDbInst anceName, "_CS"))
Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Prac tices.Enterpris eLibrary.Data.C onfiguration.Da tabaseSettings' .

authInstance = New InstanceData(Co mmon.Constants. AuthDbInstanceN ame)
Error: Argument not specified for parameter 'sample' of 'Public Sub
New(instanceNam e As String, sample As System.Diagnost ics.CounterSamp le)'.

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.
Jun 27 '08 #1
8 1711
dmbuso-

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

http://msdn.microsoft.com/en-us/libr...11(VS.80).aspx

-Cor

"dmbuso" <dm*****@commun ity.nospamschre ef in bericht
news:E9******** *************** ***********@mic rosoft.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.Pract ices.Enterprise Library.Data.dl l 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 authConnectStri ng As ConnectionStrin gData
Error: Type 'ConnectionStri ngData' is not defined.

authConnectStri ng =
dbSettings.Conn ectionStrings.I tem(String.Conc at(Common.Const ants.AuthDbInst anceName,
"_CS"))
Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Prac tices.Enterpris eLibrary.Data.C onfiguration.Da tabaseSettings' .

authInstance = New InstanceData(Co mmon.Constants. AuthDbInstanceN ame)
Error: Argument not specified for parameter 'sample' of 'Public Sub
New(instanceNam e As String, sample As System.Diagnost ics.CounterSamp le)'.

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.
Jun 28 '08 #2
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 'connectionStri ngs' node contained in the
app.config.

Here's what it looks like in XML Notepad:

<connectionStri ngs>
<add name="LocalAuth _CS" connectionStrin g="Server=.;Int egrated
Security=True" providerName="S ystem.Data.SqlC lient"/>
<add name="RAID_CS" connectionStrin g="Database=RAI D;Server=.;Inte grated
Security=False; User ID=RaidApp;Pass word="";Connect Timeout=30"
providerName="S ystem.Data.SqlC lient"/>
<add name="RAIDAuth_ CS" connectionStrin g="Database=RAI D;Server=.;Inte grated
Security=True" providerName="S ystem.Data.SqlC lient"/>
</connectionStrin gs>

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
GetConfiguratio n is not a member of Sytem.Configura tion.Configurat ionManager.
I think this is where I need to read the connection strings.

Private Shared Function ReadDBSettings( ) As DatabaseSetting s
Return
CType(Configura tionManager.Get Configuration(" dataConfigurati on"),
DatabaseSetting s)
End Function
Here is my email: Da************* **@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/libr...11(VS.80).aspx

-Cor

"dmbuso" <dm*****@commun ity.nospamschre ef in bericht
news:E9******** *************** ***********@mic rosoft.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.Pract ices.Enterprise Library.Data.dl l 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 authConnectStri ng As ConnectionStrin gData
Error: Type 'ConnectionStri ngData' is not defined.

authConnectStri ng =
dbSettings.Conn ectionStrings.I tem(String.Conc at(Common.Const ants.AuthDbInst anceName,
"_CS"))
Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Prac tices.Enterpris eLibrary.Data.C onfiguration.Da tabaseSettings' .

authInstance = New InstanceData(Co mmon.Constants. AuthDbInstanceN ame)
Error: Argument not specified for parameter 'sample' of 'Public Sub
New(instanceNam e As String, sample As System.Diagnost ics.CounterSamp le)'.

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.

Jun 30 '08 #3
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:

=============== ====
>authConnectStr ing =
dbSettings.Con nectionStrings. Item(String.Con cat(Common.Cons tants.AuthDbIns t
anceName, "_CS"))
>Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Pra ctices.Enterpri seLibrary.Data. Configuration.D atabaseSettings '
Jul 1 '08 #4
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:

=============== ====
authConnectStri ng =
dbSettings.Conn ectionStrings.I tem(String.Conc at(Common.Const ants.AuthDbInst
anceName, "_CS"))
Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Prac tices.Enterpris eLibrary.Data.C onfiguration.Da tabaseSettings'
Jul 1 '08 #5
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****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?ZG1idXNv?= <dm*****@commun ity.nospam>
References: <E9************ *************** *******@microso ft.com>
<nF************ **@TK2MSFTNGHUB 02.phx.gbl>
>Subject: RE: Type 'ConnectionStri ngData' is not defined.
Date: Tue, 1 Jul 2008 05:09:03 -0700
>
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
configuratio n management architecture, it is possible that many such
configuratio n related code will get broken.

As for the code snippet you provided:

============== =====
>authConnectStr ing =
dbSettings.Con nectionStrings. Item(String.Con cat(Common.Cons tants.AuthDbIns t
>anceName, "_CS"))
>Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Pra ctices.Enterpri seLibrary.Data. Configuration.D atabaseSettings '
>>
Jul 2 '08 #6
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:

authConnectStri ng =
dbSettings.Conn ectionStrings.I tem(String.Conc at(Common.Const ants.AuthDbInst anceName, "_CS"))

Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Prac tices.Enterpris eLibrary.Data.C onfiguration.Da tabaseSettings' .

--
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****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?ZG1idXNv?= <dm*****@commun ity.nospam>
References: <E9************ *************** *******@microso ft.com>
<nF************ **@TK2MSFTNGHUB 02.phx.gbl>
Subject: RE: Type 'ConnectionStri ngData' is not defined.
Date: Tue, 1 Jul 2008 05:09:03 -0700

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:

=============== ====
authConnectStri ng =
dbSettings.Conn ectionStrings.I tem(String.Conc at(Common.Const ants.AuthDbInst
anceName, "_CS"))
Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Prac tices.Enterpris eLibrary.Data.C onfiguration.Da tabaseSettings'
>

Jul 2 '08 #7
Thanks for your reply Dave,

Oh, my omit. I just found that my first reply got truncated due to some
tool issue. I'll compose a new one and post here soon. Really sorry for the
misleading and inconvenience.

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****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?ZG1idXNv?= <dm*****@commun ity.nospam>
References: <E9************ *************** *******@microso ft.com>
<nF************ **@TK2MSFTNGHUB 02.phx.gbl>
<4C************ *************** *******@microso ft.com>
<iE************ **@TK2MSFTNGHUB 02.phx.gbl>
>Subject: RE: Type 'ConnectionStri ngData' 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:

authConnectStr ing =
dbSettings.Conn ectionStrings.I tem(String.Conc at(Common.Const ants.AuthDbInst a
nceName, "_CS"))
>
Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Pra ctices.Enterpri seLibrary.Data. Configuration.D atabaseSettings '
Jul 3 '08 #8
Hi Dave,

In my first reply, I mentioned some suggestion about the two problems you
said in your initial messsage.

1. About the ConnectionStrin gData. 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.GetSqlString Command(sqlComm and)

............... ..........

=============== ==========

it use a DatabaseFactory to direclty get a DataBase object(the default one
or you can supply a name).

And for the ConfigurationMa nager class, it doesn't have a
"GetConfigurati on" method, only a "GetSection " method is available. You can
refer to the available member list of ConfigurationMa nager class:

#ConfigurationM anager Members
http://msdn.microsoft.com/en-us/libr...onfigurationma
nager_members.a spx

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****@microsof t.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 'ConnectionStri ngData' 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:

authConnectStr ing =
dbSettings.Conn ectionStrings.I tem(String.Conc at(Common.Const ants.AuthDbInst a
nceName, "_CS"))
>
Error: 'ConnectionStri ngs' is not a member of
'Microsoft.Pra ctices.Enterpri seLibrary.Data. Configuration.D atabaseSettings '
..
>
--
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****@microsof t.com.
Jul 3 '08 #9

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

Similar topics

15
2328
by: Terje Slettebø | last post by:
Hi. I'm new here, and sorry if this has been discussed before; I didn't find it searching the PHP groups. (I've also read recommendations to cross-post to the other PHP groups, but if that is discouraged, please let me know. At the same time, please then let me know which of the many PHP groups to post to. :) ) In PHP5, you can provide "type hints" for functions, like this:
4
2943
by: Jari Kujansuu | last post by:
I can successfully parse XML document using SAX or DOM and I can also validate XML document against schema. Problem is that my program should deal with user-defined schemas which means that when I parse some element from XML document I don't know until runtime the type of the element (it depends on the type used in user-defined schema). XML parser obviously validates that the value of the element is correct type but still I receive that...
4
3482
by: Jacob Jensen | last post by:
This question has probably been asked a million time, but here it comes again. I want to learn the difference between the three type cast operators: static_cast, reinterpret_cast, dynamic_cast. A good way to do this is by example. So I will give an example and please tell me what you think: I have a base class A with a virtual destructor, and a class B that is it inherits publicly from A and defines som extra stuff.
21
2518
by: Nitin Bhardwaj | last post by:
Hi all, It is said that C++ is a strongly typed language and thus a type-safe language (unlike C). So how does one explain the following behaviour : int main(void) { char *p = NULL; p = "A String Literal";//the compiler isuues no error/warning here // but ideally it should...as p is a non-const
8
2247
by: Rade | last post by:
Following a discussion on another thread here... I have tried to understand what is actually standardized in C++ regarding the representing of integers (signed and unsigned) and their conversions. The reference should be 3.9.1 (Fundamental types), and 4.7 (Integral conversions). It seems to me that the Standard doesn't specify: 1) The "value representation" of any of these types, except that (3.9.1/3) "... The range of nonnegative...
13
10448
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I change the parameter data types to the actual data type such as varchar(10), etc., the stored procedure takes less that a second to return records. The user defined types are mostly varchar, but some others such as int. They are all input type...
14
7444
by: Matt | last post by:
I want to know if "int" is a primitive type, or an object? For example, the following two approaches yield the same result. > int t1 = int.Parse(TextBox2.Text); //method 1 > int t2 = System.Int32.Parse(TextBox2.Text); //method 2 And people said "int" is a C# alias for "System.Int32". If this is the case, can we say "int" is an object??
7
1959
by: Michael | last post by:
Hi, I could understand the difference between class and object. However, I could find out a good definiton of type. how to understand the relaitonship between type, class, and object? Thanks! Michael
70
3380
by: garyusenet | last post by:
I'm using an example piece of code: - namespace Wintellect.Interop.Sound{ using System; using System.Runtime.InteropServices; using System.ComponentModel; sealed class Sound{ public static void MessageBeep(BeepTypes type){ if(!MessageBeep((UInt32) type)){ Int32 err = Marshal.GetLastWin32Error();
0
9643
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
9480
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
10315
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
10147
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
9947
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
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.