Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
- Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- using MySql.Data;
- using MySql.Data.MySqlClient;
- using Google.Protobuf;
- namespace SML
- {
- public class LootManager
- {
- public static MySqlConnection Conn;
- public static string ConnString;
- public static void AddPart(string[] partData)
- {
- using(MySqlConnection conn = new MySqlConnection())
- {
- Conn.ConnectionString = ConnString;
- Conn.Open();
- using(MySqlCommand command = new MySqlCommand())
- {
- command.Connection = conn;
- string cmd = "INSERT INTO SMLoot(";
- for(int i = 0; i < 30; i++)
- {
- cmd += ((LootFilter.Filters)i).ToString() + ", ";
- }
- cmd += ") VALUES (";
- for(int i = 0; i < 30; i++)
- {
- cmd += "@" + ((LootFilter.Filters)i).ToString() + ", ";
- }
- cmd += ")";
- for(int i = 0; i < 30; i++)
- {
- command.Parameters.AddWithValue("@" + ((LootFilter.Filters)i).ToString() + ", ", partData[i]);
- }
- command.ExecuteNonQuery();
- conn.Close();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement