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 System.Data.SqlServerCe; namespace SmartDeviceProject1 { public partial class novart2 : Form { public novart2() { InitializeComponent(); } SqlCeConnection cn = new SqlCeConnection("Data Source=C:\\Users\\USER\\Documents\\Visual Studio 2008\\Projects\\SmartDeviceProject1\\Ege.sdf"); SqlCeCommand cmd = new SqlCeCommand(); private void menuItem1_Click(object sender, EventArgs e) { novart f = new novart(); f.Show(); } private void button1_Click(object sender, EventArgs e) { try { cn.Open(); cmd = new SqlCeCommand ("Insert into Art (mr,group_id,subgroup_id,quantity_on_stock) values('"+txtmr.Text +"','"+txtgr.Text +"','"+txtsubg.Text +"','"+txtqnt.Text +"')", cn); cmd.ExecuteNonQuery(); MessageBox.Show("Update Successfull to the Database"); cn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)