Wednesday 21 March 2012

Inserting and connecting the MSAccess2007 with C# .net

OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\Learning2\\App_Data\\tahir.accdb;Persist Security Info=False;");
OleDbCommand comm = new OleDbCommand("INSERT INTO test VALUES(@roll_no, @st_name, @st_course)", conn);
comm.Parameters.AddWithValue("@roll_no", TextBox1.Text);
comm.Parameters.AddWithValue("@st_name", TextBox2.Text);
comm.Parameters.AddWithValue("@st_course", TextBox3.Text);
conn.Open();
comm.ExecuteNonQuery();
conn.Close();

1 comment:

  1. I think Tahir Khslid's this program-me is helpful for internet lover's. By learning this program-me they able to do any Computer Solution .

    ReplyDelete