Skip to main content

AccessTr.neT


vb.net sql server stokdan düşme

vb.net sql server stokdan düşme

#3
If Val(TextBox12.Text) < Val(TextBox19.Text) Then

          MessageBox.Show("Yeterli Stok Bulunmamaktadır", "Stok Uyarısı")
      Else
          DataGridView1.RowCount += 1
          Me.DataGridView1.Rows(i).Cells(0).Value = DateTimePicker1.Text
          Me.DataGridView1.Rows(i).Cells(1).Value = ComboBox1.Text
          Me.DataGridView1.Rows(i).Cells(2).Value = TextBox11.Text
          Me.DataGridView1.Rows(i).Cells(3).Value = ComboBox2.Text
          Me.DataGridView1.Rows(i).Cells(4).Value = TextBox10.Text
          Me.DataGridView1.Rows(i).Cells(5).Value = TextBox19.Text
          Me.DataGridView1.Rows(i).Cells(6).Value = TextBox14.Text
          Me.DataGridView1.Rows(i).Cells(7).Value = (Val(TextBox14.Text) * Val(TextBox19.Text) + Val(TextBox22.Text))
          i += 1
          If ComboBox1.SelectedItem = "Onarım" Then
              TextBox18.Text = ""
              TextBox18.Text = Val(TextBox12.Text) - Val(TextBox19.Text)
              Dim con99 As New SqlConnection
              Dim cmd99 As New SqlCommand
              Try
                  con99.ConnectionString = "Data Source=.\SQLEXPRESS;Initial Catalog=otomasyon;Persist Security Info=True;User ID=sa;Password=48586060"
                  con99.Open()
                  cmd99.Connection = con99
                  cmd99.CommandText = "UPDATE tbl_onarim SET adet =  '" & TextBox18.Text & "' WHERE stokkodu = '" & TextBox11.Text & "'"
                  cmd99.ExecuteNonQuery()
              Catch ex As Exception
                  MessageBox.Show("Error while updating record on table..." & ex.Message, "Update Records")
              Finally
                  con99.Close()
              End Try
          ElseIf ComboBox1.SelectedItem = "Bakım" Or ComboBox1.SelectedItem = "Periyodik Bakım" Then
              TextBox18.Text = ""
              TextBox18.Text = Val(TextBox12.Text) - Val(TextBox19.Text)
              Dim con99 As New SqlConnection
              Dim cmd99 As New SqlCommand
              Try
                  con99.ConnectionString = "Data Source=.\SQLEXPRESS;Initial Catalog=otomasyon;Persist Security Info=True;User ID=sa;Password=48586060"
                  con99.Open()
                  cmd99.Connection = con99
                  cmd99.CommandText = "UPDATE tbl_bakim SET adet =  '" & TextBox18.Text & "' WHERE bakimkodu = '" & TextBox11.Text & "'"
                  cmd99.ExecuteNonQuery()
              Catch ex As Exception
                  MessageBox.Show("Error while updating record on table..." & ex.Message, "Update Records")
              Finally
                  con99.Close()
              End Try
          End If
      End If




kodum bu şuan için kendim hatayı göremiyorum ama kullandığım kod bu daha detay isterseniz akşam tekrar bakarım şuan bilgisayarımda bazı sorunlar var programları tam kullanamıyorum başka bir yerde denetiyorum
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
vb.net sql server stokdan düşme - Yazar: gkmanil - 31/12/2014, 20:13
Cvp: vb.net sql server stokdan düşme - Yazar: gkmanil - 01/01/2015, 16:52
Cvp: vb.net sql server stokdan düşme - Yazar: gkmanil - 02/01/2015, 14:16
Cvp: vb.net sql server stokdan düşme - Yazar: gkmanil - 02/01/2015, 15:28
Cvp: vb.net sql server stokdan düşme - Yazar: gkmanil - 02/01/2015, 19:22
Task