pls help me i am using vs2005 i am creating a program and connected in a ms access database, the problem is i dont know how to save my data in my database whenever i click the save button because i dont know what code will i write.. for example the fields are
LastName and FirstName
i input on the lastname textbox is migs or whatever and in firstname is anonymous but how will i save it in my ms access database? i haved already fields in my database..
pls help me i post my code below and hoping for your cooperation...
using System;
using System.Data;
using System.Configuration;
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;
public partial class _Default : System.Web.UI.Page
{
string stcron = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\Database\\db1.mdb;Persist Security Info=False";
System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection();
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter();
System.Data.OleDb.OleDbCommand dc = new System.Data.OleDb.OleDbCommand();
protected void Page_Load(object sender, EventArgs e)
{
cn = new System.Data.OleDb.OleDbConnection(stcron);
DataTable dt = new DataTable();
}
protected void saveButton_Click(object sender, EventArgs e)
{
//cn.Open();
// dc = cn.CreateCommand();
// dc.CommandText=
}
}