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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Problem in creating a moduleProblem in creating a module
Previous
 
Next
New Post
5/3/2010 11:21 AM
 

The code below was first written in Visual Studio 2008 as an .ascx and placed in a default.aspx page.  It works fine there.

When I created a new module within a DotNetNuke setting (as described in Hello World, 'Professional DotNetNuke 4' p.354) it gets the error messages shown at the bottom of the code.  I am just getting started in building DNN modules and don't know where to go with this.  I would appreciate any and all help I can get.

Thanks in advance

MRC

 

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" Onrowdatabound="StoreGridView_RowDataBound" Onrowcreated="StoreGridView_RowCreated" Visible="False"> <Columns>

 

 

<asp:BoundField DataField="Name" HeaderText="Store" ItemStyle-Width="85px" ItemStyle-HorizontalAlign="Center" readonly="true">

 

<ItemStyle HorizontalAlign="Center" Width="85px"></ItemStyle>

 

</asp:BoundField>

 

<asp:TemplateField HeaderText="Print Qty" ItemStyle-Width="85px">

 

<ItemTemplate>

 

 

 

<asp:DropDownList ID="ddPrType" runat="server" Width="85px" DataSource="<%# GetPrintTypeRecords() %>" DataTextField="LabelQty" DataValueField="LabelQtyID" >

 

</asp:DropDownList>

 

</ItemTemplate>

 

</asp:TemplateField>

 

<asp:TemplateField HeaderText="From" ItemStyle-Width="85px">

 

<ItemTemplate>

 

 

 

<asp:dropdownlist id="ddFromTyp" runat="server" Width="85px" DataTextField="IDValue1" DataValueField = "ID1" DataSource='<%# GetFrTyps() %>' >

 

</asp:dropdownlist>

 

</ItemTemplate>

 

</asp:TemplateField>

 

<asp:TemplateField HeaderText="Through" ItemStyle-Width="85px">

 

<ItemTemplate>

 

 

 

<asp:dropdownlist id="ddToTyp" runat="server" Width="85px" DataTextField="IDValue2" DataValueField="ID2" DataSource='<%# GetToTyps() %>' >

 

</asp:dropdownlist>

 

</ItemTemplate>

 

</asp:TemplateField>

 

</Columns>

 

<HeaderStyle BackColor="#99CCFF" />

 

</asp:GridView>

----------------------------------------

 

 

Public ReadOnly Property GetPrintTypeRecords() As DataTableGet

 

 

 

Dim dt As DataTable = Cache("PRQtys")Return dtEnd Get

 

End Property

 

 

Protected ReadOnly Property GetFrTyps() As DataTableGet

 

 

 

Dim dt As New DataTable("PrFroms")Dim RangID As Integer = ViewState("RangTyp")Dim theStore As String

 

Dim conStringRecv As String = "server=192.168.1.192;database=PurchasingSQL;UID=MACUser;pwd=guest2enter"

 

 

Dim conRecv As New System.Data.SqlClient.SqlConnection(conStringRecv)Dim cmdText As String

 

 

Dim i As Integer = GridView2.Rows.CountIf (ViewState("origStID") <> "0") Then

theStore = ViewState(

 

"curStore")Else

 

 

theStore =

Select Case iCase 0"2"

 

theStore =

Case 1"3"

 

theStore =

Case 2"4"

 

theStore =

Case 3"5"

 

theStore =

Case 4"6"

 

theStore =

Case 5"7"

 

End Select

 

End If

 

 

cmdText =

&

Select Case RangIDCase 1"SELECT DISTINCT Loc1 as IDValue1, Loc1 as ID1 FROM dbo.SQLMAC_TriadSQL_dbo_tblInvStore " _"WHERE Store = '" + theStore + "' ORDER BY Loc1"

 

cmdText =

&

&

&

&

&

&

&

Case 2"SELECT DISTINCT TOP 100 PERCENT dbo.SQLMAC_TriadSQL_dbo_tblInventory.MfgVend as IDValue1, " _"dbo.SQLMAC_TriadSQL_dbo_tblInventory.MfgVend as ID1 " _"FROM dbo.SQLMAC_TriadSQL_dbo_tblInventory INNER JOIN dbo.SQLMAC_TriadSQL_dbo_tblVendor ON " _"dbo.SQLMAC_TriadSQL_dbo_tblInventory.MfgVend = dbo.SQLMAC_TriadSQL_dbo_tblVendor.Vendor " _"WHERE (NOT (dbo.SQLMAC_TriadSQL_dbo_tblInventory.Description LIKE '*%')) AND " _"(NOT (dbo.SQLMAC_TriadSQL_dbo_tblInventory.PrimeVend LIKE 'DIS%')) AND " _"(NOT (dbo.SQLMAC_TriadSQL_dbo_tblVendor.VendorName LIKE '.%')) " _"ORDER BY dbo.SQLMAC_TriadSQL_dbo_tblInventory.MfgVend"

 

cmdText =

Case 3"SELECT Class as IDValue1, Class as ID1 FROM dbo.SQLMAC_TriadSQL_dbo_tblClass ORDER BY Class"

 

cmdText =

Case 4"SELECT Fineline as IDValue1, Fineline as ID1 FROM dbo.SQLMAC_TriadSQL_dbo_tblFinelines ORDER BY Fineline"

 

cmdText =

&

&

&

&

&

&

Case 5"SELECT DISTINCT dbo.SQLMAC_TriadSQL_dbo_tblInvStore.SKU as IDValue1, dbo.SQLMAC_TriadSQL_dbo_tblInvStore.SKU as ID1 " _"FROM dbo.SQLMAC_TriadSQL_dbo_tblInvStore LEFT OUTER JOIN dbo.SQLMAC_TriadSQL_dbo_tblInventory ON " _"dbo.SQLMAC_TriadSQL_dbo_tblInvStore.SKU = dbo.SQLMAC_TriadSQL_dbo_tblInventory.SKU " _"WHERE (dbo.SQLMAC_TriadSQL_dbo_tblInventory.KeepStockInfo = 'Y') AND " _"(NOT (dbo.SQLMAC_TriadSQL_dbo_tblInventory.Department IN ('94', '95', '96', '99', 'D'))) AND " _"(dbo.SQLMAC_TriadSQL_dbo_tblInvStore.Store = '" + theStore + "') " _"ORDER BY dbo.SQLMAC_TriadSQL_dbo_tblInvStore.SKU"

 

Case Else

lblMsg.Text =

"Bad range selection"

lblMsg.Visible =

True

 

Return Nothing

 

End Select

 

myDA.Fill(dt)

conRecv.Open()

Cache(

conRecv.Close()

 

 

 

Error 4 Name 'GetPrintTypeRecords' is not declared. C:\Inetpub\wwwroot\DotNetNuke\DesktopModules\McL_PriceLabelRequest\ViewMcL_PriceLabelRequest.ascx 1 1 McL_PriceLabelRequest
Error 5 Name 'GetFrTyps' is not declared. C:\Inetpub\wwwroot\DotNetNuke\DesktopModules\McL_PriceLabelRequest\ViewMcL_PriceLabelRequest.ascx 1 1 McL_PriceLabelRequest
Error 6 Name 'GetToTyps' is not declared. C:\Inetpub\wwwroot\DotNetNuke\DesktopModules\McL_PriceLabelRequest\ViewMcL_PriceLabelRequest.ascx 1 1 McL_PriceLabelRequest
 

 

 

 -------------------------------------------

 
New Post
5/4/2010 5:41 AM
 
error indicate missing references. however, using inline SQL besides in Linq2SQL should be a no go! Use stored procedures instead, to avoid sql injection.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Problem in creating a moduleProblem in creating a module


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