using System.Data.SqlClient;
using WelderConsoleApp.Interfaces;
namespace WelderConsoleApp.ExternalDependencies
{
public class DatabaseManipulations : IDatabaseManipulations
{
public void UpdateGetWelderData(string connectionString)
{
using (SqlConnection sqlConnection = new SqlConnection(connectionString))
{
using (SqlCommand sqlCommand = sqlConnection.CreateCommand())
{
sqlCommand.CommandText = "UPDATE Employee SET WelderStencil =
@value WHERE HRRef = @key";
sqlCommand.Parameters.AddWithValue("@key", "215527");
sqlCommand.Parameters.AddWithValue("@value", "yay");
sqlConnection.Open();
sqlCommand.ExecuteNonQuery();
sqlConnection.Close();
}
}
}
}
}
Thursday, September 14, 2017
generic, hacky, let's-update-the-database thing in C#
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment