I'm new to ASP.NET world, I have been using VS last-time in 1997 ...
I'm building a small healthcare web application, using MVC3 and MySql and the MySql connector.
When building locally on my PC, my application can access the remote MySQL database, no problem.
For example the membership and profile providers work well on remote database, also my application can read and write the application user content database.
When I deploy to a remote server (accessing exactly the same database), everything works as from my PC, except that
I cannot add or delete items in any of the application content database tables. Adding works with membership and profile providers still.
For example the below code deletes a row when run on PC but does nothing when run on remote hosting account (exactly the same remote database in question).
Feels like a (write) access rights problem, but perhaps something else any ideas how do I solve this?
MYSQL5_853266_laiffii1Entities
E = newMYSQL5_853266_laiffii1Entities();
var
query = (frommeals
in
E.meals where
meals.id == id select
meals);
var
q = query.First();
E.meals.DeleteObject(q);
E.SaveChanges();
One more note: I use exactly the same connection strings and webconfig on debug and release deploy.
Kelpieracer
Member
12 Points
9 Posts
AddObject and DeleteObject to MySQL database work from PC but not on release server
Dec 30, 2011 08:18 PM|LINK
Hi, My first post here
I'm new to ASP.NET world, I have been using VS last-time in 1997 ...
I'm building a small healthcare web application, using MVC3 and MySql and the MySql connector.
When building locally on my PC, my application can access the remote MySQL database, no problem.
For example the membership and profile providers work well on remote database, also my application can read and write the application user content database.
When I deploy to a remote server (accessing exactly the same database), everything works as from my PC, except that I cannot add or delete items in any of the application content database tables. Adding works with membership and profile providers still.
For example the below code deletes a row when run on PC but does nothing when run on remote hosting account (exactly the same remote database in question).
Feels like a (write) access rights problem, but perhaps something else any ideas how do I solve this?
MYSQL5_853266_laiffii1Entities E = new MYSQL5_853266_laiffii1Entities();
var query = (from meals in E.meals where meals.id == id select meals);
var q = query.First();
E.meals.DeleteObject(q);
E.SaveChanges();
One more note: I use exactly the same connection strings and webconfig on debug and release deploy.
Kelpieracer
Member
12 Points
9 Posts
Re: AddObject and DeleteObject to MySQL database work from PC but not on release server
Jan 01, 2012 09:12 PM|LINK
As typical, found a bug in my own code. I had forgotten a .ToLower() from userName check ... Sorry and thanks for reading