Code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.OleDb; namespace Form2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void patientBindingNavigatorSaveItem_Click(object sender, EventArgs e) { this.Validate(); this.patientBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.patientDataSet); } private void patientBindingNavigatorSaveItem_Click_1(object sender, EventArgs e) { this.Validate(); this.patientBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.patientDataSet); } private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'patientDataSet.patient' table. You can move, or remove it, as needed. this.patientTableAdapter.Fill(this.patientDataSet.patient); } private void submit_Click(object sender, EventArgs e) { string s="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\rhema\\Documents\\Visual Studio 2008\\Projects\\Form2\\Form2\\patient1.mdb; OleDbConnection conn=new OleDbConnection(s); conn.Open(); int patient_id=int.Parse(TextBox1.text); string name=TextBox2.text; string guardians=TextBox3.text; int weight=int.Parse(TextBox4.text); int heigtht=int.Parse(TextBox5.text); string sex=TextBox6.text; string address=TextBox7.text; int phoneno=int.Parse(TextBox8.text); OleDbCommand cmd=new OleDbCommand("insert into patient values("+patient_id+",'" +name+",'" +guardians+",'" +weight+",'" +Height+",'" +sex+",'" +address+",'" +phoneno+"')",conn); conn.Close(); } } }
pls help me
Comment