RadhikaVyas
asked on
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......
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......
Can you upload your code so we can work out where the problem might lie?
Possibly be needing a connection string in your web.config.
If the db is in the App_Data folder, something like this will do:
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.
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>
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 ...
Alan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
It was like we were working in the dark here ";0)
Glad you resolved the issue.
Success with your app!
Respectfully yours,
Alan
ASKER
No specific reason I found my mistake...Thanks for helping me...