Create SQL database with specific path
<p>I need to create SQL database with specific path.<br>
I found this code:  </p>

<pre><code>Dim fullpath As String = TextBox4.Text &amp; TextBox1.Text &amp; "_data.mdf"
Dim fullpath1 As String = TextBox4.Text &amp; TextBox1.Text &amp; "_log.ldf"
Dim ExtLog As String = TextBox1.Text &amp; "_Log"
Dim ExtDat As String = TextBox1.Text &amp; "_Data"
Dim myConn As SqlConnection = New SqlConnection("Server='" &amp; ComboBox8.Text &amp; "';uid='" &amp; TextBox14.Text &amp; "';pwd='" &amp; TextBox13.Text &amp; "';database=master")
Dim str As String = "CREATE DATABASE " &amp; TextBox1.Text &amp; " ON PRIMARY (NAME = " &amp; ExtDat &amp; ",FILENAME = " &amp; fullpath &amp; ", SIZE = 3MB, MAXSIZE = 10MB, FILEGROWTH = 10%)  LOG ON (NAME = " &amp; ExtLog &amp; ", FILENAME = " &amp; fullpath1 &amp; ", SIZE = 1MB,MAXSIZE = 5MB, FILEGROWTH = 10%) "
Dim myCommand As SqlCommand = New SqlCommand(str, myConn)
Try
    myConn.Open()
    myCommand.ExecuteNonQuery()
    MessageBox.Show("Database is created successfully", "MyProgram", MessageBoxButtons.OK, MessageBoxIcon.Information)
   Catch ex As Exception
        MessageBox.Show(ex.ToString())
   Finally
        If (myConn.State = ConnectionState.Open) Then
           myConn.Close()
        End If
   End Try  
</code></pre>

<p>Where:</p>

<pre><code>combobox1= "local", textbox14= "sqlusername", textbox13=
"sqlpassword", textbox1= "newSQL", textbox4= "d:\MyFolder\"
</code></pre>

<p>I get the error says:  Incorrect syntax near 'd:', The label 'd' has already been declared. Label names must be unique within a query batch.
But it's working fine when I use the following str:</p>

<pre><code>str = "CREATE DATABASE newSQL ON PRIMARY (NAME = newSQL_Data,FILENAME = 'D:\MyFolder\newSQLData.mdf', SIZE = 3MB, MAXSIZE = 10MB, FILEGROWTH = 10%)  LOG ON (NAME = newSQL_Log, FILENAME = 'D:\MyFolder\newSQLLog.ldf', SIZE = 1MB,MAXSIZE = 5MB, FILEGROWTH = 10%) "
</code></pre>

<p>Can anyone help?</p>