I am new with C#. I am using Visual Studio 13, my problem is that it's throwing me this error:
The type or namespace name 'SQLite' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
Yes, i add references from here http://ift.tt/1p6GLAv and i follow the tutorial from here : http://ift.tt/1ALEa2h
heres my code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SQLite;
namespace PercobaanDulu
{
public partial class Form1 : Form
{
string connString;
public Form1()
{
InitializeComponent();
connString = @" Data Source = C:\Users\Febry Fairuz\Desktop\dbDemoLagi.db; Version = 3";
}
private void btnConnect_Click(object sender, EventArgs e)
{
using (SQLiteConnection con = new SQLiteConnection(connString)) {
try {
con.Open();
if(con.State == ConnectionState.Open){
MessageBox.Show("Koneksi berhasil dengan SQLite");
}
}catch(Exception ex){
MessageBox.Show(ex.Message);
}
}
}
}
}
Can you help me ?
Aucun commentaire:
Enregistrer un commentaire