我有这个代码
public void insertAssignment(long mediaEvent_ID, long mediaBranch_ID,
int? isPremiere, int? isNew, int? isLastChance,
int? isPrevShown, int season_ID, int? audio_ID,
int? video_ID, DateTime startdate)
{
query = "insert into Assignment Values(" + mediaEvent_ID+ ","
+ mediaBranch_ID + "," + isPremiere + "," + isNew + ","
+ isLastChance + "," + isPrevShown
+ "," + season_ID + "," + audio_ID + "," + video_ID + ",'" +
startdate.ToString("MM/dd/yyyy") + ")"; }
如果任何属性为空,我在插入时遇到问题,比如isPremiere=null
问题是insert {values(mediaEvent,mediaBranch,(is empty not contains a values ),......)}
我该如何解决这个问题?