我有具有相同属性的Employee和CT Employee SQL表 我想如果我在CT EMPLOYEE表中添加一个值,那么该值将添加EMPLOYEE表 我该怎么办?
class Program
{
static void Main(string[] args)
{
SqlConnection connect = new SqlConnection();
connect.ConnectionString = "Data Source = .; Initial Catalog = DigitalizationDeneme; Integrated Security = true";
SqlCommand con = new SqlCommand("UPDATE",connect);
connect.Open();
Console.WriteLine($"Connection State : {connect.State}");
var saveNumber = con.ExecuteNonQuery();
Console.WriteLine(saveNumber);
Console.ReadLine();
}
}
}
Employee.cs
class Employee
{
public int EmployeeID { get; set; }
public string Email { get; set; }
public string Gid { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string CostCenter { get; set; }
public DateTime StartDate { get; set; }
public DateTime LeaveDate { get; set; }
public string ContractType { get; set; }
public double WeeklyWorkingHour { get; set; }
public int MenagerID { get; set; }
public string scdDept { get; set; }
public string SapCompanyCode { get; set; }
public string status { get; set; }
public DateTime LastUpdatedTime { get; set; }
}
}
ctemployee cs
class ctEmployee
{
public int EmployeeID { get; set; }
public string Email { get; set; }
public string Gid { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string CostCenter { get; set; }
public DateTime StartDate { get; set; }
public DateTime LeaveDate { get; set; }
public string ContractType { get; set; }
public double WeeklyWorkingHour { get; set; }
public int MenagerID { get; set; }
public string scdDept { get; set; }
public string SapCompanyCode { get; set; }
public string status { get; set; }
public DateTime LastUpdatedTime { get; set; }
}
}
我希望是否在员工表中看到的相同值的数据库中添加值CTEMPLOYEE 请帮助我,我需要快速的帮助。