Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2008, 05:35 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default data source

Hello!
I'm trying to set a data source with below code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:QCConnectionString %>"
SelectCommand="SELECT * FROM tbQC where Project=a " ProviderName="<%$ ConnectionStrings:QCConnectionString.ProviderName %>">
                            <SelectParameters>
a is my drop down list value that I've set it: a=DL.SelectedItem.Value
but it gives me error(It could'nt declare 'a'
Would you please help me to make above ds useable.
Thank you
Hasti

 
Old March 30th, 2008, 10:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there.. If project is of type varchar (or string or something like that), the query should be
Code:
SELECT * FROM tbQC where Project='a'
HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old March 31st, 2008, 12:47 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

Dear Gonzalo
I tried it too. But since is a parameter not a value it doesn't give me the correct answerIt thinks that it should give back all records that have projec=a but a is parameter and it should give back fore example all records that have project=x when the value of a=x.
I'm looking forward for your kindly help.
Thank you
Hasti

 
Old March 31st, 2008, 09:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Ok.. then you should build that string using the auto builder that it's inside VS. It will let you add a parameter (you should define the parameter and also inside the query it should be %parameter)

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old April 4th, 2008, 11:13 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

Thank you for your help.It works right now






Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Source teddyk ASP.NET 2.0 Basics 1 July 23rd, 2008 08:55 AM
data source... rupen Access VBA 5 August 1st, 2007 06:10 AM
Re: Browsing to Data Source dazzer General .NET 0 March 17th, 2004 08:59 AM
Excel as Data Source bmains ADO.NET 2 February 5th, 2004 04:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.