Using SQLDataSource Has Me Baffled


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Using SQLDataSource Has Me Baffled

  1. #1
    Join Date
    Dec 2003
    Posts
    83

    Using SQLDataSource Has Me Baffled

    I'm new to using the SQLDataSource and I'm having problems making it... well... go

    What I need to do is very simple but everything I've seen on the web and MSDN goes into elaborate detail on using data bound controls which don't apply to my situation.

    Here's what I'm trying to do:
    I have a SQL Server 2000 stored procedure that accepts one parameter called "@input_text" and executes "SELECT * FROM MyTable WHERE Input_Text = @input_text"

    I know I can call a stored procedure using a SQLDataSource but I'm baffled as to how to do it and access the results of the query. I've tried picking apart the ridiculously complex exmples I've found online but I can't figure out what's going on in most of them.

    Maybe I'm thinking about this all wrong. If it's even possible, can anyone give me a VB example of how to simply execute a stored procedure using a SQLDataSource and then access the results?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    The SqlDataSource is designed to execute a query and display the results on a page. If that's not what you want to do, then you shouldn't use a SqlDataSource. If you don't want to display the result of the query on the page, what do you want to do with it?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Dec 2003
    Posts
    83
    In the example above using a stored procedure that does all the work I need to see if the text that a user enters into a textbox is already in the table. If it is then I need to direct them to a certain page. If it's not then I need to enter the data into the table using a different stored procedure and direct them to another page. Basically I don't need to display the data, I just need to get at it so I can use it behind the scenes. In fact in this case it would not be desirable at all for the data in the database to be displayed to the user.

    If SQLDataSource isn't the way to go, what would you recommend?
    Last edited by howiegoo; 07-31-2007 at 12:44 PM.

  4. #4
    Join Date
    Dec 2003
    Posts
    83
    As you suggested I believe I was misunderstanding the purpose of SqlDataSource and was trying to use the wrong tool for the job. I went back to the good old SqlDataAdapter and all is well now. Thanks for the help!

Similar Threads

  1. problem in sqlDataSource
    By ahsal in forum ASP.NET
    Replies: 1
    Last Post: 05-06-2007, 05:26 PM
  2. Replies: 1
    Last Post: 02-19-2007, 02:20 AM
  3. cookieParameter and SqlDataSource
    By dcampo in forum ASP.NET
    Replies: 1
    Last Post: 02-13-2007, 02:11 PM
  4. SQLDataSource record count
    By areid in forum ASP.NET
    Replies: 2
    Last Post: 12-29-2006, 06:37 PM
  5. Replies: 1
    Last Post: 03-14-2006, 09:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center