Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 StudentManagement
- {
- public partial class Form1 : Form
- {
- OleDbConnection vcon = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Touhid\Documents\db1.mdb");
- public Form1()
- {
- vcon.Open();
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- String vsql = "INSERT INTO student VALUES(" + textBox1.Text + ", '" + textBox2.Text + "' ," + textBox3.Text + "," + textBox4.Text + "," + textBox5.Text + ", '" + textBox6.Text +"')";
- String vsql2 = String.Format("INSERT INTO student VALUES((0), '(1)', (2), (3), (4), '(5)')",int.Parse(textBox1.Text),textBox2.Text, int.Parse(textBox3.Text), int.Parse(textBox4.Text), int.Parse(textBox5.Text),textBox6.Text);
- MessageBox.Show(vsql2);
- /*OleDbCommand vcom= new OleDbCommand(vsql, vcon);
- vcom.ExecuteNonQuery();
- MessageBox.Show("Data Stored Successfully");
- vcom.Dispose();*/
- }
- private void button4_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement