Today I was working on a client''s website, trying to integrate an event calendar system that we have with their DotNetNuke site search. The DNN site search input and search results are actually two different modules. The problem is that our events system is a separate application with its own database. The challenge was to make the DNN site search include the events from our external system in the search results in such a way that visitors wouldn''t know the difference between DNN results and our event system results. There are probably numerous ways to accomplish this, but we needed a very quick turnaround time and it had to look like it was still part of DNN. So here''s what I did:
1 // create SqlConnection, SqlCommand, SqlReader, etc.
2 SqlDataReader reader = new SqlReader()
3 // Fill your DataReader, other code omitted...
4 While (reader.Read())
5 Dim eTitle As String
6 Dim eDesc As String
7 eTitle = reader.GetString(4)
8 eDesc = reader.GetString(1)
9
10 Dim myResult As New SearchResultsInfo
11 myResult.Author = "Kevin S."
12 myResult.AuthorName = "Kevin S."
13 myResult.Guid = "111" //fake/placholder
14 myResult.Image = 0
15 myResult.ModuleId = 367 //should be a real moduleId
16 myResult.Description = eDesc
17 myResult.Occurrences = 1
18 myResult.PubDate = reader.GetDateTime(2)
19 myResult.Relevance = 1000
20 myResult.TabId = 36 // should be a real tabId
21 myResult.Title = eTitle
22
23 Results.Add(myResult)
24 End While