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.0Call a Stored ProcedureCall a Stored Procedure
Previous
 
Next
New Post
10/18/2007 1:05 PM
 



How do I databind existing data within a GridView that is using a controller.vb?
I have the following SELECTALL code, but not sure how to call the event or if this will actually grab all existing data within the module's sql table and place in GridView.

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


I realize this is really calling a stored procedure named: ModuleName_SelectAll
I am wondering the proper way to call the stored procedure.  ModuleName_SelectAll(number of ModuleId)   did not work?


Feedback Appreciated,

-machina12

 
New Post
10/18/2007 4:09 PM
 

machina,

I don't quite understand your question. Please elaborate some more on what you are trying to do. Maybe include more code in your post as to put things into context.

 
New Post
10/18/2007 4:32 PM
 

Algorithm0,

Appreciate the reponse. Basically I have multiple GridViews.
I am aware that I cannot use both a DataSource & DataSourceID, but am finding that to be difficult.
Traditionally I use the DataSource method for databinding and sql queries, yet the DataSourceID uses the controller.vb, with functions built in.
Although I have been told it cannot run both, I didnt realize I do still have a DataSourceID somewhere else within module, so maybe you can run both.
Either way, this particular GridView, which used to run off the controller never refreshed with data prior to module's use.
So I took the DataSourceID off of the GridView, and databinded the data within the table with a simple sql query.

Now the data appears within GridView.
The goal is to also be able to edit/delete content from within GridView. 
It already supported a ajax type "selection of only the row you click" for either the edit or delete. But I am not sure how this is done, since events names mentioned below don't seem to exist within any of the code?
So you can see, either I get a blank GridView and edit/delete ability, or I databind to refresh with all data in table and loose the ability to edit/delete.
When I click the edit or delete I get these two error messages:

             
Edit Delete data data data data data
Edit Delete data data data data data

A critical error has occurred.
The GridView 'GridView3' fired event RowEditing which wasn't handled.

OR

A critical error has occurred.
The GridView 'GridView3' fired event RowDeleting which wasn't handled.



How can I use BOTH the normal DataSource databinds with sql queries and also use the controller.vb?
I imagine you should be able to use both someway.

Not to mention, within all the code (.vbs) there isn't any code labeled: RowEditing or RowDeleting    not within any of the files? So where is event it mentions?
Its a bit confusing. The controller.vb is  a standard Micheal Washington download.

If I am making this too difficult let me know what you suggest for edit/deleting row data in the same ajax style.



Feedback Appreciated,

-machina12

 
New Post
10/18/2007 5:49 PM
 

I would revert back to using the object data source. Basically you want to drag out an ObjectDataSource from the data section of your toolbox. Configure it to use your controller class. Your controller class *should* have methods for updating and deleting. Back on the instance of your ObjectDataSource you will need to set the SelectMethod, UpdateMethod, and DeleteMethod properties to be the names of the respective methods on your controller object.

Take a look at the "Binding To A Business Logic Layer" example and source code here: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/objectdatasource.aspx

Post back with more questions if this doesn't help you.

 
New Post
10/18/2007 10:08 PM
 

Also, this might help:

http://www.adefwebserver.com/DotNetNukeHELP/DNN_Things4Sale/

It explains how to use the Object Data Source conrol with a DotNetNuke module.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Call a Stored ProcedureCall a Stored Procedure


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