473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Using Microsoft Enterprise Libary with SQL server CE

livid86
Hello,

I'm trying to create a simple test project that will read and write from a SQL CE database. I have written a small amount of code and getting weird errors that i have googled and do not understand.

This is the code i have got
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Microsoft.Practices.EnterpriseLibrary.Data.SqlCe;
  10. //using Microsoft.Practices.EnterpriseLibrary.Data;
  11.  
  12. namespace simpleDatabaseConnect
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void Form1_Load(object sender, EventArgs e)
  22.         {
  23.  
  24.             dataGrid1.DataSource = null;
  25.             string db =  @"Data Source=simpleDatabase.sdf;";
  26.             SqlCeDatabase database = new SqlCeDatabase(db);
  27.             DataSet ds = database.ExecuteDataSet("SELECT * FROM tblStatus");
  28.  
  29.         }
  30.     }
  31. }
Nothing fancy at all. But for some reason the code is still getting the following errors.

Expand|Select|Wrap|Line Numbers
  1. Error    1    The type 'System.Data.IDataReader' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.    C:\Users\Cory\Documents\Visual Studio 2008\Projects\simpleDatabaseConnect\simpleDatabaseConnect\Form1.cs    27    13    simpleDatabaseConnect
  2.  
  3.  
  4. Error    2    The type 'System.Data.Common.DbCommand' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.    C:\Users\Cory\Documents\Visual Studio 2008\Projects\simpleDatabaseConnect\simpleDatabaseConnect\Form1.cs    27    13    simpleDatabaseConnect
  5.  
  6.  
  7.  
I have imported system.data as a reference and as you can see i'm using it.

Thanks for your help.
Cory Thompson
Jul 23 '09 #1
0 1656

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: John Morgan | last post by:
I have Enterprise Manager on my local machine. For the last twelve months it has been connecting without problem to my online SQL Server database provided by my ISP. Three weeks ago the ISP...
4
by: wASP | last post by:
Hi, I am contemplating the purchase of Microsoft Visual Studio .NET, and I've noticed that the prices range anywhere from $200 to $600 USD:...
1
by: Tom Edelbrok | last post by:
I am creating a class libary of VB.Net utilities that will be built into a DLL. This DLL can be used by our development VB.NET programs when they want to call standard in-house utilities. I...
9
by: reshugoyal | last post by:
Hi, I need to implement Auto Updates in my application wherein I will be installing the application using msi. First time I will be installing it through CD.( Directly running the MSI file)...
1
by: Alex | last post by:
Hi Everyone, Most of our MS SQL Servers are still running on SQL 2000, but being I will soon be upgrading my workstation to Vista Business I'd like to install MS SQL 2005 Enterprise Manager to...
1
by: rubeel | last post by:
I cannot seem to connect to this Instance locally which was i able to in the past. I can connect to the instance from out side. The instance is running and the DBs in the instance are available and...
2
by: Ch Pravin | last post by:
Hi All: I am having the following xml which i need to convert to excel using xslt. Please help me out. Afghanistan.xml <?xml version="1.0" encoding="utf-16"?> <Languages...
13
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
This is a follow-up to my post "Silverlight video doesn't work when file is streamed from handler in ASP.net" at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.