I'm having trouble with my code, I am getting a Invalid expression term ')'
not sure what I'm doing wrong. Here is my code.
protected void btnSubmit_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = '" + Server.MapPath("WSC_DB.mdb") + "'; Persist Security Info=False");
using (OleDbCommand cmd = new OleDbCommand("insert into Users(UserFirstName, UserLastName, ShipAddress, ShipCity, ShipState, UserPhone, UserEmail, UserName, UserPassword, LoginType) values (@FirstName, @LastName, @Address, @City, @State, @Zip, @Phone, @Email, @Username, @Password, @Logintype)", conn))
{
cmd.Parameters.AddWithValue("@FirstName", txtFirstName.Text);
cmd.Parameters.AddWithValue("@LastName", txtLastName.Text);
cmd.Parameters.AddWithValue("@Address", txtAddress.Text);
cmd.Parameters.AddWithValue("@City", txtCity.Text);
cmd.Parameters.AddWithValue("@State", DropDownList1.SelectedItem.ToString());
cmd.Parameters.AddWithValue("@Zip", txtZip.Text);
cmd.Parameters.AddWithValue("@Phone", txtPhone.Text);
cmd.Parameters.AddWithValue("@Email", txtEmail.Text);
cmd.Parameters.AddWithValue("@Username", txtUsername.Text);
cmd.Parameters.AddWithValue("@Password", txtPassword.Text);
cmd.Parameters.AddWithValue("@Logintype", "U");
conn.Open();
cmd.ExecuteNonQuery();
}
}