Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

telerik -- supercharge your DNN websites
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
Verndale
The Official Microsoft ASP.NET Website
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! (Pro...  Example Code?
Previous Previous
 
Next Next
New Post 10/1/2008 9:58 AM
User is offline Trevor Daniel
105 posts
www.dnnxhtml.co.uk
9th Ranked


Example Code? 

Hi,

Would anyone be able to post some example code showing how to call a sproc with parameters and then set a variable to equal one of the records in the recordset please?

I am having terrible problems finding any example code on the internet.

Any help will be greatly appreciated

Thanks

Trev

 
New Post 10/1/2008 11:34 AM
User is offline Michael Washington
2848 posts
ADefWebserver.com
5th Ranked










Re: Example Code? 

http://www.adefwebserver.com/DotNetNukeHELP/DAL_and_DAL_Plus/Default.htm



Michael Washington
* ADefWebserver.com
* DNN Module Developer's Guide
* IWEB - DNN Web Services
* Silverlight and DotNetNuke
 
New Post 10/1/2008 12:08 PM
User is offline Trevor Daniel
105 posts
www.dnnxhtml.co.uk
9th Ranked


Re: Example Code? 

Hi,

Thanks for the link. I have done my best to look through it but there is a lot of new things...

I want to try and get something finished tonight if possible...

I am trying to fire a store procedure with paramaters that will return a recordset with ONE row... I am using the following code:

Dim sqlDataProvider As SqlDataProvider = CType(DataProvider.Instance(), SqlDataProvider)
Dim connectStr As String = sqlDataProvider.ConnectionString
Dim dbo As String = sqlDataProvider.DatabaseOwner
Dim oq As String = sqlDataProvider.ObjectQualifier
   
Using dr As IDataReader = CType(SqlHelper.ExecuteReader(connectStr, dbo & oq & "TaxiRoute_GetFareCosts",1,1,2), IDataReader)
  
End Using

The SP when i run it returns a row with 4 columns....

I just want to pull each vlaue one by one when needed....

I used to do something like  FirstPartDistance = RSTaxiFares("FirstPartDisctance")

Trev

 
New Post 10/2/2008 6:20 AM
User is offline Trevor Daniel
105 posts
www.dnnxhtml.co.uk
9th Ranked


Re: Example Code? 
Modified By Trevor Daniel  on 10/2/2008 8:36:16 AM)

Hi,

Sorry, it's me again.

I think I am getting closer but i am still getting errors...

Can anyone help me with what I am doing wrong please?

So far I have added the following section to my TaxiRouteInfo.vb file:

Public Class FareCostsInfo
  Private _TaxiType As Integer
  Public Property TaxiType() As Integer
  Get
  Return _TaxiType
  End Get
  Set(ByVal value As Integer)
  _TaxiType = value
  End Set
  End Property
  
  Private _TariffType As Integer
  Public Property TariffType() As Integer
  Get
  Return _TariffType
  End Get
  Set(ByVal value As Integer)
  _TariffType = value
  End Set
  End Property
  
  Private _AuthorityID As Integer
  Public Property AuthorityID() As Integer
  Get
  Return _AuthorityID
  End Get
  Set(ByVal value As Integer)
  _AuthorityID = value
  End Set
End Property

End Class

 

And I have added the following to my TaxiRouteController.vb

<DataObjectMethod(DataObjectMethodType.Select)> _
Public Shared Function TaxiRoute_GetFareCosts(ByVal TaxiType As Integer,ByVal TariffType As Integer,ByVal AuthorityID As Integer) As List(Of FareCostsInfo)
    Return CBO.FillCollection(Of FareCostsInfo)(CType(DataProvider.Instance().ExecuteReader("TaxiRoute_GetFareCosts", TaxiType,TariffType,AuthorityID), IDataReader))
End Function

 

But I get the following error

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30456: 'ExecuteReader' is not a member of 'YourCompany.Modules.TaxiRoute.DataProvider'.

Source Error:

 
Line 49: <DataObjectMethod(DataObjectMethodType.Select)> _
Line 50: Public Shared Function TaxiRoute_GetFareCosts(ByVal TaxiType As Integer,ByVal TariffType As Integer,ByVal AuthorityID As Integer) As List(Of FareCostsInfo)
Line 51:     Return CBO.FillCollection(Of FareCostsInfo)(CType(DataProvider.Instance().ExecuteReader("TaxiRoute_GetFareCosts", TaxiType,TariffType,AuthorityID), IDataReader))
Line 52: End Function	
Line 53:

 

I also have a dataprovider.vb and a sqldataprovider.vb in my app_code/TaxiRoute directory which the tutorial seems to say I dont need.

Trev

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! (Pro...  Example Code?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Perpetual Motion Interactive Systems Inc.
A solutions company specializing in Microsoft enterprise technologies.
www.perpetualmotion.ca
Icthus Technologies
Building Faith on the Internet
www.icthustech.com
Efficion Consulting
A premier DotNetNuke consulting firm providing complete DNN services including: custom module development, skinning and design, installation and integration services.
www.efficionconsulting.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP