Front end: Asp.net
Code: C#
Backend:Msacces s
i am doing project on loan, i have to insert the customer values to the database, its showing errors in cmd.executenonq uery,
public partial class _Default : System.Web.UI.P age
{
OleDbConnection con;
OleDbCommand cmd;
protected void Page_Load(objec t sender, EventArgs e)
{
con=new OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;user id= Admin ; password=; Data Source=D:\\Webl oanmonitor\\loa n.mdb");
}
protected void Button1_Click(o bject sender, EventArgs e)
{
int i;
string str;
str = "insert into LoanApplication values('" +txtfullname+ "','" +txtfather+ "','" +txtdob+ "','" +txtage+ "','" +RadioButtonLis t1+ "','" +txteducation+ "','" +ddlistmartial+ "','" + txtmobile + "','" +txtphone+ "','" +txtemail+ "','" +txtresidential + "','" +txtpermanent+ "')";
cmd = new OleDbCommand(st r,con);
try
{
con.Open();
i = cmd.ExecuteNonQ uery();
con.Close();
if (i > 0)
{
Response.Redire ct("EmploymentD etails.aspx");
}
}
catch (Exception ex)
{
Response.Write( "error" + ex);
}
}
}
this is my code , please help me;
i also tried this
insert into LoanApplication (fullname,fathe r,dob.......)Va lues('"+txtfull name+'",....... ....)
Code: C#
Backend:Msacces s
i am doing project on loan, i have to insert the customer values to the database, its showing errors in cmd.executenonq uery,
public partial class _Default : System.Web.UI.P age
{
OleDbConnection con;
OleDbCommand cmd;
protected void Page_Load(objec t sender, EventArgs e)
{
con=new OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;user id= Admin ; password=; Data Source=D:\\Webl oanmonitor\\loa n.mdb");
}
protected void Button1_Click(o bject sender, EventArgs e)
{
int i;
string str;
str = "insert into LoanApplication values('" +txtfullname+ "','" +txtfather+ "','" +txtdob+ "','" +txtage+ "','" +RadioButtonLis t1+ "','" +txteducation+ "','" +ddlistmartial+ "','" + txtmobile + "','" +txtphone+ "','" +txtemail+ "','" +txtresidential + "','" +txtpermanent+ "')";
cmd = new OleDbCommand(st r,con);
try
{
con.Open();
i = cmd.ExecuteNonQ uery();
con.Close();
if (i > 0)
{
Response.Redire ct("EmploymentD etails.aspx");
}
}
catch (Exception ex)
{
Response.Write( "error" + ex);
}
}
}
this is my code , please help me;
i also tried this
insert into LoanApplication (fullname,fathe r,dob.......)Va lues('"+txtfull name+'",....... ....)
Comment