Note that there are some explanatory texts on larger screens.

plurals
  1. POwindows service exception in .NET
    text
    copied!<p>I will be tested the application as windows application then it will be stored the datetime in MySQL data base.When I will be start this application using windows service it will be thrown this exception.</p> <pre> error [HY000][MySQL][ODBC 3.51 Driver] [MySqlid -6.0.11-alpha-community]incorrect datetime value " 5/6/2011 9:00:00 AM" for column column-name at row1 </pre> <p>Windows application take the system format &amp; my system format is yyyy-MM-dd hh:mm:ss in windows service which format is used.</p> <pre> query18 += "select '" + obj8 + "' as DTvalue ,'" + date8 + "' as DTdatelogged1 ,'" + OpcGroup.QualityToString(e8.sts[counter8].Quality) + "' as DTquality ,'" + DateTime.FromFileTime(e8.sts[counter8].TimeStamp) + "' as DTtimestamp ,'" + e8.sts[counter8].HandleClient + "' as DTparamID Union " + Environment.NewLine; UpdateQuery = Update parameter t Left join + Environment.NewLine; UpdateQuery8 += ( + query18 + ) Temp on" + Environment.NewLine; UpdateQuery8 += t.itemID=Temp.DTparamID+ Environment.NewLine; UpdateQuery8 += set paramvalue=DTvalue, date_logged1=DTdatelogged1,Quality= DTquality,date_logged=DTtimestamp + Environment.NewLine; UpdateQuery8 += where t.groupID=9 and t.itemID=Temp.DTparamID; </pre> <p>my query likethis timestamp value is 129500892576718750 it will be convert DateTime.FromFileTime() function converted value like '2011-05-17 12:30:57' in windows application it will be write into mysql database but in windows service converted value like 2011/05/17 12:30:57 PM it will be not accepted by the MYSQL database same thing i will be used in the windows service </p> <p>now </p> <pre> UpdateQuery8 = "Update parameter " + Environment.NewLine; UpdateQuery8 += "set paramvalue=@paramvalue,date_logged1=@date_logged1,Quality=@Quality,date_logged=@date_logged" + Environment.NewLine; UpdateQuery8 += "where groupID=9 and itemID=@itemID"; cmd8 = new OdbcCommand(UpdateQuery8, con136); cmd8.Parameters.Add("@paramvalue", obj8.ToString()); cmd8.Parameters.Add("@date_logged1", date8); cmd8.Parameters.Add("@Quality", OpcGroup.QualityToString(e8.sts[counter8].Quality)); cmd8.Parameters.Add("@date_logged", dt); cmd8.Parameters.Add("@itemID",e8.sts[counter8].HandleClient); cmd8.ExecuteNonQuery(); </pre> <p>it will be execute but there no updation in database</p> <p>Please help me in this regard.</p> <p>Thanks in Advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload