What I believe is the olderest, marked as 'AdvertsingProfitControl Alpha' by the folder. Only had a simple 'Add Records' form, quite incomplete.

This commit is contained in:
2021-01-28 19:53:08 -06:00
commit 58501fec36
27 changed files with 14033 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using System.Windows.Forms;
namespace AdvertsingProfitControl
{
class AddRecord
{
private static string gConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=apcDatabase.accdb;Persist Security Info=False";
public AddRecord()
{
//Get database location from DBLocation class
}
public int ExecuteQuery(string query)
{
int rowsAffected = -1;
using (OleDbConnection conn = new OleDbConnection(gConnectionString))
{
try
{
OleDbCommand queryCommand = new OleDbCommand(query, conn);
conn.Open();
rowsAffected = queryCommand.ExecuteNonQuery();
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Error Writing to Database");
}
}
return rowsAffected;
}
}
}