Dim Helms(3), Armors(4), Pants(4), Gloves(4), Boots(4), SAS(3), SM(2), BCB(1), Shields(2), Wings(4), SSO(4), Misc(7), Tabelas(11) As String
Dim Array(11) As Array
Helms(0) = "Dk_Helms"
Helms(1) = "Dw_Helms"
Helms(2) = "Elf_Helms"
Helms(3) = "Dl_Helms"
Tabelas(0) = "BI_Helms"
Array(0) = Helms
Armors(0) = "Dk_Armors"
Armors(1) = "Dw_Armors"
Armors(2) = "Elf_Armors"
Armors(3) = "Dl_Armors"
Armors(4) = "Mg_Armors"
Tabelas(1) = "BI_Armors"
Array(1) = Armors
Pants(0) = "Dk_Pants"
Pants(1) = "Dw_Pants"
Pants(2) = "Elf_Pants"
Pants(3) = "Dl_Pants"
Pants(4) = "Mg_Pants"
Tabelas(2) = "BI_Pants"
Array(2) = Pants
Gloves(0) = "Dk_Gloves"
Gloves(1) = "Dw_Gloves"
Gloves(2) = "Elf_Gloves"
Gloves(3) = "Dl_Gloves"
Gloves(4) = "Mg_Gloves"
Tabelas(3) = "BI_Gloves"
Array(3) = Gloves
Boots(0) = "Dk_Boots"
Boots(1) = "Dw_Boots"
Boots(2) = "Elf_Boots"
Boots(3) = "Dl_Boots"
Boots(4) = "Mg_Boots"
Tabelas(4) = "BI_Boots"
Array(4) = Boots
SAS(0) = "Dk_Swords"
SAS(1) = "Dk_Axes"
SAS(2) = "Dk_Spears"
SAS(3) = "Mg_Swords"
Tabelas(5) = "BI_Swords_Axes_Spears"
Array(5) = SAS
SM(0) = "Dk_Maces"
SM(1) = "Elf_Maces"
SM(2) = "Dl_Scepters"
Tabelas(6) = "BI_Scepters_Maces"
Array(6) = SM
BCB(0) = "Elf_Bows"
BCB(1) = "Elf_Crossbows"
Tabelas(7) = "BI_Bows_Crossbows"
Array(7) = BCB
Shields(0) = "Dk_Shields"
Shields(1) = "Dw_Shields"
Shields(2) = "Elf_Shields"
Tabelas(8) = "BI_Shields"
Array(8) = Shields
Wings(0) = "Dk_Wings"
Wings(1) = "Dw_Wings"
Wings(2) = "Elf_Wings"
Wings(3) = "Mg_Wings"
Wings(4) = "Dl_Wings"
Tabelas(9) = "BI_Wings"
Array(9) = Wings
SSO(0) = "Dk_Skills"
SSO(1) = "Dw_Spells"
SSO(2) = "Elf_Orbs"
SSO(3) = "Dl_Spells"
SSO(4) = "Mg_Skills"
Tabelas(10) = "BI_SSO"
Array(10) = SSO
Misc(0) = "Misc_Item_Bags"
Misc(1) = "Misc_Potions"
Misc(2) = "Misc_Pets"
Misc(3) = "Misc_Jewels"
Misc(4) = "Misc_Quest_Items"
Misc(5) = "Misc_BC_DS"
Misc(6) = "Misc_Rings_Pendents"
Misc(7) = "Misc_Others"
Tabelas(11) = "BI_Misc"
Array(11) = Misc
Try
MuShop.ClassAndItems.Open()
For Actual As Integer = 0 To Array.Length - 1
For TabActual As Integer = 0 To Array(Actual).Length - 1
Dim CmdSelect As New OleDb.OleDbCommand("SELECT * FROM " & CType(Array(Actual), String())(TabActual).ToString, MuShop.ClassAndItems)
Dim Reader As OleDb.OleDbDataReader = CmdSelect.ExecuteReader
While Reader.Read
Dim CommandInsert As New OleDb.OleDbCommand("INSERT INTO " & Tabelas(Actual) & " ([Name], Category, [Number], [Level], [Level?], [Skill?], [Luck?], [Options?], Y, X, Path) VALUES (@Name, @Category, @Number, @Level, @PTLevel, @PTSkill, @PTLuck, @PTOptions, @Y, @X, @Path)", MuShop.ClassAndItems)
CommandInsert.Parameters.AddWithValue("@Name", Reader("Name"))
CommandInsert.Parameters.AddWithValue("@Category", Reader("Category"))
CommandInsert.Parameters.AddWithValue("@Number", Reader("Number"))
CommandInsert.Parameters.AddWithValue("@Level", Reader("Level"))
CommandInsert.Parameters.AddWithValue("@PTLevel", Reader("Level?"))
CommandInsert.Parameters.AddWithValue("@PTSkill", Reader("Skill?"))
CommandInsert.Parameters.AddWithValue("@PTLuck", Reader("Luck?"))
CommandInsert.Parameters.AddWithValue("@PTOptions", Reader("Options?"))
CommandInsert.Parameters.AddWithValue("@Y", Reader("Y"))
CommandInsert.Parameters.AddWithValue("@X", Reader("X"))
CommandInsert.Parameters.AddWithValue("@Path", Reader("Path"))
CommandInsert.ExecuteNonQuery()
End While
Reader.Close()
Next
Next
Catch ex As Exception
'some code
Finally
MuShop.ClassAndItems.Close()
End Try