?
Solved

Asp.net with ms access update problem

Posted on 2012-09-06
5
Medium Priority
?
364 Views
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......
0
Comment
Question by:RadhikaVyas
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:plummet
ID: 38371658
Can you upload your code so we can work out where the problem might lie?
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 38372071
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
 

Accepted Solution

by:
RadhikaVyas earned 0 total points
ID: 38375155
I resolved the issue myself...I didn't put 'Ispostback ' condition in my page load..So now working fine..
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 38375225
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
 

Author Closing Comment

by:RadhikaVyas
ID: 38386105
No specific reason I found my mistake...Thanks for helping me...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 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