// Insert Connection string oConn = new SqlConnection("server=localhost;uid=xxx;pwd=yyy;database=zzz"); // Create SQL INSERT statement String SQL_Insert = "INSERT INTO faq(CategoryID, Question, Answer, Keywords, RequestedBy, AnsweredBy, DatePosted, DateAnswered) VALUES(" + category.Value + ", '" + q + "', '" + a + "', '" + k + "', '" + auth + "', '" + auth + "', '" + date + "', '" + date + "')"; // Create a command to execute when the connection is open cmd = new SqlCommand(SQL_Insert, oConn); // Open Connection to DB, Execute Query, Close connection cmd.Connection.Open(); cmd.ExecuteNonQuery(); cmd.Connection.Close();