DetailsView linked to GridView on accessdatasource. DetailsView disappears when select used

I've seen lots of people mentioning this problem, but still I haven't been able to figure out how to fix it.

Basically I am trying to implement the scenario mentioned in ''. They say that you can't addrows using the gridview on an access database, and so you have to use the detailsview in association with the gridview as they mention in their article.

So, I can get all that working fine, gridview is displayed, and detailsview is displayed and populated. But, when I go to use the 'Select' command on one of the rows of the GridView, instead of the DetailsView being populated with the new data, the DetailsView disappears altogether.

Now, this is probably because the DetailsView is not being populated at all. But, either way, I don't know how to fix it, I did not alter the project downloaded from '', but that's what happened. I've heard that it might have something to do with the DetailsView not being bound to the datasource on postback... but still, I'm not sure how to fix this.

Can anyone help?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

They've supplied the wrong format for the FilterExpression, which is built using String Format placeholders rather than the Parameters used by the 'Commands.

These placeholders are numbered, with 0 representing the first parameter in the FilterParameters collection, and so forth.  You specify the placeholder in the string by using set brackets around the index.  You further delimiting them by quotes if (and only if) the datatype is a string.

It's confusing and annoying, is it not?


Open in new window


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
AidenAAuthor Commented:
Hi, it's a bit irritating alright when something that looks like it should be easy ends up taking ages to solve! I think it would have taken me forever to figure that one out.

I'll accept that solution. But, I was just wondering if you might off hand have any idea about a related problem I have (I can open a new question if you do).

Obviously I'm applying the techniques listed in that webpage to my own project. But something inexplicable is happening. The Update query does nothing. It seems to happen when I use the ? symbol as in the queries shown below. I need to use the ? symbol to make changes to the row that I'm editing (I presume you know already, but the ? symbol specifies that you use the data that is already there for that selection, so you can input data and then use that data to update to the table).

But what's weirder, is that it works perfectly in the project I downloaded from ''. Everything looks fine... and I cannot see a difference between what they have done and what I have done. In fact, I basically used their objects and transferred the data from my table into theirs, deleting all their data of course and changing the queries to suit me... and it worked perfectly, the second query below worked fine! But, today I open it up again... and it is not working again?

Totally confused about that one also? Any ideas? (I will start a new question so let me know if you want me to do that)
This works:
UPDATE [User Information] SET [User Name] = ? WHERE (ID ='1234')
This does not work:
UPDATE [User Information] SET [User Name] = ? WHERE (ID = ?)

Open in new window

I'd need a bit more to go on.  The query itself looks perfectly fine, so the problem would lie either in the rest of the AccessDataSource, or the container that databinds with it.
AidenAAuthor Commented:
Yeah, I have no idea what could be wrong with this. Don't have enough experience with web programming yet.

I created a new question for it 'Simple Gridview Update query on accessdatasource not working' although this website did not allow me to attach a .aspx file to show the problem.

If you can take a look or give me an idea about how to proceed that would be great.
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.