User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 375,229 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,264 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 276 | Replies: 0
Reply
Join Date: Apr 2008
Posts: 6
Reputation: RandyRich is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
RandyRich RandyRich is offline Offline
Newbie Poster

Accessing Oracle stored functions from asp.net

  #1  
May 12th, 2008
I'm new to asp.net and I have an oracle stored function with 3 input parameters that returns a string. The function is one that validates a user. I want to validate my users from Oracle. I'm trying to use the sqldatasource component to interact with my stored procedure but I can't seem to find the right syntax.

First of all I've configured the sqldatasource to connect to the correct database. I've also configured the define custom statement or stored procedures in the select tab and defined my parameters.

Now I'm using the authenticate event handler of the login control to load the values into my stored function and read the result back, but I'm not sure of the correct syntax and can't seem to find anything on the web.

I was hoping that textBox1.text would contain the results of my stored function but it actually displays 'SYSTEM.DATA.DATAVIEW'

HERE IS MY CODE:


  1. Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs)
  2. 'HERE I'M INITIATINT THE ARGUMENTS TO BE PASSED TO THE SELECT STATEMENT, BUT NOT REALLY SURE WHY THIS IS IMPORTANT
  3. Dim arguments As New DataSourceSelectArguments
  4. 'HERE I'M ATTEMPTING TO MAKE SOME SORT OF RETURN VALUE, BUT AGAIN NOT SURE WHY
  5. Dim returnValue As System.Data.DataView
  6. 'THESE STATEMENTS SHOULD BE LOADING MY DATA INTO THE PARAMETERS OF THE SQLDATASOURCE
  7. DataSourceUsers.SelectParameters("IN_USER_ID").DefaultValue = "myuserid"
  8. DataSourceUsers.SelectParameters("IN_PASSWORD").DefaultValue = "mypassword"
  9. DataSourceUsers.SelectParameters("IN_APPLICATION").DefaultValue = "AC360"
  10. 'HERE I CALL THE SELECT METHOD OF THE SQL DATA SOURCE
  11. 'BUT NOT SURE IF MY ARGUMENTS AND RETURN VALUE ARE CORRECT
  12. returnValue = DataSourceUsers.Select(arguments)
  13. 'HERE I'M TRYING TO VIEW THE RESULTS ON THE FORM TO SEE WHAT HAPPENED
  14. TextBox1.Text = returnValue.ToString
Last edited by peter_budo : May 14th, 2008 at 2:02 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 3:58 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC