Id と Name の 2 つのフィールドを持つデータベースとテーブルを作成しました。ここで、サンプルコードが与えられたボタンをクリックして値を挿入したいと思います。動いていない。
using (SqlConnection connection = new SqlConnection(strConnection))
{
SqlCommand command =new SqlCommand("insert into Test (Id,Name) values(5,kk);",connection);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}