8 Replies - 8322 Views - Last Post: 10 March 2010 - 12:55 AM

#1 mher2ha   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 12-April 09

how to connect sql server ce?

Posted 22 April 2009 - 11:32 AM

hi.. can you help me how to connect sql server 2000 ce to VS 2008? i incounter this error if i try to connect it here my sample code

import system.data
import system.data.sqlserverce

form1_load
dim conn as sqlceconnection
conn = new sqlceconnection 'Here the part that will error (Can't find DLL PInvoke 'sqlceme35.dll')
conn.connectionstring =("Data Source=C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples.sdf")
conn.open
end sub




i hope you help me guys
thanks

Is This A Good Question/Topic? 0
  • +

Replies To: how to connect sql server ce?

#2 iwan_tjioe82   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 20-April 09

Re: how to connect sql server ce?

Posted 23 April 2009 - 09:40 PM

make sure you have installed the sql server ce correctly...
and make sure it's install on memory phone
and the data source should be like
Data Source='\storage card\test.sdf'


in this case i create a database name test.sdf on storage card at phone
hopefully this can help you

This post has been edited by iwan_tjioe82: 23 April 2009 - 09:43 PM

Was This Post Helpful? 0
  • +
  • -

#3 mher2ha   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 12-April 09

Re: how to connect sql server ce?

Posted 24 April 2009 - 11:45 AM

hi im sorry im a beginer... what i need to install to the device? and what i need to do to test my sample program?
Was This Post Helpful? 0
  • +
  • -

#4 iwan_tjioe82   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 20-April 09

Re: how to connect sql server ce?

Posted 25 April 2009 - 04:00 AM

View Postmher2ha, on 24 Apr, 2009 - 10:45 AM, said:

hi im sorry im a beginer... what i need to install to the device? and what i need to do to test my sample program?


sql server ce
try this
http://www.microsoft...us/compact.aspx
after you install then in your IDE add reference to system.data.sqlserverce
don't forget to use
imports system.data.sqlserverce

or
using system.data.sqlserverce;

Was This Post Helpful? 0
  • +
  • -

#5 mher2ha   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 12-April 09

Re: how to connect sql server ce?

Posted 25 April 2009 - 10:48 AM

hi.. i already install the IDE to my loptop and still incounter that error.. what i need to install to my PDA, if i try to install the IDE to my PDA i will said its not compatible to the device, and look for the application that will run the software..
Was This Post Helpful? 0
  • +
  • -

#6 iwan_tjioe   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-May 08

Re: how to connect sql server ce?

Posted 11 May 2009 - 12:15 AM

View Postmher2ha, on 25 Apr, 2009 - 09:48 AM, said:

hi.. i already install the IDE to my loptop and still incounter that error.. what i need to install to my PDA, if i try to install the IDE to my PDA i will said its not compatible to the device, and look for the application that will run the software..

could you specify your pda and what windows mobile version do you have
from system|about
Was This Post Helpful? 0
  • +
  • -

#7 Hellsystem   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-May 09

Re: how to connect sql server ce?

Posted 24 May 2009 - 08:26 AM

	
Dim Inc As Integer
	Dim MaxRows As Integer
	Dim DBCon As New System.Data.SqlServerCe.SqlCeConnection
	Dim DataSet As New DataSet
	Dim DataAdapter As New System.Data.SqlServerCe.SqlCeDataAdapter"

	Public Function CreateSQLDatabase(ByVal DatabaseName As String) As Boolean
		Try
			Dim DBCreate As New SqlServerCe.SqlCeEngine("Data Source=" & App_Path() & DatabaseName & ";Password=project")
			DBCreate.CreateDatabase()
			Return True
		Catch ex As Exception
			Return False
		End Try
	End Function
 
   Public Sub CreateTable()	  
Create Database
		DBCon.ConnectionString = "Data Source=" & App_Path() & "DatabaseName.sdf" & ";Password=***"
		DBCon.Open()
		Dim TABLENAME As New SqlServerCe.SqlCeCommand("CREATE TABLE TABLENAME (AutoId int identity ,FilmID NVarchar(255),FilmNaam NVarchar(255),FilmJaar NVarchar(255),FilmReview ntext,Drager NVarchar(255)CONSTRAINT [pk_AutoId] PRIMARY KEY (AutoId)) ", DBCon)
		Films.ExecuteNonQuery()
		DBCon.Close()
		Exit Sub
	End Sub


With this code you can create the database in your code!!
-> For more information (PM) me..
Was This Post Helpful? 0
  • +
  • -

#8 dinkar_bhingarde   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 23-June 09

Re: how to connect sql server ce?

Posted 23 June 2009 - 04:12 AM

View PostHellsystem, on 24 May, 2009 - 07:26 AM, said:

	
Dim Inc As Integer
	Dim MaxRows As Integer
	Dim DBCon As New System.Data.SqlServerCe.SqlCeConnection
	Dim DataSet As New DataSet
	Dim DataAdapter As New System.Data.SqlServerCe.SqlCeDataAdapter"

	Public Function CreateSQLDatabase(ByVal DatabaseName As String) As Boolean
		Try
			Dim DBCreate As New SqlServerCe.SqlCeEngine("Data Source=" & App_Path() & DatabaseName & ";Password=project")
			DBCreate.CreateDatabase()
			Return True
		Catch ex As Exception
			Return False
		End Try
	End Function
 
   Public Sub CreateTable()	  
Create Database
		DBCon.ConnectionString = "Data Source=" & App_Path() & "DatabaseName.sdf" & ";Password=***"
		DBCon.Open()
		Dim TABLENAME As New SqlServerCe.SqlCeCommand("CREATE TABLE TABLENAME (AutoId int identity ,FilmID NVarchar(255),FilmNaam NVarchar(255),FilmJaar NVarchar(255),FilmReview ntext,Drager NVarchar(255)CONSTRAINT [pk_AutoId] PRIMARY KEY (AutoId)) ", DBCon)
		Films.ExecuteNonQuery()
		DBCon.Close()
		Exit Sub
	End Sub


With this code you can create the database in your code!!
-> For more information (PM) me..


hi

install following two CAB files in ur emulator...

SyncServices.wce
SyncServices.wm

location - C:\Program Files\Microsoft Synchronization Services\ADO.NET\v1.0\Devices\WindowsCE
Was This Post Helpful? 0
  • +
  • -

#9 Guest_kesavaraman*


Reputation:

Re: how to connect sql server ce?

Posted 10 March 2010 - 12:55 AM

dear sir
i want coding for mobile to .net connection in my progarm if any one knows means plz help for me its very urgent




by kesavaraman
Was This Post Helpful? 0

Page 1 of 1