• 23-08-2020, 11:48:36
    #1
    C# otomasyonunda herşey sorunsuz çalışıyorken ekle butonuna tıklayınca hata veriyor ve programdan atıyor beni. Programı birdaha çalıştırında eklenmiş oluyor.SORUN İLETİSİ:
    System.Data.SqlClient.SqlException
    HResult=0x80131904
    İleti=Incorrect syntax near '47 S 0036'.
    Kaynak=.Net SqlClient Data Provider
    StackTrace:
    konum System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    konum System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    konum System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
    konum System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
    konum System.Data.SqlClient.SqlCommand.RunExecuteNonQuer yTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
    konum System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
    konum System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    konum RentaCar.arac_kiralama.ekle_sil_güncelle(SqlComman d komut, String sorgu) C:UsersABDULKADİRDesktopRentacarRentaCarRentaCarar ac kiralama.cs içinde: 21. satır
    konum RentaCar.frmSözleşme.btnEkle_Click_1(Object sender, EventArgs e) C:UsersABDULKADİRDesktopRentacarRentaCarRentaCarfr mSözleşme.cs içinde: 125. satır
    konum System.Windows.Forms.Control.OnClick(EventArgs e)
    konum System.Windows.Forms.Button.OnClick(EventArgs e)
    konum System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
    konum System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    konum System.Windows.Forms.Control.WndProc(Message& m)
    konum System.Windows.Forms.ButtonBase.WndProc(Message& m)
    konum System.Windows.Forms.Button.WndProc(Message& m)
    konum System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    konum System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    konum System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    konum System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
    konum System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    konum System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
    konum System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
    konum System.Windows.Forms.Application.RunDialog(Form form)
    konum System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
    konum System.Windows.Forms.Form.ShowDialog()
    konum RentaCar.RentaCar.button5_Click(Object sender, EventArgs e) C:UsersABDULKADİRDesktopRentacarRentaCarRentaCarRe ntaCar.cs içinde: 53. satır
    konum System.Windows.Forms.Control.OnClick(EventArgs e)
    konum System.Windows.Forms.Button.OnClick(EventArgs e)
    konum System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
    konum System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    konum System.Windows.Forms.Control.WndProc(Message& m)
    konum System.Windows.Forms.ButtonBase.WndProc(Message& m)
    konum System.Windows.Forms.Button.WndProc(Message& m)
    konum System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    konum System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    konum System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    konum System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
    konum System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    konum System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
    konum System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
    konum System.Windows.Forms.Application.Run(Form mainForm)
    konum RentaCar.Program.Main() C:UsersABDULKADİRDesktopRentacarRentaCarRentaCarPr ogram.cs içinde: 19. satır

    Bu özel durum özgün olarak bu çağrı yığınında oluşturuldu:
    [Dış Kod]
    RentaCar.arac_kiralama.ekle_sil_güncelle(System.Da ta.SqlClient.SqlCommand, string) / arac kiralama.cs
    RentaCar.frmSözleşme.btnEkle_Click_1(object, System.EventArgs) / frmSözleşme.cs
    [Dış Kod]
    RentaCar.RentaCar.button5_Click(object, System.EventArgs) / RentaCar.cs
    [Dış Kod]
    RentaCar.Program.Main() / Program.cs
  • 23-08-2020, 12:11:05
    #2
    plakayı 47AH036 şeklinde eklemeyi dener misiniz?
  • 23-08-2020, 12:12:26
    #3
    sparow adlı üyeden alıntı: mesajı görüntüle
    plakayı 47AH036 şeklinde eklemeyi dener misiniz?
    Denedim hocam, yine aynı şekilde hata alıyorum
  • 23-08-2020, 12:13:08
    #4
    TheSerSefiLL adlı üyeden alıntı: mesajı görüntüle
    Denedim hocam, yine aynı şekilde hata alıyorum
    plakayı tuttuğunuz veri tipi nedir?
  • 23-08-2020, 12:14:17
    #5
    sparow adlı üyeden alıntı: mesajı görüntüle
    plakayı tuttuğunuz veri tipi nedir?
    nvarchar hocam
  • 23-08-2020, 12:18:17
    #6
    TheSerSefiLL adlı üyeden alıntı: mesajı görüntüle
    nvarchar hocam
    string olarak değiştirip dener misiniz?
  • 23-08-2020, 14:02:07
    #7
    Veritabanına işlem yaparken kullandığınız komutta plakanın sağında ya da solunda bir hata var. Sadece o kısımları kontrol edin. Yanlışlıkla koyulmuş nokta, virgül gibi karakterler olabilir. Ya da hocamın dediği gibi veri tipleri alakalı ile bir durum da olabilir.