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.0Access DataList Fields?Access DataList Fields?
Previous
 
Next
New Post
4/1/2008 12:05 PM
 

Old Mac,

 

Without being able to see a larger segment of your code, I’m kind of at a loss as to what exactly you’re trying to do. Are these compiler errors or runtime errors? What line(s) does the error correspond to? Where are you executing this code (button click event, page load, other)? Are you using stored procedures?

 

--Nathan Rover

 
New Post
4/1/2008 12:23 PM
 



Nathan,

Simply by removing the DataSource from the codebehind (update button click) and connecting the ListView to the Controller DataSourceID, which works correctly with databound gridviews, etc.  This is the Select_All code from within controller, but nothing would have changed:

<DataObjectMethod(DataObjectMethodType.Select)> _
Public Shared Function TableName_SelectAll(ByVal ModuleId As Integer) As List(Of TableNameInfo)
Return CBO.FillCollection(Of TableNameInfo)(CType(DataProvider.Instance().ExecuteReader("TableName_SelectAll", ModuleId), IDataReader))
End Function

So by removing the DataSource, and connecting the DataSourceID, it should simply switch to the controller controls.
The controller Select_All uses the code above and a standard Select_All stored procedure:

 TableName_SelectAll
@ModuleId int
AS
 SELECT     ID, ModuleId, PortalID, UserID, ProductID, FieldName....
 FROM          TableName
 WHERE     (ModuleId = @ModuleId)
 ORDER BY  FieldName
 RETURN

I tried editing the stored procedure WHERE statement as well, but when the error occurs (by clicking update), it still refers to ModuleId.
Anything I still might be leaving out?

 
New Post
4/1/2008 1:58 PM
 

Old Mac,

Do you have a public get and set function for your parameter array? If so are the names and types identical to the names and types in your stored procedure?

*I could be wrong but I thought you used the DataSourceID property when connecting to a asp:SqlDataSource and the DataSource property when your filling the control with a IDataReader. That is why you don’t see DataSourceID used much in DotNetNuke controls. 

*Another possible problem is:

Me.DataList1.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), UpdateParam, Nothing), IDataReader)

I believe ExecuteSQL() only takes two parameters… Try removing the “Nothing”. 

*Another possible problem is, you don’t set the direction of your UpdateParam…

UpdateParam.Direction = ParameterDirection.Input 

*Another thing to keep in mind if you edit the TableName_SelectAll stored procedure to not need the moduleid you need to delete @ModuleID int and the WHERE statement.

--Nathan Rover

 
New Post
4/1/2008 3:05 PM
 



Nathan,

When the controller is being used, there is no need for ascx.vb codebehind of sql button commands, rather the controller.vb takes care of this.
When using the controller, an ObjectDataSource must be present within ascx:

<asp:ObjectDataSource ID="ObjectDataSource_ModuleName" runat="server" DataObjectTypeName="CompanyName.DNN.Modules.ModuleName.Business.ModuleNameInfo" DeleteMethod="ModuleName_Delete" InsertMethod="ModuleName_Insert" OldValuesParameterFormatString="original_{0}" OnInit="Page_Load" SelectMethod="ModuleName_SelectAll" TypeName="CompanyName.DNN.Modules.ModuleName.Business.ModuleNameController" UpdateMethod="ModuleName_Update">
<SelectParameters>
<asp:Parameter DefaultValue="00" Name="ModuleId" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>

As I mentioned, I am using the controller actively with other components and the Select_All is not an issue.
I've been able to isolate the error to the <SelectParameters></SelectParameters> section of the code.  This is the "ModuleId" it refers to in error.

A critical error has occurred.
ObjectDataSource 'ObjectDataSource_TableName' could not find a non-generic method 'TableName_SelectAll' that has parameters: ModuleId.


Any suggestions?

 
New Post
4/1/2008 3:57 PM
 

Old Mac,

Public Shared Function TableName_SelectAll(ByVal ModuleId As Integer) As List(Of TableNameInfo)
Return CBO.FillCollection(Of TableNameInfo)(CType(DataProvider.Instance().ExecuteReader("TableName_SelectAll", ModuleId), IDataReader))
End Function


<asp:ObjectDataSource ID="ObjectDataSource_ModuleName" runat="server" DataObjectTypeName="CompanyName.DNN.Modules.ModuleName.Business.ModuleNameInfo" DeleteMethod="ModuleName_Delete" InsertMethod="ModuleName_Insert" OldValuesParameterFormatString="original_{0}" OnInit="Page_Load" SelectMethod="ModuleName_SelectAll" TypeName="CompanyName.DNN.Modules.ModuleName.Business.ModuleNameController" UpdateMethod="ModuleName_Update">
<SelectParameters>
<asp:Parameter DefaultValue="00" Name="ModuleId" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>

 

Which is it? ModuleName or TableName?

-- Nathan Rover

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Access DataList Fields?Access DataList Fields?


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