![]() |
C# Dize geçerli bir DateTime olarak tanınmadı. |
Post Reply ![]() |
|
Author | |
t1g3r ![]() Newbie ![]() Joined: 25 Temmuz 2018 Location: mersin Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() Posted: 25 Temmuz 2018 at 17:39 |
Merhaba benim amacım Mysqlimde bulunan tarihi istediğim tarihle değiştirmek
"MySqlCommandkmt12=newMySqlCommand("updateoc_customer(email,tarih)'"+textBox1.Text+"'where@simdi",bag);
kmt12.Parameters.AddWithValue("@simdi",DateTime.ParseExact(dateTimePicker3.Text,"yyyy:MM:ddHH:mm:ss",System.Globalization.CultureInfo.InvariantCulture)); kmt12.ExecuteNonQuery(); bag.Close();" "kmt12.Parameters.AddWithValue ("@ simdi", DateTime.ParseExact (dateTimePicker3.Text, "yyyy: dd: dd HH: dd: ss", System.Globalization.CultureInfo.InvariantCulture));" Satırında durup verdiği hata bu:Dize geçerli bir DateTime olarak tanınmadı.Diğer zaman biçimlerinide denedim olmadı acaba kodda bir hata olabilirmi dedim. Şimdiden yardımınız için teşekkür ederim. |
|
Azim başarının ta kendisdir.
|
|
![]() |
|
emrahbaba ![]() Senior Member ![]() Joined: 09 Mayıs 2008 Status: Offline Points: 400 |
![]() ![]() ![]() ![]() ![]() |
dateTimePicker zaten tarihi sana verir. Ayrıca parse etmene gerek yok.
kmt12.Parameters.AddWithValue("@simdi", dateTimePicker3.Value);
|
|
Emrah BABAYİĞİT
|
|
![]() |
|
t1g3r ![]() Newbie ![]() Joined: 25 Temmuz 2018 Location: mersin Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
Hocam sağolun bu sorun halloldu ama bu seferde şöyle bi hata çıkıverdi
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(email, tarih) 'xxxxxxxxxxxxxx' where '2020-01-01 01:00:00 '' at line 1" bağlanıp sorgu satırında hata veriyor "kmt12.ExecuteNonQuery();" ama ben bu baglantıyı diğer formumda başka bir iş için aynı mysqlde kullandım Şimdiden teşekkürler
![]() Edited by t1g3r - 26 Temmuz 2018 at 15:26 |
|
Azim başarının ta kendisdir.
|
|
![]() |
|
t1g3r ![]() Newbie ![]() Joined: 25 Temmuz 2018 Location: mersin Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
Hatamı gördüm. Yardımınız için tekrar teşekkür ederim
![]() |
|
Azim başarının ta kendisdir.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |