Public Function a1() As String Dim id1 As String Dim l1 As String Dim dt1 As DataTable = New DataTable Dim SQL1 As String SQL1 = "SELECT Max(song_id) FROM song" dt1 = c.ExRead(SQL1) id1 = dt1(0)(0).ToString If dt1(0)(0).ToString <> "" Then If id1.Substring(id1.Length - 1) <> "9" Then id1 = dt1(0)(0).ToString l1 = id1.Substring(id1.Length - 1, id1.Length - 6) id1 = id1.Substring(0, id1.Length - 1) + (Integer.Parse(l1) + 1).ToString ElseIf dt1(0)(0).ToString.Substring(id1.Length - 1) = "9" Then If dt1(0)(0).ToString.Substring(id1.Length - 2, id1.Length - 6) = "9" Then If dt1(0)(0).ToString.Substring(id1.Length - 3, id1.Length - 6) = "9" Then If dt1(0)(0).ToString.Substring(id1.Length - 4, id1.Length - 6) = "9" Then If dt1(0)(0).ToString.Substring(id1.Length - 5, id1.Length - 6) = "9" Then id1 = dt1(0)(0).ToString l1 = Integer.Parse(id1.Substring(1, id1.Length - 6)) + 1 id1 = "S" + l1 + "00000" Else id1 = dt1(0)(0).ToString l1 = Integer.Parse(id1.Substring(2, id1.Length - 6)) + 1 id1 = "S0" + l1 + "0000" End If Else id1 = dt1(0)(0).ToString l1 = Integer.Parse(id1.Substring(3, id1.Length - 6)) + 1 id1 = "S00" + l1 + "000" End If Else id1 = dt1(0)(0).ToString l1 = Integer.Parse(id1.Substring(4, id1.Length - 6)) + 1 id1 = "S000" + l1 + "00" End If Else id1 = dt1(0)(0).ToString l1 = Integer.Parse(id1.Substring(5, id1.Length - 6)) + 1 id1 = "S0000" + l1.ToString + "0" End If End If ElseIf dt1(0)(0).ToString = "" Then id1 = "S00001" End If Return id1 End Function
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง