473,320 Members | 2,189 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How store sqlDataSource SELECT results in dataset?

Asp.net 2.0...

I have an SqlDataSource on my aspx form. It's defined as...

<asp:SqlDataSource ID="sdsCoupons" runat="server" ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT ShoppingCoupons.*, CouponCode AS Expr1 FROM
ShoppingCoupons WHERE (CouponCode = @CouponCode)">
<SelectParameters>
<asp:ControlParameter ControlID="txtCouponCode" DefaultValue="000"
Name="CouponCode"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>

The SELECT statement get's it's value from a textbox field that the customer
fills in as you can see.

I want to "run" the SELECT statement and process the data returned by it. I
thought the easiest way would be to store the results of the SELECT into a
dataset and run thru it. Any ideas on how I can do it? Or, perhaps you
have a better way to do this...

Thanks!
Apr 8 '06 #1
1 8414
Take a look at the DataAdapater class.. that will help you store results in
a DataSet..

VJ

"VB Programmer" <do**@emailme.com> wrote in message
news:ev****************@TK2MSFTNGP03.phx.gbl...
Asp.net 2.0...

I have an SqlDataSource on my aspx form. It's defined as...

<asp:SqlDataSource ID="sdsCoupons" runat="server" ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT ShoppingCoupons.*, CouponCode AS Expr1 FROM
ShoppingCoupons WHERE (CouponCode = @CouponCode)">
<SelectParameters>
<asp:ControlParameter ControlID="txtCouponCode" DefaultValue="000"
Name="CouponCode"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>

The SELECT statement get's it's value from a textbox field that the
customer fills in as you can see.

I want to "run" the SELECT statement and process the data returned by it.
I thought the easiest way would be to store the results of the SELECT into
a dataset and run thru it. Any ideas on how I can do it? Or, perhaps you
have a better way to do this...

Thanks!

Apr 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jason Shohet | last post by:
I'm using the new SqlDataSource with the beta. Below I have my code: asp:SqlDataSource ID="ds" Runat="server" SelectCommand="SELECT employee_ssno, firstname, lastname FROM employee_temp order by...
8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
0
by: cyberbless | last post by:
I would like to dynamically assign a Select Statment to a a SqlDataSource. Problem is the SqlDataSource.Select() Command requires a "dataSourceSelectArgument" as one of its arguments. 1. What...
1
by: Donald Adams | last post by:
Can I use the SqlDataSource in code? First I used it to return some rows and that worked. Then I added the arguements so that I could do paging, but it threw and exception that I didn't set the...
1
by: VB Programmer | last post by:
I have a SqlDataSource I setup on an ASP.NET 2.0 webform. I setup the SELECT statement and it has 1 parameter, @ProductId. How do I, using VB.NET, store the results of that SELECT statement...
6
by: djc | last post by:
I had previously (in asp.net 1.1 and asp.net web matrix) just done this to populate a listbox with data from a database: ------------ this was from the page load event ---------------- 'fill...
6
by: Ken Fine | last post by:
I'm using SQLDataSource, which generates some kind of dataset, and then I attach that datasource to various data display controls such as DataList and repeater which loop through to the end of the...
1
by: Jason Huang | last post by:
Hi, I would like to know what the DataSet name is and where the DataSet is for a SqlDataSource like this: <asp:SqlDataSource ID="SqlDataSourceA" runat="server" ConnectionString="<%$...
2
by: Jason Huang | last post by:
Hi, I would like to know what the DataSet name is and where the DataSet is for a SqlDataSource like this: <asp:SqlDataSource ID="SqlDataSourceA" runat="server" ConnectionString="<%$...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.