How To include sql scripts in package & Deployment of VB.NET 2005

db , vb.net United States
  • 13 years ago

     How To include  sql scripts in package & Deployment of VB.NET 2005

    appreciate for your help.

  • 13 years ago

    You can create a Custom Action to do this. Here's an example of creating a database and table from MSDN.  

    http://msdn2.microsoft.com/en-us/library/49b92ztk(VS.80).aspx

  • 13 years ago

    Thanks for providing the good link which i am able to create the installation setups when i was testing with deployement process i am not able to see the server name

    how to customize the Server name during the installation process.

     

     

     

  • 13 years ago

    Provided link is O.k to my requirment  

    but below code we can change database name ,How to set Server name ,User id and Password

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

            ' Initialize the connection, open it, and set it to the "master" database
            masterConnection.ConnectionString = My.Settings.masterConnectionString
            Command.Connection.Open()
            Command.Connection.ChangeDatabase(DatabaseName)
            Try
                Command.ExecuteNonQuery()
            Finally
                ' Closing the connection should be done in a Finally block
                Command.Connection.Close()
            End Try
        End Sub
    Its very urgent  to me.

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr