Y
yogeshvc
Hi,
I m new bie to VS 2005 pocket pc development. I m trying to connect to
SQL CE database which will be created locally and used locally by
pocket pc application and nothing to do with sql server 2005 database.
Added Reference - System.Data.SqlServerCe
Dim engine As New SqlCeEngine("Data Source = \My Documents\test.sdf")
engine.CreateDatabase()
Dim ssceconn As New SqlCeConnection("Data Source = \My
Documents\test.sdf")
ssceconn.Open()
Dim sqlCreateTable As SqlCeCommand = ssceconn.CreateCommand()
sqlCreateTable.CommandText = "CREATE TABLE People(people_id int
IDENTITY(0,1) PRIMARY KEY, f_name ntext, l_name ntext)"
sqlCreateTable.ExecuteNonQuery()
Dim sqlInsertRow As SqlCeCommand = ssceconn.CreateCommand()
sqlInsertRow.CommandText = "INSERT INTO People(f_name, l_name)
VALUES('John', 'Doe')"
sqlInsertRow.ExecuteNonQuery()
ssceconn.Close()
And along with this, I cannt see Microsoft SQL Server Mobile Edition
while adding datasource in my project.
Data | Add New Data Source.
Guys please guide me thr' this.
Yogesh
I m new bie to VS 2005 pocket pc development. I m trying to connect to
SQL CE database which will be created locally and used locally by
pocket pc application and nothing to do with sql server 2005 database.
Added Reference - System.Data.SqlServerCe
Dim engine As New SqlCeEngine("Data Source = \My Documents\test.sdf")
engine.CreateDatabase()
Dim ssceconn As New SqlCeConnection("Data Source = \My
Documents\test.sdf")
ssceconn.Open()
Dim sqlCreateTable As SqlCeCommand = ssceconn.CreateCommand()
sqlCreateTable.CommandText = "CREATE TABLE People(people_id int
IDENTITY(0,1) PRIMARY KEY, f_name ntext, l_name ntext)"
sqlCreateTable.ExecuteNonQuery()
Dim sqlInsertRow As SqlCeCommand = ssceconn.CreateCommand()
sqlInsertRow.CommandText = "INSERT INTO People(f_name, l_name)
VALUES('John', 'Doe')"
sqlInsertRow.ExecuteNonQuery()
ssceconn.Close()
And along with this, I cannt see Microsoft SQL Server Mobile Edition
while adding datasource in my project.
Data | Add New Data Source.
Guys please guide me thr' this.
Yogesh