I an adding data into an access table via c# and have run into a roadblock. The syntax is
The problem relates to the last item, chatmessage.Bod y, which can contain anything a person can type, including single and double quotes. So how do I get the contents of that variable inserted into an access table?
Code:
addSQL = "INSERT INTO history ([id], [partner], [from], [msgdate], [msgtime], [message]) VALUES ('" + thisid + "','" + chat.DialogPartner + "','" + chatmessage.FromHandle + "','" + chatmessage.Timestamp.Date + "','" + chatmessage.Timestamp.TimeOfDay + "','" + chatmessage.Body + "')";
Comment