-2
projeservices.update("UPDATE ProjeEkle SET  Yuklenici='" + txtyuklenicig.Text
    + "',İhaleBedeli='" + Convert.ToDecimal(ntxtihalebedelig.Text.Replace(",", ".")) 
    + "',İhaleTarihi='" + Convert.ToDateTime(dtpihaletarihig.Text) 
    + "',SozlesmeTarihi='" + Convert.ToDateTime(dtpsozlesmetarihig.Text) 
    + "',İsinSuresi='" + ntxtisinsuresig.Text 
    + "',TeslimTarihi='" + Convert.ToDateTime(dtptxtteslimg.Text) 
    + "',BaslamaTarihi=,'" + Convert.ToDateTime(dtptxtbaslamag.Text) 
    + "',BitisTarihi='" + Convert.ToDateTime(dtptxtbitisg.Text) 
    + "' WHERE İsinAdi='" + txtisinadig.Text + "'");

Where's my fault?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Umut çelik
  • 1
  • 1
  • 6
  • You'd find it a lot easier to read if you used String.Format .. what are the values of each of your text boxes? youve certainly sent text to the decimal field what if I typed "frog" in there? you're sending all as text.... – BugFinder Apr 05 '16 at 07:24
  • This is the least you can expect from the string concatenation (format or not) USE PARAMETERS – Steve Apr 05 '16 at 07:25
  • What date format you are passing for datetime fields? – Ravi Apr 05 '16 at 07:29
  • I added up image my form face – Umut çelik Apr 05 '16 at 07:33

3 Answers3

0

If ntxtihalebedeli.Text like 123,456 replace the ',' with '.'.

..."','" + ntxtihalebedeli.Text.Replace(",", ".") + "','"...

And perhaps replace this

"','" +ntxtisinsuresi.Text + "','"

with

"'," + ntxtisinsuresi.Text + ",'"
Wudge
  • 357
  • 1
  • 6
  • 14
0

can you try with this code?

projeservices = new HProje();
            projeservices.insert("INSERT INTO ProjeEkle(İsinAdi,Yuklenici,İhaleBedeli,İhaleTarihi,SozlesmeTarihi,İsinSuresi,TeslimTarihi,BaslamaTarihi,BitisTarihi)values('" + txtisinadi.Text + "','" + txtyuklenici.Text + "','" + ntxtihalebedeli.Text + "','" + dtpihaletarihi.Text + "'," + Convert.ToIn(dtpsozlesmetarihi.Text) + ",'" + ntxtisinsuresi.Text + "','" + dtptxtteslim.Text + "','" + dtptxtbaslama.Text + "','" + dtptxtbitis.Text + "')");
thor
  • 21,418
  • 31
  • 87
  • 173
Balu
  • 41
  • 1
0

The error suggest that the value passed to İsinSuresi or İhaleBedeli isnt considered numeric. this is most likley a problem in the decimal value if the intake decimal is using the wrong punctuation. if not, maybe looking for a solution in the conversion in This article can help

Community
  • 1
  • 1