minor adjustments to backend
This commit is contained in:
+6
-7
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user