Hey, I have been having a few problems inserting dates and times into my apps database submitted by the user:
The following lines are ok:
SQL1.ExecNonQuery("CREATE TABLE Event (Date INTEGER, Time1 INTEGER, Time2 INTEGER, Name TEXT, Desc TEXT)")
SQL1.ExecNonQuery("INSERT INTO Event VALUES(" & DateTime.DateParse("2015/01/01") & "," & DateTime.TimeParse("16:00") & " , " & DateTime.TimeParse("18:00") & " , 'Family' , 'sample description one')")
ListView1.AddSingleLine(DateTime.Date(Curs.GetLong("Date")))
ListView2.AddSingleLine(DateTime.Time(Curs.GetLong("Time1")))
However as soon as I get to this part of my program:
sumstring1 = EditText1.Text
sumstring2 = EditText2.Text
sumstring3 = EditText5.Text
sumstring4 = EditText6.Text
SQL1.ExecNonQuery("INSERT INTO Event VALUES(" & DateTime.DateParse(tempo1) & "," & DateTime.TimeParse(sumstring1) & " , " & DateTime.TimeParse(sumstring2) & " , " & sumstring3 & " , " & sumstring4 & ")")
I keep getting an error. I know the values are correct because I put the sumstring's in a label to view the input and the values appear correct. What am I doing wrong?
The following lines are ok:
SQL1.ExecNonQuery("CREATE TABLE Event (Date INTEGER, Time1 INTEGER, Time2 INTEGER, Name TEXT, Desc TEXT)")
SQL1.ExecNonQuery("INSERT INTO Event VALUES(" & DateTime.DateParse("2015/01/01") & "," & DateTime.TimeParse("16:00") & " , " & DateTime.TimeParse("18:00") & " , 'Family' , 'sample description one')")
ListView1.AddSingleLine(DateTime.Date(Curs.GetLong("Date")))
ListView2.AddSingleLine(DateTime.Time(Curs.GetLong("Time1")))
However as soon as I get to this part of my program:
sumstring1 = EditText1.Text
sumstring2 = EditText2.Text
sumstring3 = EditText5.Text
sumstring4 = EditText6.Text
SQL1.ExecNonQuery("INSERT INTO Event VALUES(" & DateTime.DateParse(tempo1) & "," & DateTime.TimeParse(sumstring1) & " , " & DateTime.TimeParse(sumstring2) & " , " & sumstring3 & " , " & sumstring4 & ")")
I keep getting an error. I know the values are correct because I put the sumstring's in a label to view the input and the values appear correct. What am I doing wrong?