Private Sub dgvPics_RowHeaderMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles dgvPics.RowHeaderMouseClick
Dim s As System.Drawing.Point
s = dgvPics.CurrentCellAddress
Dim i = dgvPics.CurrentRow.Index
Dim connect As New MySqlConnection(cs)
connect.Open()
Dim toedit As Boolean = True
If MsgBox("To send Patient to Doctor Click Yes!to edit Record click No", vbYesNoCancel) = MsgBoxResult.Yes Then
toedit = False
Dim confee As String
confee = InputBox("Please Enter Consultation Fee", "Request Info ", Nothing)
If confee Is Nothing Or confee = "" Then
Exit Sub
End If
If Not IsNumeric(confee) Then
MsgBox("Please Only Enter Numbers")
Exit Sub
End If
Dim comp As String = ""
Dim insertqry As String = "INSERT INTO Scheduletb(SerialNo,Status,CFee,Dates,Times) VALUES(@f1,@f2,@f3,@f5,@f6)"
Dim RowsAffected As Integer = 0
Dim insertcmd As New MySqlCommand
With insertcmd
.CommandText = insertqry
.Connection = connect
.Parameters.AddWithValue("@f1", dgvPics.Item(0, i).Value.ToString)
.Parameters.AddWithValue("@f2", "Unattended")
.Parameters.AddWithValue("@f3", confee)
.Parameters.AddWithValue("@f5", FormatDateTime(Date.Today, DateFormat.ShortDate))
.Parameters.AddWithValue("@f6", FormatDateTime(TimeOfDay.TimeOfDay.ToString, DateFormat.LongTime))
RowsAffected = .ExecuteNonQuery()
End With
If RowsAffected > 0 Then
MessageBox.Show("Successfully Sent User", "schedule", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
What I have tried:
the code used to work then after formatting my machine and reinstalling vb.net ,mysql it doesn't update,on inserting only primary numbers show the rest of the fields reads NULL
<img alt="IMG example" src="https://drive.google.com/open?id=0B_09fxzTsacsZFNfOVhnMFdmZ1U"/> it doesnt show any error