Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Create Database on the server using VB code

$
0
0

Hello All,

The following code create a Database on SQL Express on my PC.  I wish to create a database on the server NOT on my PC.  What changes must I make to the following code to create the database on the server?

Dim Str As String

        Dim connectionString As String =
     "data source=(LocalDB)\v11.0;initial catalog=MASTER;" &
        "integrated security=true;connection timeout=30"

        Dim Connection_Initial As New SqlConnection()
        Connection_Initial.ConnectionString = connectionString

        Str = "CREATE DATABASE SMBDBASE ON PRIMARY " & _
            "(NAME = SMBDBASE_DATA, " & _
            " FILENAME = 'C:\Users\Public\SIMPLE_MONTHLY_BUDGET_FOLDER\SMBDBASE.MDF', " & _
            " SIZE = 150MB, " & _
            " MAXSIZE = UNLIMITED, " & _
            " FILEGROWTH = 60%) "

Any help would be appreciate.


ecb



Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>