I'm having an issue inserting a row into my access db. I keep getting a "Data type mismatch in criteria expression". I've tried tons of different formatted queries and can't seem to figure out where I'm going wrong.
public void addUserToDB(string username) { string updateStr = "Insert Into Users ([Username], [Currency], [Joined], [Online], [Notes]) " + "Values ( ?, '0', ?, 'Yes', '')"; OleDbCommand update = new OleDbCommand(updateStr, con); update.Parameters.Add("", OleDbType.VarChar).Value = username; update.Parameters.AddWithValue("","'#" + DateTime.Now.ToString("G") + "#'"); update.Parameters.AddWithValue("","'#" + DateTime.Now.ToString("G") + "#'"); execute(update); } It's not my connection string or anything else since all my other queries work just fine. It has to be something in here. I'm assuming is may have something to due with the date time.
Access DB:
Username: ShortText
Currency: Number
Joined: Date/Time in "General Date" Format
Online: Yes/No
Notes: ShortText