| | |
how to create database
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
VB.NET Syntax (Toggle Plain Text)
[code = VB.NET] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con As SqlConnection Dim sql As String Dim cmd As SqlCommand con = New SqlConnection("Server=urserver;" & "DataBase=;" & "Integrated Security=ur security;") sql = "CREATE DATABASE ABC ON PRIMARY" + "(Name=abc_data, filename = 'C:\MSSQL7\data\abc.mdf', size=3," + "maxsize=5, filegrowth=10%)log on" + "(name=abc_log, filename='C:\MSSQL7\abc_log.ldf',size=3," + "maxsize=20,filegrowth=1)" con.Open() cmd = New SqlCommand(sql, con) Try cmd.ExecuteNonQuery() MsgBox("DATABASE Created") Catch ex As Exception MsgBox("Database Already Exists!") End Try End Sub
Regards,
Piya:)
Piya:)
![]() |
Similar Threads
- There is no menu choice to create a new database diagram (MS SQL)
- How do I create a database at run-time using VB6.0 (Visual Basic 4 / 5 / 6)
- How do i create a database in vb (Visual Basic 4 / 5 / 6)
- How to create a database during the runtime in VB6?! (Visual Basic 4 / 5 / 6)
- How to create a database, (Community Introductions)
- Need to know how to create a database that will generate a random number (Database Design)
Other Threads in the VB.NET Forum
- Previous Thread: DBdataset Dynamic file path
- Next Thread: Parse an xml stream
| Thread Tools | Search this Thread |
"crystal .net .net2005 .net2008 2008 access add application array assignment basic beginner box browser button buttons click code combo convert cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationthesis dissertationtopic dosconsolevb.net editvb.net exists fade filter firewall forms html image images input isnumericfuntioncall listview math mobile module mssqlbackend mysql navigate number opacity open panel picturebox picturebox2 port print printing printpreview record regex reports" reuse right-to-left savedialog serial settings shutdown socket sqldatbase sqlserver storedprocedure string temp temperature textbox timer timespan transparency txttoxmlconverter useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vbnet vista visual visualbasic.net visualstudio.net web winforms wpf wrapingcode xml year






