Solved with ms access update problem

Posted on 2012-09-06
Last Modified: 2012-09-11
Hi Everybody,
I am working with (ASP.Net with c#) Ms-Access database.
My problem is I need to edit My client profile.So I have put one hyperlink like 'Edit profile' which redirects to some aspx file...Here using Select query am displaying all his profile details in Page load...I have one update button now...In 'update button ' click i have written update query..My problem is My values are not getting updated when I debug also am getting previous values only which are loaded during my Page load...Please help me soon to solve this issue soon......
Question by:RadhikaVyas
    LVL 10

    Expert Comment

    Can you upload your code so we can work out where the problem might lie?
    LVL 26

    Expert Comment

    by:Alan Warren
    Possibly be needing a connection string in your web.config.
    If the db is in the App_Data folder, something like this will do:
        <remove name="ACE.OLEDB.12.0_cn"/>
        <add name="ACE.OLEDB.12.0_cn" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\thedbname.accdb" providerName="System.Data.OleDb"/>

    Open in new window

    Then if you are using a sql datasource with <updateparameters> or <insertparameters> defined, you will need to populate the parameters on the sqldatasource_updating and/or sqldatasource_inserting events.

    As far as I am aware parameters are not supported for ACE.OLEDB.12.0, when using the configure datasource wizard, but they are supported, just not for the wiz.

    So you could create an Access parameter query (stored procedure) that expects input params for updating or inserting.

    Then in the  sqldatasource_updating and/or sqldatasource_inserting events you would populate your input params.
    Protected Sub TheSqlDataSource_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles TheSqlDataSource.Inserting
            e.Command.Parameters("ID").Value = intID
            e.Command.Parameters("Title").Value = strTitle
            e.Command.Parameters("ClientName").Value = strClientName
            etc ...

    Open in new window


    Accepted Solution

    I resolved the issue myself...I didn't put 'Ispostback ' condition in my page load..So now working fine..
    LVL 26

    Expert Comment

    by:Alan Warren
    No objections to you closing the question, just like to say, it was a little difficult to determine the nature of the problem without any actual code to work with.

    It was like we were working in the dark here ";0)

    Glad you resolved the issue.
    Success with your app!

    Respectfully yours,

    Author Closing Comment

    No specific reason I found my mistake...Thanks for helping me...

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now