How store sqlDataSource SELECT results in dataset?

V

VB Programmer

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!
 
V

Vijay

Take a look at the DataAdapater class.. that will help you store results in
a DataSet..

VJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top