Walkthrough: Using a Custom Action to Create a Database at Installation

I am studying the Walkthrough about Using a Custom Action to Create a Database at Installation in

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_deploy/html/2527c071-bf97-4f66-8e64-10e9b67a0569.htm

There are codes:

Private Sub ExecuteSql(ByVal DatabaseName As String, ByVal Sql As String)
Dim Command As New SqlClient.SqlCommand(Sql, sqlConnection1)
.....
End Sub

I can't figure out how the variable sqlConnection1 come from.

Could someone help me




Answer this question

Walkthrough: Using a Custom Action to Create a Database at Installation

  • Teera Tosukhowong

    I have added sqlconnection in Designer time, but I can't find out the name of the connection , and I can't refer it in applicaiton.

    I am using  c# .

     

     Tarun Gujral wrote:
    Check your VB application, if you have added sqlconnection in Designer mode. Visualstudio by default creates controls with names such as sqlconnection1 e.g if you add textbox in designer mode , its default name would be textbox1.


  • Konstantin E. Gonsovsky

    Check your VB application, if you have added sqlconnection in Designer mode. Visualstudio by default creates controls with names such as sqlconnection1 e.g if you add textbox in designer mode , its default name would be textbox1.
  • Walkthrough: Using a Custom Action to Create a Database at Installation