473,395 Members | 1,678 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,395 software developers and data experts.

Problems with DetailsView and SQLDataSource - changing data source

I have a page with a DetailsView control and a SQLDataSource control.
The SQLDataSource control is connected to an Access database.
Everything works fine. Now I want to change the back end database from
Access to SQL Server. So I go in to the SQLDataSource and modify it to
connect to the SQL Server database. No problem. However, the
DetailsView control does not seem to pick up the changes. When I click
on the little shortcut menu (not sure what its proper name is) for the
DetailsView control and select Edit Fields, I get a dialog box where I
can configure the fields for the DetailsView. If I click on one of my
fields in the Selected Fields list and then look at the DataField
property in the BoundField properties list, there is nothing in the
drop down list. It's like the DetailsView control does not know what
all of the available bound fields are. So I cancel out of the dialog
box and click on Refresh Schema. However, when I do this I get an
error message that says the following: "Unable to retrieve schema.
Ensure that the ConnectionString and SelectCommand properties are
valid. An OLE DB Provider was not specified in the ConnectionString.
An example would be, 'Provider=SQLOLEDB;'."

Any ideas?


Jan 22 '07 #1
1 4250
I think I've figured out a solution but it seems really cruddy. If I
just create a new SQLDataSource on the page and then point it to the
SQL Server database it works fine. Then I have to modify the
DetailsView to use the new SQLDataSource instead of the old one. Then
I delete the old data source control.

But I'm starting to think that using these declarative data sources is
a gigantic mistake. I have an admin section for my site that has about
20 different pages. Each page has either a GridView or a DetailsView
control on it. And each page has at least one SQLDataSource control.
Some have more than one SQLDataSource control because of data drive
drop down lists. To switch from Access to SQL Server I have to modify
every page by adding a new SQLDataSource control and deleting the old
one. And I also have to modify the SQL because the Access parameters
used question marks and the SQL parameters use the @ symbol. What a
pain in the butt!

Is there a better way that I am missing? I read some Microsoft
articles about the ease and simplicity of using these new GridView and
DetailsView controls to create a quick and dirty admin section. And
the declarative data sources seemed easy enough. But it doesn't seem
very flexible.


Jan 22 '07 #2

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

Similar topics

by: stuart.d.jones | last post by:
Hi, I have a DetailsView control bound to a SqlDataSource. I've got everything working nearly as I want, but here's my problem. I have a table which has a Guid as a Primary Key, and a VarChar...
by: stuart.d.jones | last post by:
Hi, I'm using a detailsview control with an SqlDataSource control. My Update query isn't working, and I've narrowed it down to the optimistic concurrency parameters - i.e. when I comment them...
by: manuel.ricca | last post by:
Hello, I'm trying to create a table with 2 nested gridviews and then a DetailsView on the right. The DetailsView should show the details of the item selected in the 2nd (nested) GridView: My...
by: mike | last post by:
Hi, When I programatically Bind a DataSource to DetailsView it does not fire "ModeChanged" event. This is first time i am trying to use ASP.NET DetailsView control. I have played with some of the...
by: Marc | last post by:
Hi, I made a detailsview for inserting records. I also made a gridview for editing and deleting the same records. The keyfield is an autonumbering field in Access (pcnr). My problem is: I can...
by: bob | last post by:
Hi, When running this code, the detailsview doesn't get the focus. The fields of the detailsview are programmatically created. I use therefore the dtreader.FieldCount. What's wrong with...
by: kashif456 | last post by:
I can't figure out why I am getting error updating, deleting and inserting new rows. I am amble to get my dataview populated and also detailview populated: Here's my code: <%@ Page...
by: makennedy | last post by:
Hi Experts, Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere. Basically I have a TreeView Control which I have created...
by: =?Utf-8?B?QW5nZWw=?= | last post by:
I seem to understand how the control works as long as I mated to SqlDataSource or ObjDataSource it works fine. But I do not want to flatten my design in this manner. I am interested in how I can...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.