minor adjustments to backend

This commit is contained in:
QkoSad
2024-11-25 07:49:45 +02:00
parent 4496672d19
commit 06ea52ead6
26 changed files with 459 additions and 229 deletions
+6 -7
View File
@@ -1,11 +1,9 @@
using System;
using System.Net;
using System.Text;
using MySql.Data.MySqlClient;
namespace Server
{
public class Reset
{
public static void run(MySqlConnection conn, HttpListenerRequest request, HttpListenerResponse response)
@@ -15,11 +13,12 @@ namespace Server
// Open the connection
conn.Open();
// Prepare the SQL query
MySqlCommand myCommand = new MySqlCommand();
myCommand.Connection = conn;
myCommand.CommandText = "CALL InitDB";
MySqlDataReader reader = myCommand.ExecuteReader();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "CALL InitDB";
// execute query
cmd.ExecuteNonQuery();
// set up and send response
response.StatusCode = (int)HttpStatusCode.OK;
response.StatusDescription = "Status OK";
}