title: Windows CE Application - Microsoft Access Database
body: <p>I have an application developed on Microsoft Access (.accdb) to manage stocks and i like to develop an module to use a data collector that runs a windows CE 5.0. 
  So I started to develop in .net (VS 2008) the screen to make the stocks movimentation like expedition. At the moment that I try to connect to database the VS give me an error telling me that is not possible make the connection, but when I test the connection, the connection is sucessfull.</p>
  
  <p>I just want make simple operations like select and update the values in database. </p>
  
  <p>Is there any way to make the connection?</p>
  
  <p>I found something, but all of those solutions use SQL / SQLCe.</p>
  
  <p>The code that I Try</p>
  
  <p>Imports System.Data.OleDb</p>
  
  <p>Public Class Form1</p>
  
  <pre><code>Public OleDb As OleDbConnection
  
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      Dim dbComm As OleDbCommand = OleDb.CreateCommand()
      dbComm.CommandText = "SELECT * FROM CLIENTE WHERE CLI_ID = @P0"
      dbComm.Parameters.AddWithValue("@P0", TextBox1.Text)
      Dim dr As OleDbDataReader = dbComm.ExecuteReader()
      dr.Read()
      Label2.Text = dr("CLI_NOME").ToString()
  End Sub
  
  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      OleDb = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\db.accdb;")
      OleDb.Open()
  End Sub
  </code></pre>
  
  <p>End Class</p>
  
  <p>Give me an error on the first line after I put the Imports System.Data.OleDb</p>
  
  <p>Error: Warning  1   Namespace or type specified in the Imports 'System.Data.OleDb' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.   </p>