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

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2008
Posts: 1
Reputation: darlo23288 is an unknown quantity at this point 
Solved Threads: 0
darlo23288 darlo23288 is offline Offline
Newbie Poster

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

 
0
  #1
Aug 20th, 2008
Hi, i juz wanted to know how to write this following codings in app.config.

In ASP.Net in web.config:
  1. <configuration>
  2. <appSettings>
  3. <add KEY = "stu" value = "database = Gred; trusted_connection = yes; server = (local)">
  4. </appSettings>
  5. </configuration>

N in codings part:
  1. Imports System.DATA.SqlConnection
  2. Dim con AS New SqlConnection (ConfigurationSetting.AppSettings("stu"))

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

I tried app.config:
  1. <configuration>
  2. <appSettings>
  3. <add KEY = "stu.ConnectionString" value = "datasource = Gred; initial catalog = Apps; Integrated Security = SSPI; packet size = 4096"/>
  4. </appSettings>
  5. </configuration>

N in codings part:

  1. Imports System.DATA.SqlClient
  2. 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...
Last edited by peter_budo; Aug 23rd, 2008 at 6:35 pm. Reason: Use code tags instead of color tags
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC