DARK__FOXX
Member
- Joined
- Sep 2, 2020
- Messages
- 16
- Programming Experience
- Beginner
Hi,
I asked help for this code that I have created:
- Why does my unused variable always return 0 and not the text box value instead?
- How can I return the values found in the textboxes and in the label that will be inserted in the db?
Thanks for help!!!!
I asked help for this code that I have created:
VB.NET:
Public Sub INSERISCI_EXP_DATE_TABLE()
Dim id_customer As Integer
Dim exp_date As Date
Try
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
MyParm = cmd.Parameters.Add("@COD_CUSTOMER", SqlDbType.Int)
If (Integer.TryParse(txt_COD_CUSTOMER.Text, id_customer)) Then
MyParm.Value = id_customer
Else
MsgBox("customer not found", vbCritical)
End If
MyParm = cmd.Parameters.Add("@COMPANY_NAME", SqlDbType.NVarChar)
MyParm.Value = lbl_COMPANY_NAME.Text.ToString
MyParm = cmd.Parameters.Add("@EXP_DATE", SqlDbType.Date)
If (Date.TryParse(txt_EXP_DATE.Text, exp_date)) Then
MyParm.Value = exp_date
Else
MsgBox("Exp Date not found", vbCritical)
End If
cmd.CommandText = "LST_INSERT_TABLE_01"
cmd.Connection.Open()
cmd.ExecuteNonQuery()
MsgBox("Date registred", vbInformation)
Catch ex As Exception
MsgBox(ex.Message)
Finally
cn.Close()
End Try
End Sub
- How can I return the values found in the textboxes and in the label that will be inserted in the db?
Thanks for help!!!!