Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Mobile Development
  3. Mobile
  4. help with connecting to SQL Server CE using VB.net

help with connecting to SQL Server CE using VB.net

Scheduled Pinned Locked Moved Mobile
databasehelpcsharpsql-server
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gundamhamtaro
    wrote on last edited by
    #1

    Hi all, i'm trying to create a new database in CE but it doesnt seem to work for some reason........can someone help? thanks!! Imports System.Data.SqlServerCe Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'create DB Dim engine As New SqlServerCe.SqlCeEngine("Data Source = \My Documents\test.sdf") engine.CreateDatabase() 'error here 'connect to DB Dim ssceconn As New SqlServerCe.SqlCeConnection("Data Source = \My Documents\test.sdf") ssceconn.Open() 'ceate table Dim sqlCreateTable As SqlServerCe.SqlCeCommand = ssceconn.CreateCommand() sqlCreateTable.CommandText = _ "CREATE TABLE People(people_id int IDENTITY(0,1) PRIMARY KEY, f_name ntext, l_name ntext)" sqlCreateTable.ExecuteNonQuery() 'inserting rows Dim sqlInsertRow As SqlServerCe.SqlCeCommand = ssceconn.CreateCommand() sqlInsertRow.CommandText = "INSERT INTO People(f_name, l_name) VALUES('John', 'Doe')" sqlInsertRow.ExecuteNonQuery() 'close connection ssceconn.Close() End Sub An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll Additional information: SqlCeException SQL Server CE encountered problems in creating the SQL Server CE database [,,,Connection String,,]

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups