无法连接到网络中的数据库 [英] Unable to connect to a database in network

查看:103
本文介绍了无法连接到网络中的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在C#中创建了一个应用程序,该应用程序可以在本地机器(XP)上正常工作,但是当我在网络上安装该程序时,它无法连接到数据库,并且会引发错误:

I have created an application in C# which in working fine on local machince(XP) but when I install that program on network it is unable to connect to database and it throws error:

System.NullReferenceException: Object reference not set to an instance of an object.
   at QualiChem.PartyDetails.PartyDetails_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------


我正在5个PC互连的网络中工作.所有具有Windows XP的PC.我该怎么办?
请帮忙.


I am working in a network of 5 pc interconnected. All pc having windows Xp. What should I do?
Please help.

推荐答案

您的代码已损坏,因为它很烂.修正您的代码,使其正确编写,并且永远不会发生此错误.修复网络权限或连接字符串后,再修复代码,没有DB错误应导致此问题.
Your code is broken because it sucks. Fix your code, so that it''s written properly, and this error will never occur. Fix your network permissions or your connection string AFTER you fix your code, no DB error should result in this problem.


对象引用未设置为对象的实例
当您尝试访问对象值为NULL的对象的某些属性时,通常会发生此错误.

使用DEBUGGER并查看其位置并进行处理.您应该能够做到.可能在您的本地系统中该对象具有某些价值,但在服务器上则没有.您需要检查并修复该问题.
Object reference not set to an instance of an object
This error generally occurs when you try to access certain property of an object where objects value is NULL.

Use DEBUGGER and see where is that and handle it. You should be able to do it. Might be in your local system that object has some value but not on server. You need to check and fix that.


实际上,我正在使用集成的security = sspi,当我将用户名作为密码传递给它时,这是不允许的

我认为XP不允许通过网络进行集成安全性
actually i am using integrated security=sspi which is not allowing to do when i am pass user name as password it allowed

i think xp won''t allow integrated security over network


这篇关于无法连接到网络中的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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