Please help with C# Insert statement into mySQL

Hi, I have a getall statement which is used to fetch the selected tablename but am struggling with the insert statement so far i have

 public bool insertThis(Dictionary<string, string> values, string tableName) { //declares a new sql reader SqlDataReader reader; using (SqlConnection conn = new SqlConnection(ConnectionString)) { string query = "INSERT INTO " + tableName; //need vaules here using (SqlCommand command = new SqlCommand(query, conn)) { //opens connection conn.Open(); //uses the reader ........... reader = command.ExecuteReader(); } } //returns the reader return bool; } } } 

This is quite simmer to my getALL but i would appreacte some pointers on how i can adapt it for the insert please

by Oppsforgotpassword via /r/csharp

Leave a Reply