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

  • Thread starter Thread starter Loi Tan Vo
  • Start date Start date
L

Loi Tan Vo

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.AppSettings.GetValues("SQLConnString")
Return strConnection
End Get
End Property
End Class

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

- Loi -
 
Try
System.Configuration.ConfigurationSettings.AppSettings("SQLConnString")

HTH,
Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top