SQLCeConnection
- From: amiga500@xxxxxxxxx
- Date: 20 Nov 2006 08:10:39 -0800
This is the code I am using:
Private Sub frmInventoryTransfer_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim objConn As SqlCeConnection = Nothing
Dim objEngine As SqlCeEngine = Nothing
Dim objComm As New SqlCeCommand
Dim objDataReader As SqlCeDataReader = Nothing
Dim txtItemNumber As String
'Dim objDrItems As SqlCeDataAdapter
'"User ID=DSUSER;PASSWORD=silentk;Data
Source=NTSERVER-2;Initial
'Catalog=Direct Source System;Persist Security
Info=False;Packet
'Size=4096"
'objEngine.LocalConnectionString = "Data Source=NTSERVER-2"
'objEngine.CreateDatabase()
objEngine = New SqlCeEngine("Data
Source=NTSERVER-2;password=silentk;user ID='DSUSER'")
'objEngine.CreateDatabase()
'objEngine.Dispose()
objConn = New SqlCeConnection("Data
Source=NTSERVER-2;password=silentk")
objConn.Open()
objComm = objConn.CreateCommand()
objComm.CommandText = "SELECT * FROM Products"
objComm = New SqlCeCommand(objComm.CommandText, objConn)
objDataReader = objComm.ExecuteReader
While objComm.ExecuteNonQuery = True
txtItemNumber = objComm.ExecuteNonQuery
End While
objConn.Close()
MsgBox(txtItemNumber)
End Sub
I get the following error:
An unhandled exception of type 'System.ArgumentException' occurred in
System.Data.SqlServerCe.dll
Additional information: Unknown connection option in connection string:
user id.
.
- Follow-Ups:
- Re: SQLCeConnection
- From: Erik Visser
- Re: SQLCeConnection
- Prev by Date: Problem with SQLCe and connecting to the server.
- Next by Date: Re: How to read data from stand alone SQL CE database on mobile device from VB.net 2005
- Previous by thread: Problem with SQLCe and connecting to the server.
- Next by thread: Re: SQLCeConnection
- Index(es):
Relevant Pages
|