joules
joules
CC#
Created by joules on 10/15/2023 in #help
❔ Is this enough to clean a database entry?
i see
13 replies
CC#
Created by joules on 10/15/2023 in #help
❔ Is this enough to clean a database entry?
it's not cute
public static bool UpdateGuildStringField(ulong serverId, string fieldToUpdate, string newValue)
{
var sqliteCommand = ServerDataConnection.CreateCommand();
try
{
sqliteCommand.CommandText =
@$"UPDATE servers
SET {fieldToUpdate} = '{newValue}'
WHERE id is '{serverId}'";
sqliteCommand.ExecuteNonQuery();
return true;
}
catch
{
return false;
}
}
public static bool UpdateGuildStringField(ulong serverId, string fieldToUpdate, string newValue)
{
var sqliteCommand = ServerDataConnection.CreateCommand();
try
{
sqliteCommand.CommandText =
@$"UPDATE servers
SET {fieldToUpdate} = '{newValue}'
WHERE id is '{serverId}'";
sqliteCommand.ExecuteNonQuery();
return true;
}
catch
{
return false;
}
}
13 replies
CC#
Created by joules on 10/15/2023 in #help
❔ Is this enough to clean a database entry?
it's a text-based command through Microsoft.Data.Sqlite
13 replies