Microsoft Office Tutorials and References
In Depth Information
{
conn.Open();
using (SqlCommand cmd = new SqlCommand("uspSetEmployeesValueById", conn))
{
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add("@BusinessEntityID", System.Data.SqlDbType.Int).Value = parameter;
cmd.Parameters.Add("@NationalIDNumber", System.Data.SqlDbType.NVarChar).Value =
entity1.NationalIDNumber;
cmd.Parameters.Add("@LoginID", System.Data.SqlDbType.NVarChar).Value = entity1.LoginID;
cmd.Parameters.Add("@JobTitle", System.Data.SqlDbType.NVarChar).Value = entity1.JobTitle;
cmd.Parameters.Add("@BirthDate", System.Data.SqlDbType.DateTime).Value = entity1.BirthDate;
cmd.Parameters.Add("@MaritalStatus", System.Data.SqlDbType.NChar).Value =
entity1.MaritalStatus;
cmd.Parameters.Add("@Gender", System.Data.SqlDbType.NChar).Value = entity1.Gender;
cmd.Parameters.Add("@HireDate", System.Data.SqlDbType.DateTime).Value = entity1.HireDate;
cmd.Parameters.Add("@SalariedFlag", System.Data.SqlDbType.Bit).Value =
entity1.SalariedFlag;
cmd.Parameters.Add("@VacationHours", System.Data.SqlDbType.SmallInt).Value =
entity1.VacationHours;
cmd.Parameters.Add("@SickLeaveHours", System.Data.SqlDbType.SmallInt).Value =
entity1.SickLeaveHours;
cmd.Parameters.Add("@CurrentFlag", System.Data.SqlDbType.Bit).Value = entity1.CurrentFlag;
cmd.Parameters.Add("@ModifiedDate", System.Data.SqlDbType.DateTime).Value =
entity1.ModifiedDate;
ret = cmd.ExecuteNonQuery();
}
}
your solution explorer should look like what’s shown in Figure 4-27 .
Figure 4-27. The .NET Connector Assembly in Solution Explorer
21.
Finally, ensure that all classes and projects have the same namespace defined.
if the namespace or assembly name is incorrect, you’ll run into errors.
 
Search JabSto ::




Custom Search