1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-13 16:48:27 -05:00

fixed issue with database command not having connection set, combined methods into Validate command

This commit is contained in:
RaidMax
2017-05-30 16:23:31 -05:00
parent 200c4d79fd
commit 354cec0951
14 changed files with 181 additions and 149 deletions

View File

@ -141,8 +141,10 @@ namespace SharedLibrary
{
CommandText = String.Format("SELECT * FROM {0} WHERE `{1}`=@{1};", tableName, where.Key)
};
updatecmd.Parameters.AddWithValue('@' + where.Key, where.Value);
var Con = GetNewConnection();
updatecmd.Parameters.AddWithValue('@' + where.Key, where.Value);
updatecmd.Connection = Con;
try
{
@ -166,6 +168,7 @@ namespace SharedLibrary
{
DataTable dt = new DataTable();
var Con = GetNewConnection();
cmd.Connection = Con;
try
{
Con.Open();
@ -178,7 +181,7 @@ namespace SharedLibrary
catch (Exception e)
{
//LOGME
Console.Write($"Line 181: {e.Message}");
Console.WriteLine($"Line 181: {e.Message}");
}
return dt;