Hi, i Write in two table (HelpDesk nad HelpDesk2) + use Stored Procedure(InsertHelpDesk and InsertHelpDesk2)
In first table (HelpDesk) don't insert record. Why?
in second (HelpDesk2) all ok. All record insert.
//--------Write to firs table, HelpDesk
SqlConnection conn;
SqlCommand comm;
string connectionString = ConfigurationManager.ConnectionStrings[
"Dorknozzle"].ConnectionString;
// Initialize connection
conn = new SqlConnection(connectionString);
// Create command
comm = new SqlCommand("InsertHelpDesk", conn);
// Specify we're calling a stored procedure
comm.CommandType = System.Data.CommandType.StoredProcedure;
// Add command parameters
comm.Parameters.Add("@EmployeeID", System.Data.SqlDbType.Int);
comm.Parameters["@EmployeeID"].Value = 99999990;
comm.Parameters.Add("@StationNumber", System.Data.SqlDbType.Int);
comm.Parameters["@StationNumber"].Value = "9999990";
comm.Parameters.Add("@CategoryID", System.Data.SqlDbType.Int);
comm.Parameters["@CategoryID"].Value = "99999990";
comm.Parameters.Add("@Description", System.Data.SqlDbType.Int);
comm.Parameters["@Description"].Value = "9999999990";
//--------Write to second table, HelpDesk2
comm = new SqlCommand("InsertHelpDesk2", conn);
// Specify we're calling a stored procedure
comm.CommandType = System.Data.CommandType.StoredProcedure;
// Add command parameters
comm.Parameters.Add("@StatusID", System.Data.SqlDbType.Int);
comm.Parameters["@StatusID"].Value = 999990;
comm.Parameters.Add("@SubjectID", System.Data.SqlDbType.Int);
comm.Parameters["@SubjectID"].Value = "99999990";
..........