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  |  

AspDotNetStoreFront
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
 


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.

 


Alliance Systems & Programming Inc
Alliance is not just our name... it's how we do business. We partner with our clients, learning their business processes and standards and then applying our expertise to help them improve their workflow and profitability.
www.Alliancesys.com
Customer Connect
Customer Connect provides cutting edge solutions that deliver sales, marketing and customer service results.
www.customer-connect.com
TechNexxus
Business process and technology sourcing solutions delivering superior people, process and value. We have used, and continue to use, DNN successfully in numerous client projects to deliver exceptional value. We are proud to support the DNN team and community.
www.technexxus.com

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