muratsekerci
New member
- Joined
- Mar 18, 2006
- Messages
- 3
- Programming Experience
- 5-10
Hi, everybody. Anybody know How I can create Sql DataBase and execute an Sql Script code by VB.net codes ? Thanks a lot ... (sorry for my kite english)
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] myConnection [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] SqlConnection
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] myCommand [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] SqlCommand
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] dr [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] SqlDataReader[/SIZE]
[SIZE=2]
[SIZE=2]myConnection = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlConnection("server=SERVERNAME;Initial Catalog=;User ID=;Password=;")
[/SIZE][SIZE=2]myConnection.Open()
myCommand = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlCommand("CREATE DATABASE myNewDB", myConnection)
myCommand.ExecuteNonQuery()
myConnection.Close()