Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0New to Module Development....Need Help with ErrorNew to Module Development....Need Help with Error
Previous
 
Next
New Post
7/18/2007 12:05 PM
 

I am first-time new to module development and am trying to implement a simple search module to search databas (which I have put within the DNN tables). Sorry for the length, but I would really appreciate all the help I can get!  Thanks!

My ascx page looks like this:

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SimpleSearch.ascx.vb" Inherits="DesktopModules_SimpleSearch_SimpleSearch" %>  Error: 'Context' not a member of 'DesktopModules_SimpleSearch_SimpleSearch'

<p>Please enter your zip code and see if Shipley Propane services your area . . .</p>
    <br />
    <asp:TextBox ID="zipCode" runat="server" Width="75px"></asp:TextBox><br />
    <br />
    <asp:Button ID="checkZip" runat="server" Text="Check Zip" Width="75px" /><br />
    <br />
    <asp:Panel ID="Panel1" runat="server" Font-Size="Medium" ForeColor="#C00000" Height="26px"
        Visible="False" Width="403px">
        Shipley Propane provides service for your area.</asp:Panel>
    <br />
    <asp:Panel ID="Panel2" runat="server" Font-Size="Medium" ForeColor="#C00000" Height="26px"
        Visible="False" Width="470px">
        Shipley Propane might provide service for your area . . . please call for further
        information.</asp:Panel>
    <br />
    <asp:Panel ID="Panel3" runat="server" Font-Size="Medium" ForeColor="#C00000" Height="26px"
        Visible="False" Width="396px">
        We are sorry, but Shipley Propane does not provide service in your area at this
        time.</asp:Panel>
    <br />

 

 

Here is my ascx.vb:

Imports DotNetNuke
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection
Imports DotNetNuke.Security.PortalSecurity

Partial Class DesktopModules_SuperSimple_SuperSimple
    Inherits Entities.Modules.PortalModuleBase

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            'ShowData("")
        End If
    End Sub
    Protected Sub checkZip_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles checkZip.Click

        Dim zip As String
        Dim service As String

        zip = zipCode.Text
        service = Trim(GetData(zip))

        If zip = "yes" Then
            Panel1.Visible() = True
            Panel2.Visible() = False
            Panel3.Visible() = False
        ElseIf zip = "maybe" Then
            Panel1.Visible() = False
            Panel2.Visible() = True
            Panel3.Visible() = False
        Else
            Panel1.Visible() = False
            Panel2.Visible() = False
            Panel3.Visible() = True
        End If

    End Sub

    Private Function GetData(ByVal SearchString As String) As Object

        Dim mySqlString As New StringBuilder()

        mySqlString.Append("SELECT service")

        mySqlString.Append("FROM {databaseOwner}{objectQualifier}tbl_zipCodes")

        mySqlString.Append("WHERE zipCode like '%' + @SearchString + '%' ")

        Dim myParam As SqlParameter = New SqlParameter("@SearchString", SqlDbType.VarChar, 150)

        myParam.Value = SearchString
        Dim resultPC As String

        resultPC = Convert.ToString(DataProvider.Instance().ExecuteScalar("sp_retrieveZipServiceCode", myParam) 

        Return resultPC

       
    End Function

End Class

 
New Post
7/18/2007 2:47 PM
 

change this line to this:

Partial Class DesktopModules_SimpleSearch_SimpleSearch



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
7/18/2007 2:48 PM
 

I'm replying to myself....I figured it out.  First I had copied previous code from another module and that was my first error message.  Next, I wasn't utilizing the scalar method properly...here's my correction incase it helps anyone else:

Private Function GetData(ByVal SearchString As String) As Object

        Dim myParam As SqlParameter = New SqlParameter("@zipCode", SearchString)

        Dim resultPC As String

        resultPC = Convert.ToString(DataProvider.Instance().ExecuteScalar("RetrieveZipServiceCode", myParam))

        Return resultPC


    End Function

 
New Post
7/18/2007 2:49 PM
 

Thanks so much, doesn't it figure that I saw that mistake right after I posted my error?!  i was righting a reply to my own post as your reply came in....thank you though!

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0New to Module Development....Need Help with ErrorNew to Module Development....Need Help with Error


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out