Hello I have an html registration form, I opened it with html and checked the data with javascript now I want to insert my data to access database and I don't know how to do it because it's making me problems...
I tried to write this aspx.cs :
public void Register_Click(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Vort3eX\Desktop\RegisterDataBase.mdb;Persist Security Info=True");
con.Open();
OleDbCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into DataBase value('"+fname.Text+
cmd.ExecuteNonQuery();
con.Close();
}
And I got this error :
"The Name 'fname' does not exist the currect context"
My Html Code for my input
<tr>
<td class="style4">
Name
</td>
<td class="style3">
<input type="text"name="fname" id="fname" placeholder = "Name" />
</td
</tr>
Please help me to fix it I want to input data in my data access table...