我正在使用Windows任务调度程序的基本控制台应用程序.
该程序从网络中获取一些十进制值并保存在SQL Server表中.
当我手动运行程序时,十进制格式没有问题.
如果任务调度程序运行程序,它将读取它们(我在这里猜测)为int.
例:
我尝试将其转换为字符串,用"."替换",".
decimal valueKur = 0;
valueKur = Convert.ToDecimal(xmlDoc.SelectSingleNode(string.Format("Tarih_Date/Currency[@Kod='{0}']/BanknoteSelling", item)).InnerXml);
mevcutKur.KurValue = valueKur;
db.SaveChanges();
Run Code Online (Sandbox Code Playgroud)
提前致谢