0

私のデータベースには、この列のすべてのレコードをゼロに設定するような数字と ID を持つ Points という列があります。どうすればこれを達成できますか?

これがivがこれまでに行ったことです。

public static void clearPoints()
    {
         OleDbConnection myConnection = GetConnection();
         int count = 0;
        string myQuery1 = "Update AnswerTable  SET Points= " + count+ "'";
        OleDbCommand myCommand = new OleDbCommand(myQuery1, myConnection);

        try
        {
            myConnection.Open();
            myCommand.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Exception in DBHandler", ex);
        }
        finally
        {
            myConnection.Close();
        }
4

1 に答える 1

1

クエリ文字列を次のように調整します

string myQuery1 = "Update AnswerTable SET Points=0";
于 2013-12-07T13:29:35.523 に答える