Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi all,

I have problem when run c# application on client machine. But that exception will not throw when run on visual studio 2010. When load data to table object exception was thrown at client machine.

I have used this code to select data:
C#
usra = (from usr in db.UserAs
                       where usr.UserName == uname &&
                       usr.UserPassword == password &&
                       usr.IsUserActive == true
                       select usr).FirstOrDefault();

UserAs -->table Object , uname and password are parameters

when run above code also run below code on db.designer.cs

C#
public ObjectSet<usera> UserAs
        {           
            get
            {
                if ((_UserAs == null))
                {
                    _UserAs = base.CreateObjectSet<usera>("UserAs");
                }
                return _UserAs;
            }
        }
        private ObjectSet<usera> _UserAs;


at this point exception was thrown on client machine but not on visual studio 2010. All related software has installed on client machine.

backend ismssql 2005.

Please help me to solve this problem.

Thanks,

Chamara
Posted
Updated 8-May-12 5:38am

1 solution

It would help when you add the exception message as well to your question. Now it is guessing. But there are things you can check.
If you are convinced it's not the software then it may be a database related problem.

Things I would check:

1) the connectionstring, is it the same?
2) did you copy the .config file as well to the client?
3) has the client access to the database?

I do not understand from your question where you run visual studio 2010. If it is not the same machine you can check for this as well:

1) is there a difference between OS versions? 32/64 bits
2) are the correct drivers installed 32/64 bits

I hope this helps you to find the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900