In SQL Server Management Studio, the query that I created is
CREATE TABLE MyTable
(
EmployeeID int,
EmployeeDivision varchar(25),
EmployeeFName varchar(25),
EmployeeLName varchar(25),
EmployeeBudget1 int,
EmployeeBudget2 int,
EmployeeBudget3 int,
EmployeeBudget4 int,
EmployeeBudget5 int,
EmployeeBudget6 int,
EmployeeBudget7 int,
EmployeeBudget8 int,
EmployeeBudget9 int,
EmployeeBudget10 int,
EmployeeBudget11 int,
EmployeeBudget12 int,
EmployeeBudget13 int,
EmployeeBudget14 int,
EmployeeBudget15 int
);
INSERT INTO MyTable ('12345','DIVISION','FIRST','LAST','' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' );
My question is, how do I write this in C#?
I only created 4 set of textbox that will get that value of ID, Division, First Name, Last Name of each employee, and the rest will be null for Budgets 1-15
Here's my code:
SqlCommand cmd = new SqlCommand("insert into BUDGETTING_A values (' " + txtBoxEmpID.Text + "', + '" + cmbBoxDivision.Text + "','" + txtBoxFamilyName.Text + "', '" + txtBoxFirstName.Text + ' " + '','','','','','','','','','','','','','','"')"+, con);
I am having trouble in terms of doing this, any instructions in writing these off?