I develope an application contain a database sqlite3, I need creates the .exe file for the application and the database to install it on another machine using the Visual Studio tool 2012 ( InstallShield Limited Edition).the path of the database (C:\Users\A\Documents\myfirstdatabase.db3 ) so how deploy the application with the database sqlite3 ?
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Helpers;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using System.Data.SQLite;
using System.IO;
namespace mysqlite
{
public partial class Form1 : RibbonForm
{
public Form1()
{
InitializeComponent();
}
SQLiteConnection cn=new SQLiteConnection("data source=C:\\Users\\A\\Documents\\myfirstdatabase.db3"); SQLiteCommand cmd = new SQLiteCommand();
private void Form1_Load(object sender, EventArgs e)
{
this.employeeTableAdapter.Fill(this.myfirstdatabase.db3DataSet.Employee);
cn.Open();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
private void simpleButton1_Click(object sender, EventArgs e){
try {
cmd.CommandText = "insert into Employee values('"+idSpinEdit.Text +"','"+ nomTextEdit.Text+"','"+prenomTextEdit.Text+"','"+salaireSpinEdit.Text+"')"; cmd.Connection = cn;
cmd.ExecuteNonQuery();
`this.employeeTableAdapter.Fill(this.myfirstdatabase.db3DataSet.Employee);`
}
catch { MessageBox.Show("you have an error"); }
}
}
}
Aucun commentaire:
Enregistrer un commentaire