C# 数据插入到数据库中

2024-12-19 17:46:20
推荐回答(3个)
回答1:

insert into [Task] (TaskName, BeginDate, ExpectEndTime, EndTime, TaskStatus, Category, idkey) values ('" + taskname + "','" + begintime + "','" + expectdate + "','" + endtime + "','" + taskstate + "','" + Category + "'," + idkey + ")"; 只要是你数据库里面是字符串类型的都要加是单引号:'字符串'!

回答2:

把字符串和日期的两边加上单引号试试

回答3:

varchar类型忘记打单引号了