473,466 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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?

Thanks,
Corey

Jan 22 '07 #1
1 4252
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.

Thanks,
Corey

Jan 22 '07 #2

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

Similar topics

3
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...
2
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...
0
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...
0
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...
1
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...
0
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...
1
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...
2
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...
3
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...
0
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...
0
marktang
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,...
0
Oralloy
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.