• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

Asp.net with ms access update problem

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......
0
RadhikaVyas
Asked:
RadhikaVyas
  • 2
  • 2
1 Solution
 
plummetCommented:
Can you upload your code so we can work out where the problem might lie?
0
 
Alan WarrenApplications DeveloperCommented:
Possibly be needing a connection string in your web.config.
If the db is in the App_Data folder, something like this will do:
<connectionStrings>
    <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"/>

  </connectionStrings>

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

Alan
0
 
RadhikaVyasAuthor Commented:
I resolved the issue myself...I didn't put 'Ispostback ' condition in my page load..So now working fine..
0
 
Alan WarrenApplications DeveloperCommented:
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,
Alan
0
 
RadhikaVyasAuthor Commented:
No specific reason I found my mistake...Thanks for helping me...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now