Insert data to microsoft Access using C#

Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 5586
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Data.SqlClient;
using System.Data.Odbc;
using System.Data.OleDb;

public partial class oledb : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)

OleDbConnection objConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=D:\\mydb.mdb;");

OleDbCommand objCmd = new OleDbCommand("insert into stud values(200,'aaa','aaa')", objConn);
OleDbDataReader objReader;
objReader = objCmd.ExecuteReader();



Comments or Responses

Login to post response