这是我将insert数据插入数据库的插入语句。这是我的问题:
INSERT INTO JobsDB (Job_Name, Job_Desc, Job_Categ, Job_Qualif, Job_PayType, Job_Payrate, Job_PloyerName, Job_StartDate, Job_EndDate, Job_Status) VALUES ('" + tbName.Text + "' , '" + tbDescription.Text + "' , '" + ddCategory.Text + "' , '" + ddQualifications.Text + "' , '" + ddPayType.Text + "' , '" + tbRate.Text + "' , 'Kaslana' , '" + calendarStart.SelectedDate + "' , '" + calendarEnd.SelectedDate + "' , 'Active')
错误发生在代码从日历控件中获取所选日期的位置,并尝试将其插入数据库。
答案 0 :(得分:0)
使用Convert.ToDateTime(YourSelectedDate)
{{1}}