954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

web.config(asp.net) vs app.config(vb.net)

Hi, i juz wanted to know how to write this following codings in app.config.

In ASP.Net in web.config:

<configuration>
          <appSettings>
                <add key = "stu" value = "database = Gred; trusted_connection = yes; server = (local)">
          </appSettings>
     </configuration>


N in codings part:

Imports System.Data.SqlConnection
Dim con As New SqlConnection (ConfigurationSetting.AppSettings("stu"))


Now how to do the same thing in VB.Net(app.Settings)

I tried app.config:

<configuration>
     <appSettings>
          <add key = "stu.ConnectionString" value = "datasource = Gred; initial catalog = Apps; Integrated Security = SSPI; packet size = 4096"/>
     </appSettings>
</configuration>


N in codings part:

Imports System.Data.SqlClient
Me.stu.ConnectionString = CType (System.Configuration.ConfigurationSettings.AppSettings.GetValues("stu.ConnectionString"))

ASP.Net is not a prob but how to do the same thing in vb.net. The above codes was taken in net but doesnt work. Help me please... n plz do xplain d codes 2...;)

darlo23288
Newbie Poster
1 post since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You