Keyword not supported: 'sqldatasource'.

Hi Folks,

Been learning my way round Visual Studio 2010, asp.net 4.0 & C# and am stuck on something silly.
I'm trying to add a drop-down list which is databound to a table in my sql database - as far as I can tell from my book etc I've done things right but as soon as I reference my DataSourceID in the dropdownlist I get an error:
Keyword not supported: 'sqldatasource'.
Not sure what I'm missing?
BELOW: THE CODE IN MY PAGE
 <asp:DropDownList 
    ID="DropDownList1"
    DataSourceID="MyDataSource"
    AppendDataBoundItems="true"
    DataTextField="Description"
    DataValueField="OptionID"
    runat="server">
    </asp:DropDownList>
   
    <asp:SqlDataSource ID="MyDataSource"
     ConnectionString="<%$ connectionStrings:Scanning %>" 
     SelectCommand="Select * From [JobType]" 
     runat="server">
    </asp:SqlDataSource>
PAGE BEHIND CODE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class JobRequest : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
WEB CONFIG CONNECTIONSTRINGS:
<connectionStrings>
		<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
		<add name="Scanning" connectionString="SqlDataSource=servername; Initial Catalogue=Repro Tasklist;User ID=IntranetAdmin; Password=censored" providerName="System.Data.SqlClient"/>
    <add name="Intranet" connectionString="SqlDataSource=servername; Initial Catalogue=IntranetDB;User ID=IntranetAdmin; Password=censored" providerName="System.Data.SqlClient"/>
	</connectionStrings>

Open in new window

forstersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Muhammad ZamanSoftware Development LeadCommented:
Hi,

you have to define provider in your sqldatasource queries, select, update, delete etc

providerName="System.Data.SqlClient" as an attribute


Cheers
Den_HBRCommented:
Did you already tried 'Data Source' or 'Server' instead of 'sqldatasource?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
forstersAuthor Commented:
Ahhh thanks Den HBR you're right it was my connection string format that was causing the problem, I have now changed it to:

<add name="Intranet"
       providerName="System.Data.SqlClient"
connectionString= "server=OUR SERVER;database=OUR DATABASE;uid=USERNAME;pwd=PASSWORD"/>

Brilliant thanks for pointing me in the right direction.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.