i just could not figure out how i will put my data on a selectlist for it to be displayed on a dropdownlist..
i am using mysql as my database.. on my model i have this query:
Imports Microsoft.VisualBasic
Imports System.Data
Public Class ClassCategoryConnection
Inherits ClassConnection
Public Function SelectCategory() As DataTable
Return ReadData("SELECT IDcategory, category FROM category")
End Function
End Class
on my controller i have:
Public Class HomeController
Private Category As New ClassCategoryConnection
Function Index() As ActionResult
Dim _category As DataTable = Category.SelectCategory()
Return View(_category)
End Function
End Class
how will i construct my selectlist with this?..=)
thank you in advance!