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
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using Microsoft.Practices.EnterpriseLibrary.Data.SqlCe;
- //using Microsoft.Practices.EnterpriseLibrary.Data;
- namespace simpleDatabaseConnect
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- dataGrid1.DataSource = null;
- string db = @"Data Source=simpleDatabase.sdf;";
- SqlCeDatabase database = new SqlCeDatabase(db);
- DataSet ds = database.ExecuteDataSet("SELECT * FROM tblStatus");
- }
- }
- }
Expand|Select|Wrap|Line Numbers
- 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
- 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
Thanks for your help.
Cory Thompson