I'm using the template in VS2005 to make my first module. I've had quite a bit of experience with classic asp, but all this database, business, and presentation layer is all new to me..
I'm trying to modify the template so that when the view is displayed, it looks to the database with a query(sp), and if no results are returned, the execute a different query(SP) to get some default content and then bind the results of that query to the datalist control and display the content.
I'm running into a problem when I try to add the results of the query to the list that is then converted to the class that is bound to the datasource.. I get an error stating that the list can't be converted to the class.. What am I doing wrong here?
If Not Page.IsPostBack Then
Dim objTexts As New TextController
Dim colTexts As List(Of TextInfo)
Dim Num As Integer
Num = Request.QueryString("NUM")
colTexts = objTexts.GetTexts(ModuleId, Num)
If colTexts.Count = 0 Then
Dim Def As Integer = Settings("MyModule.Def.Content")
colTexts = objTexts.GetText(ModuleId, Def)
End If
lstContent.DataSource = colTexts
lstContent.DataBind()
End If
While using different criteria to select the content, both queries return the exact same dataset... Any help you can offer is greatly appreciated...