[英]Data insert into SQL Server from C#
I'm attempting to insert some data into Microsoft SQL Server, all the data inserted until it gets to the final table scmd3
.我正在尝试将一些数据插入 Microsoft SQL Server,插入所有数据,直到它到达最终表
scmd3
。 Any ideas as to why its not inserting into that table?关于为什么不插入该表的任何想法?
Here is my code I have so far... I've tried everything I can think of any help would be appreciated... thanks in advance guys.这是我到目前为止的代码......我已经尝试了所有我能想到的任何帮助将不胜感激......提前感谢大家。
Solution: The error wasn't within the insert service code it was in the I service... Just simply adding a question mark solved all my problems.解决方案:错误不在插入服务代码中,而是在 I 服务中...只需添加一个问号即可解决我所有的问题。 Added the question mark after int, also added the if statement and now everything works beautifully!!!!
在 int 之后添加了问号,还添加了 if 语句,现在一切正常!!!! Posting the answer because if somenoe had posted anything remotely close it would have saved me a days worth of work looking for a single solution... THANKS for all of you that helped.
发布答案是因为如果有人远程发布了任何关闭的东西,它会为我节省一天寻找单一解决方案的工作......感谢你们所有人的帮助。
[DataMember]
public string EmailAddress { get; set; }
[DataMember]
public int? InitialSleep { get; set; }
[DataMember]
public int? RepeatPeriod { get; set; }
[DataMember]
public int? RepeatTimes { get; set; }
[DataMember]
public DateTime? LastSent { get; set; }
[DataMember]
public int TimeSent { get; set; }
[DataMember]
public DateTime DateStarted { get; set; }
[DataMember]
public DateTime LastModified { get; set; }
if statement:如果语句:
if (textBox1.Text == "")
userInfo.InitialSleep = null;
else
userInfo.InitialSleep = Convert.ToInt32(textBox1.Text);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.