DARK__FOXX
Member
- Joined
- Sep 2, 2020
- Messages
- 16
- Programming Experience
- Beginner
Hi,
I'm trying to convert a string to an integer and string to a date. In the EXP_DATE see 1/1/0001 12:00:00 AM as default value,while in the ID_CUSTOMER see 0 and I need to visualize Textbox values.
The problem is that they are inside the textboxes, while I am debugging it seems as if it does not save the values inside the textboxes.
One of the two textboxes are generated automatically if I click a button inside a repeater that displays the cleinte code and company name data (this is displayed inside a label).
This is my code
I'm trying to convert a string to an integer and string to a date. In the EXP_DATE see 1/1/0001 12:00:00 AM as default value,while in the ID_CUSTOMER see 0 and I need to visualize Textbox values.
The problem is that they are inside the textboxes, while I am debugging it seems as if it does not save the values inside the textboxes.
One of the two textboxes are generated automatically if I click a button inside a repeater that displays the cleinte code and company name data (this is displayed inside a label).
This is my code
VB.NET:
Public Sub INSERT_EXP_DATE_TABLE()
MyParm = cmd.Parameters.Add("@ID_CUSTOMER", SqlDbType.Int)
MyParm.Value = CInt(txt_COD_CUSTOMER.Text)
MyParm = cmd.Parameters.Add("@COMPANY_NAME", SqlDbType.NVarChar)
MyParm.Value = lbl_COMPANY_NAME.Text
MyParm = cmd.Parameters.Add("@EXP_DATE", SqlDbType.Date)
MyParm.Value = CDate(txt_EXP_DATE.Text)
Try
cmd.Connection = cn
cmd.CommandText = "LST_INSERT_TABLE_01"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection.Open()
cmd.ExecuteNonQuery()
MsgBox("Date expired conferm", vbInformation)
Catch ex As Exception
MsgBox(ex.Message)
Finally
cn.Close()
End Try
End Sub
Last edited by a moderator: