我的数据库中有一个名为 Points 的列,其中包含数字和 id,希望将此列中的所有记录设置为零。我将如何做到这一点?
这是 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();
}