Hi all i need help in generating my ean13 generator.
First step that i made, by generating product code without check number.
after i got this 12digit product code i need to generate check number which i'm stuck for 2 day. Example of my result is "200001000012*" * = check number
Now next i need to generate full product code with check number that show into text box.
But i loss until this stage. Anyone can advise me.. thank u
First step that i made, by generating product code without check number.
VB.NET:
Private Function ean_complete() As String
Dim conn As New MySqlConnection
conn.ConnectionString = (ConfigurationManager.ConnectionStrings.Item("ItemListing").ToString)
Dim cnSQL As String
Dim i As Integer
Dim cmSQL As MySqlCommand
conn.Open()
cnSQL = "Select * From Ean13" & _
" Where deptcode = '" & txtDeptCode.Text & "'"
Dim da As New MySqlDataAdapter(cnSQL, conn)
Dim dt As New DataTable
da.Fill(dt)
Dim temp As String = ""
Dim temp1 As String = ""
Dim temp0 As String = ""
temp = dt.Rows(0).Item("inhouse")
temp1 = dt.Rows(0).Item("Deptcode")
For i = 0 To dt.Rows(0).Item("len") - (dt.Rows(0).Item("item").ToString.Length + temp.Length) - 1
temp0 = temp0 + "0"
Next
Dim newseq As Integer = CInt(dt.Rows(0).Item("seq")) + 1
cnSQL = "UPDATE EAN13 SET item = '" & CStr(newseq) & "'"
cmSQL = New MySqlCommand(cnSQL, conn)
cmSQL.ExecuteNonQuery()
Return CStr(dt.Rows(0).Item("inhouse")) + dt.Rows(0).Item("Deptcode") + temp0 + CStr(dt.Rows(0).Item("item"))
conn.Close()
End Function
after i got this 12digit product code i need to generate check number which i'm stuck for 2 day. Example of my result is "200001000012*" * = check number
Now next i need to generate full product code with check number that show into text box.
But i loss until this stage. Anyone can advise me.. thank u