______________________________________________________________________
Private Sub Salesman_Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If System.IO.File.Exists("\My Documents\Salesman.sdf") Then
System.IO.File.Delete("\My Documents\Salesman.sdf")
End If
Dim engine As New SqlCeEngine("Data Source = \My Documents\Salesman.sdf")
engine.CreateDatabase()
Dim sqlCreateTable As SqlCeCommand = ssceconn.CreateCommand()
sqlCreateTable.CommandText = _
"CREATE TABLE Login(user_id int IDENTITY(0,1) PRIMARY KEY, f_name ntext, l_name ntext, user_name nvarchar(10), password nvarchar(10), email ntext)" & vbCrLf & _
"CREATE TABLE Order(product_id int IDENTITY(0,1) PRIMARY KEY, retailer_name nvarchar(20), product_name nvarchar(20), quantity ntext)"
ssceconn.Open()
sqlCreateTable.ExecuteNonQuery()
ssceconn.Close()
End Sub
_____________________________________________________________________
Actually i heard from someone that you can actually create all the tables that you need such as "Login", "Order" and so on in a single windows form(in form_load) , which will load up all your table and create them for you if that window form is the first object to start running in the order.
This post has been edited by whitekeeper: 18 July 2009 - 12:21 AM

New Topic/Question
Reply




MultiQuote






|