Create Database "<DBname>" not working from SqlDataAdapter

sponguru_dba

New member
Joined
Jun 29, 2006
Messages
3
Programming Experience
Beginner
Hi all

Here my code

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
sqlconn1.ConnectionString = "server ='" & TextBox1.Text & "';Database='" & TextBox2.Text & "';uid='" & TextBox3.Text & "';password='" & TextBox4.Text & "';trusted_connection= false"
Try
sqlconn1.Open()
Dim sqlad1 As SqlDataAdapter = New SqlDataAdapter("create database tested2", sqlconn1)
MessageBox.Show("Database was Created")
Catch ex1 As Exception
MessageBox.Show("Database was not Created")
Finally
sqlconn1.Close()
End Try
End Sub
End
Class

above code not creating Database why some doby give suggestion
Iwant greate Database front end how to do


thanks in Advance
Sree
 
The SqlDataAdapter constructor only accepts a SELECT statement (for initialize of its SelectCommand).
 
Back
Top