1. Sample of SQL connection with app.config

1.) Sample of the app.config



2.) Call connection(app.config) from form.

Code :
               
            Imports System.Data
            Imports System.Data.SqlClient
            Imports System.Configuration

            Public Class SampleForm
                      Dim constr As String = My.MySettings.Default.MyPayDbConnectionString
                      Dim MyCon As New SqlConnection(constr)

            End Class

No comments:

Post a Comment