I would like to start using SharpDevelop
But in my test project I added the reference System.Data.SqlServerCe
This is my project
/*
* Creato da SharpDevelop.
* Utente: Marco
* Data: 27/03/2017
* Ora: 9.59
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using System.Data.Common;
using System.IO;
using System.Data.SqlServerCe;
namespace prova
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public static void Main(string[ args)
{
Application.Run(new MainForm());
}
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, EventArgs e)
{
SqlCeConnection conn = null;
try
{
conn = new SqlCeConnection("Data Source=Server2008; Integrated Security=SSPI; Initial Catalog=cmfspa;User Id=sa;Password=martina02");
con.Open();
SqlCeCommand cmd = con.CreateCommand();
cmd.CommandText="SELECT ar_descr, ar_desint, ar_codart, ar_ubicaz FROM artico WHERE ar_codart = '" + Codice_articolo.ToUpper().Trim() + "' , con";
cmd.ExecuteNonQuery();
}
finally
{
con.Close();
}
}
}
}
I error in
SqlCeConnection conn = null;
and
SqlCeCommand cmd = con.CreateCommand();
the error for SqlCeConnection and SqlCeCommand is
The 'System.Data.Common.DbConnection' type is defined in an assembly of which the reference is missing. Add an assembly reference 'System.Data, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089'. (CS0012)