[Solved] How to insert a string into an sql server table via a windows form? [closed]
[ad_1] AddTof1(string s) { using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); using (SqlCommand command = new SqlCommand(“INSERT INTO table1 values(@s)”, connection)) { command.Parameters.AddWithValue(“@s”, s); command.ExecuteNonQuery(); } } } Then you can call this method as; AddTof1(“hello there”); 4 [ad_2] solved How to insert a string into an sql server table via a windows form? … Read more