fork download
  1. Imports System.Data.OleDb
  2. Public Class menusnack
  3. Dim cn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\alfornosoft\base\db.accdb;Jet OLEDB:Database Password=ideasrenova")
  4. Dim papas As Integer
  5. Dim bolitas As Integer
  6. Dim palitos As Integer
  7. Dim aritos As Integer
  8. Dim dtFecha As DateTime = DateTime.Now
  9. Dim insertafecha As String
  10.  
  11. Private Sub bt_papas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_papas.Click
  12. papas = papas + 1
  13. numpapas.Text = papas
  14. If papas > 0 Then
  15. bt_mpapas.Visible = True
  16. bt_mpapas.Enabled = True
  17. End If
  18.  
  19. End Sub
  20.  
  21. Private Sub menusnack_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  22. Dim ada As New OleDbDataAdapter("SELECT MAX(Id) FROM orden_previa", cn)
  23. Dim dset As New DataSet
  24. ada.Fill(dset)
  25. muestraorden.Text = dset.Tables(0).Rows(0).Item(0) + 1
  26. id_cliente.Text = module1.llevateelid
  27. bt_mpapas.Visible = False
  28. bt_mbolitas.Visible = False
  29. bt_mpalitos.Visible = False
  30. bt_maritos.Visible = False
  31. insertafecha = dtFecha.ToString("dd/MM/yyyy")
  32. End Sub
  33. //AQUI MUESTRA EL ERROOOOR
  34. Private Sub bt_continuar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_continuar.Click
  35. Dim ada As New OleDbDataAdapter("SELECT papas_snack,bolitas_snack,palitos_snack,aritos_snack FROM orden_previa WHERE Id='" & Convert.ToString(muestraorden.Text) & "'", cn)
  36. Dim dset As New DataSet
  37. ada.Fill(dset)
  38. If MsgBox("Confirma el pedido:" & vbNewLine & "Papas: " + Convert.ToString(papas) & vbNewLine & "Bolitas: " + Convert.ToString(bolitas) & vbNewLine & "Palitos: " + Convert.ToString(palitos) & vbNewLine & "Aritos: " + Convert.ToString(aritos), MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
  39. Dim comm As New OleDbCommand
  40. comm.Connection = cn
  41. comm.CommandType = CommandType.Text
  42. comm.CommandText = ("UPDATE orden_previa SET papas_snack = '" + Convert.ToString(papas) + "', bolitas_snack = '" + Convert.ToString(bolitas) + "', palitos_snack = '" + Convert.ToString(palitos) + "', aritos_snack = '" + Convert.ToString(aritos) + "' WHERE Id = '" + Convert.ToString(muestraorden.Text) + "'")//sentencia UPDATE QUE ESTA MAL
  43. cn.Open()
  44. comm.ExecuteNonQuery()//LINEA EN LA QUE SE DETIENE
  45. cn.Close()
  46. MsgBox("Se inserto correctamente", MsgBoxStyle.Information, "Correcto!")//AQUI TERMINA EL ERROR
  47. Me.Hide()
  48. End If
  49. End Sub
  50. Private Sub bt_bolitas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_bolitas.Click
  51. bolitas = bolitas + 1
  52. numbolitas.Text = bolitas
  53. If bolitas > 0 Then
  54. bt_mbolitas.Visible = True
  55. bt_mbolitas.Enabled = True
  56. End If
  57. End Sub
  58.  
  59. Private Sub bt_palitos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_palitos.Click
  60. palitos = palitos + 1
  61. numpalitos.Text = palitos
  62. If palitos > 0 Then
  63. bt_mpalitos.Visible = True
  64. bt_mpalitos.Enabled = True
  65. End If
  66. End Sub
  67.  
  68. Private Sub bt_aritos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_aritos.Click
  69. aritos = aritos + 1
  70. numaritos.Text = aritos
  71. If aritos > 0 Then
  72. bt_maritos.Visible = True
  73. bt_maritos.Enabled = True
  74. End If
  75. End Sub
  76.  
  77. Private Sub bt_mpapas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_mpapas.Click
  78. If papas < 1 Then
  79.  
  80. MsgBox("No se puede continuar restando porque el valor es de 0", MsgBoxStyle.Critical)
  81. numpapas.Text = papas
  82. bt_mpapas.Enabled = False
  83. Else
  84. bt_mpapas.Enabled = True
  85. papas = papas - 1
  86. numpapas.Text = papas
  87. End If
  88. End Sub
  89.  
  90. Private Sub bt_mbolitas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_mbolitas.Click
  91. If bolitas < 1 Then
  92.  
  93. MsgBox("No se puede continuar restando porque el valor es de 0", MsgBoxStyle.Critical)
  94. numbolitas.Text = bolitas
  95. bt_mbolitas.Enabled = False
  96. Else
  97. bolitas = bolitas - 1
  98. numbolitas.Text = bolitas
  99. End If
  100. End Sub
  101.  
  102. Private Sub bt_mpalitos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_mpalitos.Click
  103. If palitos < 1 Then
  104.  
  105. MsgBox("No se puede continuar restando porque el valor es de 0", MsgBoxStyle.Critical)
  106. numpalitos.Text = palitos
  107. bt_mpalitos.Enabled = False
  108. Else
  109. palitos = palitos - 1
  110. numpalitos.Text = palitos
  111. End If
  112. End Sub
  113.  
  114. Private Sub bt_maritos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_maritos.Click
  115. If aritos < 1 Then
  116.  
  117. MsgBox("No se puede continuar restando porque el valor es de 0", MsgBoxStyle.Critical)
  118. numaritos.Text = aritos
  119. bt_maritos.Enabled = False
  120. Else
  121. aritos = aritos - 1
  122. numaritos.Text = aritos
  123. End If
  124. End Sub
  125.  
  126. End Class
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
10
42
11
compilation info
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.


/home/PsbLer/prog.vb (23,32) : Error VBNC30451: Could not resolve the name 'DataSet'
There were 1 errors and 0 warnings.
Compilation took 00:00:00.7408990
stdout
Standard output is empty