hello everybody. i made a table in sql server
Create table tblEmployee
(
companyID int references tblCountry,
employeeID int,
firstName varchar(50),
middleName varchar(50),
lastName varchar(50),
homePhone varchar(50),
mobilePhone varchar(50),
emailAddress varchar(50),
categoryID int references tblCategory,
departmentID int references tblDepartment,
designationID int references tblDesignation,
workAddress1 varchar(100),
workAddress2 varchar(100),
workCountryID int references tblCountry,
workStateID int references tblState,
workCityID int references tblCity,
workPinCode varchar(25),
homeAddress1 varchar(100),
homeAddress2 varchar(100),
homeCountryID int references tblCountry,
homeStateID int references tblState,
homeCityID int references tblCity,
homePinCode varchar(25),
gender varchar(10),
dob datetime,
maritalStatus varchar(20),
spouseName varchar(100),
noOfChildren int,
guardianName varchar(100),
remark varchar(1000),
doj datetime,
workingStatus varchar(25),
dol datetime,
reasonToResigned varchar(500),
pfStatus varchar(1),
pfNumber varchar(25),
pfExtra int,
esiStatus varchar(1),
medicalStatus varchar(1),
ltaStatus varchar(1),
gratuityStatus varchar(1),
bonusStatus varchar(1),
bankID int references tblBank,
bankAccountNo varchar(25)
)
and an insert procedure is
alter proc sp_insertEmployee(
@companyID int,
@employeeID int,
@firstName varchar(50),
@middleName varchar(50),
@lastName varchar(50),
@homePhone varchar(50),
@mobilePhone varchar(50),
@emailAddress varchar(50),
@categoryID int,
@departmentID int,
@designationID int,
@workAddress1 varchar(100),
@workAddress2 varchar(100),
@workCountryID int,
@workStateID int,
@workCityID int,
@workPinCode varchar(25),
@homeAddress1 varchar(100),
@homeAddress2 varchar(100),
@homeCountryID int,
@homeStateID int,
@homeCityID int,
@homePinCode varchar(25),
@gender varchar(10),
@dob datetime,
@maritalStatus varchar(20),
@spouseName varchar(100),
@noOfChildren int,
@guardianName varchar(100),
@remark varchar(1000),
@doj datetime,
@workingStatus varchar(25),
@dol datetime,
@reasonToResigned varchar(500),
@pfStatus varchar(1),
@pfNumber varchar(25),
@pfExtra int,
@esiStatus varchar(1),
@medicalStatus varchar(1),
@ltaStatus varchar(1),
@gratuityStatus varchar(1),
@bonusStatus varchar(1),
@bankID int,
@bankAccountNo varchar(25)
)
as
insert tblEmployee values(
@companyID,@employeeID,@firstName,@middleName,@lastName,@homePhone,@mobilePhone,
@emailAddress,@categoryID,@departmentID,@designationID,@workAddress1,@workAddress2,
@workCountryID,@workStateID,@workCityID,@workPinCode,@homeAddress1,@homeAddress2,
@homeCountryID,@homeStateID,@homeCityID,@homePinCode,@gender,@dob,@maritalStatus,
@spouseName,@noOfChildren,@guardianName,@remark,@doj,@workingStatus,@dol,@reasonToResigned,
@pfStatus,@pfNumber,@pfExtra,@esiStatus,@medicalStatus,@ltaStatus,@gratuityStatus,
@bonusStatus,@bankID,@bankAccountNo
)
i made a masked textboxs in visual c sharp and when i am adding from c sharp i created problem with date conversion. my c sharp code is
paramArr[24] = new SqlParameter("@dob", Convert.ToDateTime(mskDOB.Text).ToShortDateString());
Please tell me where i am wrong with mskDOB.text.