473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to build sqlConnection class in VB.NET for window applications

Hi All

I have tested this property. But it doesn't work
This property reads from configuration file app.config

Public Class DbAccess
Shared ReadOnly Property ConnString() As String
Get
Dim strConnection As String
strConnection =
System.Configuration.ConfigurationSettings.AppSett ings.GetValues("SQLConnString")
Return strConnection
End Get
End Property
End Class

Some boby can figure out what wrong it is?
Thanks in advance

- Loi -
Nov 20 '05 #1
1 1885
Try
System.Configuration.ConfigurationSettings.AppSett ings("SQLConnString")

HTH,
Greg

"Loi Tan Vo" <lo********@fnh.no> wrote in message
news:73**************************@posting.google.c om...
Hi All

I have tested this property. But it doesn't work
This property reads from configuration file app.config

Public Class DbAccess
Shared ReadOnly Property ConnString() As String
Get
Dim strConnection As String
strConnection =
System.Configuration.ConfigurationSettings.AppSett ings.GetValues("SQLConnStr
ing") Return strConnection
End Get
End Property
End Class

Some boby can figure out what wrong it is?
Thanks in advance

- Loi -

Nov 20 '05 #2

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

Similar topics

10
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
4
by: fake | last post by:
What exactly does the line: rGfxOptionsWnd* m_pGfxOptionsWnd; do? I have chased this bug and narrowed it down to something that I believe should not happen and I don't even know what could...
0
by: Stephen Cairns | last post by:
I have the following rpx file in a .Net solution and I am getting the following build errors which are driving me crazy and ive no idea where I have went wrong. The build errors I'm getting are as...
16
by: ed_p | last post by:
Hello, I have implemented the singleton pattern for a class to hold a SqlConnection object that will be used thruout the application to create commands. My application is a simple Windows Form...
11
by: Bob | last post by:
In our new .NET web applications, we try to limit the use of SqlConnection to just one instance per page, even if there are multiple accesses to various queries. The thinking behind is that this...
4
by: Agnes | last post by:
I create two project A, & B . A included several baseforms like search, print,etc For project B , some form will inherits the forms in prjA . In project B, I try to add the referece of prjA and I...
9
by: Roman | last post by:
Hello I have a component built in VB.2003. It has the following property: Public Shared mCONN As SqlConnection Public Property Connection() As SqlConnection Get Return mCONN End Get...
2
by: Peter Afonin | last post by:
Hello, I have a weird problem with one ASP.NET application that I develop using Visual Studio.Net 2003 (VB.Net). When I build an application, I get message "Build failed". When I start an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.