Search the web
Sign In
New User? Sign Up
CSCI-E237-Fall2009
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
SubmitChanges() weird behavior   Message List  
Reply | Forward Message #158 of 400 |
Re: SubmitChanges() weird behavior

I think I found the problem.
Followed following thread at
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/565f\
3649-48fd-4b7f-b062-df8aee57bcfa


Apparently, I had to set my DataDirectory value in the connection string
explicitly using AppDomain.SetData() method.

My guess is that, otherwise, database was not found, and that's why records were
not updated. However, application didn't throw any errors.

If anyone interested also interesting post:
http://waxtadpole.wordpress.com/2008/05/08/linq-contextsubmitchanges-does-not-ad\
d-record-to-database/


And the link from it:
http://www.codinghorror.com/blog/archives/001079.html

Main idea - 'always assume the problem is in your code' :)))
I found that article pretty interesting and somewhat funny.


Thanks for the help



--- In CSCI-E237-Fall2009@yahoogroups.com, Ayman Ali <alialiayman@...> wrote:
>
> you can set a trace in SQL server to see if your SQL arrived to the SQL
> server at all.
> Usually this happens if the table does not have a primary key, submit
> changes does not submit and also does not throw an error.
>
> if the problem is something else, you can findout about it by getting the
> SQL received by SQL server (by setting a trace), run it yourself in
> management studio, when you do that you will see the error right there in
> management studio.
>
> you may also find that there is some conflict between the object model and
> database.
>
> here is some more info about how submit changes work
> http://msdn.microsoft.com/en-us/library/bb399378.aspx
>
> <http://msdn.microsoft.com/en-us/library/bb399378.aspx>here is some article
> about missing primary key problem
> http://forums.asp.net/t/1241069.aspx
>
> <http://forums.asp.net/t/1241069.aspx>
>
> On Fri, Oct 2, 2009 at 1:50 AM, rumbergd <rumbergd@...> wrote:
>
> >
> >
> > Lots of fun with SubmitChanges function on inserting a row:
> >
> > 1) outside the visual studio everything works fine
> >
> > 2) inside visual studio when i run program, and insert a row for example it
> > adds a row. But when I exit and check the table in Server Explorer, and do
> > 'show table data' nothing is changed... Even if refresh data nothing
> > happens.
> > I checked all connection strings are ok.
> >
> > Does anyone know what's going on here?
> >
> >
> >
>





Fri Oct 2, 2009 1:59 pm

rumbergd
Offline Offline
Send Email Send Email

Forward
Message #158 of 400 |
Expand Messages Author Sort by Date

Lots of fun with SubmitChanges function on inserting a row: 1) outside the visual studio everything works fine 2) inside visual studio when i run program, and...
rumbergd
Offline Send Email
Oct 2, 2009
5:51 am

you can set a trace in SQL server to see if your SQL arrived to the SQL server at all. Usually this happens if the table does not have a primary key, submit ...
Ayman Ali
aymansungard
Offline Send Email
Oct 2, 2009
11:39 am

I think I found the problem. Followed following thread at ...
rumbergd
Offline Send Email
Oct 2, 2009
1:59 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help