Do I have to have SQL Server Express installed?
-
I wanted to add database services to my windows app, but didn't want to use SQL Server, Access or even a DBF file would of been fine. So the code below works fine, creates a database file, but off the top of your head, will I need to have sql server installed on other client machines?
Dim m_connString As String = "Data Source=(LocalDB)\v11.0; Integrated Security=True;"
Dim myConnection As SqlConnection = New SqlConnection(m_connString)Dim myQueryString As String = \_ "CREATE DATABASE STREAKWAVE ON PRIMARY " & \_ "( " & \_ " NAME = STREAKWAVE, " & \_ " FILENAME = '" & m\_storagePath & "\\STREAKWAVE.mdf', " & \_ " SIZE = 10MB, " & \_ " MAXSIZE = 500MB, " & \_ " FILEGROWTH = 10% " & ") " & \_ " LOG ON " & \_ "( " & \_ " NAME = STREAKWAVE\_Log, " & \_ " FILENAME = '" & m\_storagePath & "\\STREAKWAVE.ldf', " & \_ " SIZE = 1MB, " & \_ " MAXSIZE = 500MB, " & \_ " FILEGROWTH = 10% " & \_ ") "
-
I wanted to add database services to my windows app, but didn't want to use SQL Server, Access or even a DBF file would of been fine. So the code below works fine, creates a database file, but off the top of your head, will I need to have sql server installed on other client machines?
Dim m_connString As String = "Data Source=(LocalDB)\v11.0; Integrated Security=True;"
Dim myConnection As SqlConnection = New SqlConnection(m_connString)Dim myQueryString As String = \_ "CREATE DATABASE STREAKWAVE ON PRIMARY " & \_ "( " & \_ " NAME = STREAKWAVE, " & \_ " FILENAME = '" & m\_storagePath & "\\STREAKWAVE.mdf', " & \_ " SIZE = 10MB, " & \_ " MAXSIZE = 500MB, " & \_ " FILEGROWTH = 10% " & ") " & \_ " LOG ON " & \_ "( " & \_ " NAME = STREAKWAVE\_Log, " & \_ " FILENAME = '" & m\_storagePath & "\\STREAKWAVE.ldf', " & \_ " SIZE = 1MB, " & \_ " MAXSIZE = 500MB, " & \_ " FILEGROWTH = 10% " & \_ ") "
-
I wanted to add database services to my windows app, but didn't want to use SQL Server, Access or even a DBF file would of been fine. So the code below works fine, creates a database file, but off the top of your head, will I need to have sql server installed on other client machines?
Dim m_connString As String = "Data Source=(LocalDB)\v11.0; Integrated Security=True;"
Dim myConnection As SqlConnection = New SqlConnection(m_connString)Dim myQueryString As String = \_ "CREATE DATABASE STREAKWAVE ON PRIMARY " & \_ "( " & \_ " NAME = STREAKWAVE, " & \_ " FILENAME = '" & m\_storagePath & "\\STREAKWAVE.mdf', " & \_ " SIZE = 10MB, " & \_ " MAXSIZE = 500MB, " & \_ " FILEGROWTH = 10% " & ") " & \_ " LOG ON " & \_ "( " & \_ " NAME = STREAKWAVE\_Log, " & \_ " FILENAME = '" & m\_storagePath & "\\STREAKWAVE.ldf', " & \_ " SIZE = 1MB, " & \_ " MAXSIZE = 500MB, " & \_ " FILEGROWTH = 10% " & \_ ") "
-
If this code works then you are presumably using SQL CE or similar, which is on the local machine. That is fine as far as it goes, but if you wish to share the database with other clients then you will need SQL server.
Sorry so late; got wrapped up in a few projects What a pain in the ?, I got it working finally, and found a 33 meg download for localDB. But the speed is day and night, 20 secs using the DBF vs 1 sec using localDB So VS2013 gives you the localDB, my users will have to install it.
-
Thanks Eddy Just got it to work, create database, tables, records make the con strings for that. Better than the oleDB DBF I was going to use, which took 20 sec to write 49 records. Finished the switch to localDB this morning. I have never heard of localDB, but it seems handy for vb.net windows apps.