Dim aa As String() = d1.ToString().Split("/")
Dim a1 As String = aa(0).ToString()
Dim a2 As String = aa(1).ToString()
Dim a3 As String = aa(2).ToString().Substring(0, 4)
Dim aa As String() = ccc.Text.ToString().Split("/")
Dim Day_Mfg As String = aa(0).ToString()
Dim Month_Mfg As String = aa(1).ToString()
Dim Year_Mfg As Integer = aa(2).ToString().Substring(0, 4)
Dim Year_Mfg1 As Integer = Year_Mfg - 543
Dim Year_Mfg2 As String = Year_Mfg1.ToString()
Dim date_Mfg As String = Day_Mfg + Month_Mfg + Year_Mfg2
Dim date_Mfg1 As Date = CDate(date_Mfg)
Dim StrConn As String
StrConn = WebConfigurationManager.ConnectionStrings("Conn").ConnectionString
Dim Conn As New SqlConnection(StrConn)
Conn.Open()
Dim StrCmd As String
StrCmd = ("UPDATE drug SET Mfg = '" & date_Mfg1 & "' ")
Dim SqlCmd As New SqlCommand(StrCmd, Conn)
SqlCmd.ExecuteNonQuery()
Conn.Close()
โดยมัน Error ว่า Conversion from string "2082009" to type 'Date' is not valid.
ขอบคุณคับบบบบบ