473,325 Members | 2,860 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,325 software developers and data experts.

datasource cannot be set declaratively

I have a dropdown list in an item template of a gridveiw.
I get the error "datasource cannot be set declaratively" when I try and
assign an sqldatasource to the dropdown list.
<ItemTemplate>
<asp:DropDownList ID="RideDates" runat="server"
DataSource="RideDatesSqlDataSource">
</asp:DropDownList>
</ItemTemplate>

Any ideas why this happens?

Thanks.
Apr 3 '06 #1
2 4558
Does it work with DataSourceId?

DataSource will bind your list to an IEnumerable, IListSource etc.
DataSourceId binds to a declarative data control.

Apr 3 '06 #2
Thanks, I guess I should lay programming in the wee hours of the morning!

"Flinky Wisty Pomm" wrote:
Does it work with DataSourceId?

DataSource will bind your list to an IEnumerable, IListSource etc.
DataSourceId binds to a declarative data control.

Apr 3 '06 #3

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

Similar topics

1
by: mali_djuro | last post by:
Hi all, i try to connect to the Oracle database through the DataSource, here is code that i used <% .... String error = new String(); try { java.util.Properties parms = new...
3
by: lee_mcknight | last post by:
I am using Crystal Enterprise V9. I have a report that needs to have multiple datasets as the datasource(s) on a single subreport (some common lookup data I need to join to is stored in a seperate...
0
by: BM | last post by:
Hi, I have started to develop an web application, with VS 2005 beta 2. This application has many web forms mainly based on SQLDataSource and GridView, FormView, DetailView. Everithing done...
4
by: Stephen | last post by:
IN VB.NET I have a form with a ListBox and would like to set the DataSource property at design-time but I can't seem to declare any kind of variable that will show up in the list. I have tried a...
2
by: Richard Brown | last post by:
Hi, I have a base class (which inherits from System.Web.UI.Page) for all the pages in my application. I have a property defined on this class that I want to set declaratively in the .aspx...
4
by: Narshe | last post by:
If I create a datagrid, and set a source and bind it, the data shows up fine. When a postback occurs, the DataGrid.DataSource == null. Is there something in the web.config I'm missing? This is...
4
by: SHEBERT | last post by:
Here is an example of a SortedList that works as a datasource to the ComboBox and a generic SortedList<that does not works as a datasource to the ComboBox. Why? If I use List and generic List<>,...
0
by: cannontrodder | last post by:
Hi, I've created a custom control yet when I add the attribute ListStyle="astyle" to my declaration, I get the error: "The 'ListStyle' property cannot be set declaratively." It shows up in...
3
by: Deere | last post by:
I have a gridview where I was using datasource="sqldatasource1". I deleted it to use code behind. I then wanted to go back to datasource so I typed back in datasource="sqldatasource1" but now...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
1
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.