客户端计算机上抛出异常 [英] Exception throw on client machine

查看:119
本文介绍了客户端计算机上抛出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在客户端计算机上运行c#应用程序时出现问题.但是,在Visual Studio 2010上运行时,不会引发该异常.当将数据加载到表对象时,在客户端计算机上引发了异常.

我已使用此代码选择数据:

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:

usra = (from usr in db.UserAs
                       where usr.UserName == uname &&
                       usr.UserPassword == password &&
                       usr.IsUserActive == true
                       select usr).FirstOrDefault();


UserAs->表对象,uname和password是参数

当在上面的代码中运行时,也在 db.designer.cs
上的下面代码中运行


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

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

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



此时,在客户端计算机上引发了异常,但在Visual Studio 2010上未引发异常.所有相关软件都已安装在客户端计算机上.

后端ismssql2005.

请帮我解决这个问题.

谢谢,

Chamara



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

推荐答案

将异常消息也添加到问题中将很有帮助.现在正在猜测.但是有些事情您可以检查.
如果您确信它不是软件,则可能是与数据库有关的问题.

我要检查的事情:

1)连接字符串是否相同?
2)您是否也将.config文件复制到客户端?
3)客户端可以访问数据库吗?

从您的问题中我不明白您在哪里运行Visual Studio2010.如果不是同一台计算机,您也可以检查一下:

1)操作系统版本之间有区别吗? 32/64位
2)是否安装了32/64位的正确驱动程序

希望这可以帮助您找到问题所在.
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.


这篇关于客户端计算机上抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆