asp.net开发的Web程序连接本地SQL Server运行正常,但是连另外一台电脑上的SQL Server就出错。1000分求解

tian_wj 2004-09-10 06:05:12
根据我的测试,连接数据库是成功的,而且我同事另外一个.net开发的程序就可以。同时系统提示好象是我的程序里面的一个事物类(.cs)文件的一个事物出错。我的同事的程序没有使用事物类(.cs)文件。

万分感激,朋友们帮一下

出错信息如下:
Server Error in '/EL' Application.
--------------------------------------------------------------------------------

异常!
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: 异常!

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[Exception: 异常!]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +264
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +877
ETERNALASIA.EL.BusinessRules.Stock.GetInStockBillList(Int32 ActorID) in D:\WorkSpace\ELSystem\BusinessRules\Stock.cs:240
ETERNALASIA.EL.ELWeb.EA.ProStockManager.InStockBillList.BindGrdInBillList() in c:\inetpub\wwwroot\ELWeb\EA\ProStockManager\InStockBillList.aspx.cs:61
ETERNALASIA.EL.ELWeb.EA.ProStockManager.InStockBillList.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\ELWeb\EA\ProStockManager\InStockBillList.aspx.cs:31
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731


...全文
177 21 打赏 收藏 转发到动态 举报
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
jamzh 2004-09-11
  • 打赏
  • 举报
回复
要给点具体的信息
gccr 2004-09-11
  • 打赏
  • 举报
回复
你把连接的server改成IP地址试试,看行不行。不要用机器名。
tian_wj 2004-09-11
  • 打赏
  • 举报
回复
感谢各位兄弟姐妹的回复:
我的连接字符串应该没有问题啊。我都测试到已经通过用户验证拉。

另外,这个系统是Web的。
连接字符串
<add key="DSN" value="Data Source=172.29.12.30;initial catalog=ELSystem;uid=sa;pwd=xxx"/>
tian_wj 2004-09-11
  • 打赏
  • 举报
回复
InStockBillList.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

using ETERNALASIA.EL.BusinessRules;
using ETERNALASIA.EL.Common;
using ETERNALASIA.EL.Common.Data;

namespace ETERNALASIA.EL.ELWeb.EA.ProStockManager
{
/// <summary>
/// InStockBillList 的摘要说明。
/// </summary>
public class InStockBillList : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Literal ltMessage;
protected System.Web.UI.WebControls.DataGrid grdInBillList;
private UserInfo oUI;

private void Page_Load(object sender, System.EventArgs e)
{
initPage();
if(!IsPostBack)
{
BindGrdInBillList();
}
}

private void initPage()
{
oUI = new UserInfo(Session["UserID"]);

if (!oUI.IsExists)
{
Response.Redirect("../../Login.aspx");
}

if (oUI.CompType != CompType.EA)
{
Response.Write("<script>alert('你没有权限');history.go(-2);</script>");
Response.End();
}

// if(!oUI.CheckPurview("IStockBill","Search"))
// {
// Response.Write("<script>alert('你没有权限');history.go(-2);</script>");
// Response.End();
// }
}

private void BindGrdInBillList()
{
Stock stock=new Stock();
DataSet dsData=new DataSet();
dsData=stock.GetInStockBillList(oUI.UserID);

this.grdInBillList.DataSource=dsData.Tables[0].DefaultView;
this.grdInBillList.DataBind();
}

private void grdInBillList_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if(e.Item.ItemIndex>=0)
{
if(e.Item.Cells[6].Text=="0")
{
e.Item.Cells[6].Text="未录";
}
else if(e.Item.Cells[6].Text=="1")
{
e.Item.Cells[6].Text="录入";
e.Item.Cells[10].Enabled=false;
}

if(e.Item.Cells[7].Text=="0")
{
e.Item.Cells[7].Text="未审核";
e.Item.Cells[10].Enabled=false;
}
else if(e.Item.Cells[7].Text=="1")
{
e.Item.Cells[7].Text="通过审核";
e.Item.Cells[14].Enabled=false;
}

if(e.Item.Cells[8].Text=="0")
{
e.Item.Cells[8].Text="手工入库";
}
else if(e.Item.Cells[8].Text=="1")
{
e.Item.Cells[8].Text="外贸合同";
}
else if(e.Item.Cells[8].Text=="2")
{
e.Item.Cells[8].Text="调拨入库";
}

if(e.Item.Cells[9].Text!=" ")
{
e.Item.Cells[9].Text=Convert.ToDateTime(e.Item.Cells[9].Text).ToShortDateString();
}
}
}


private void grdInBillList_ItemCommand(object sender, DataGridCommandEventArgs e)
{
if(e.CommandName=="Select")
{
Response.Redirect("StoragePlaceInfo.aspx?id="+e.Item.Cells[11].Text+"&id1="+e.Item.Cells[12].Text+"&Type="+e.Item.Cells[13].Text);
}
if(e.CommandName=="CheckPass")
{
Stock stock=new Stock();
if(stock.ConfirmISBill(Convert.ToInt32(e.Item.Cells[11].Text)))
BindGrdInBillList();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.grdInBillList.ItemCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.grdInBillList_ItemCommand);
this.grdInBillList.PageIndexChanged += new System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.grdInBillList_PageIndexChanged);
this.grdInBillList.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.grdInBillList_ItemDataBound);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void grdInBillList_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
grdInBillList.CurrentPageIndex = e.NewPageIndex;
BindGrdInBillList();
}
}
}
tian_wj 2004-09-11
  • 打赏
  • 举报
回复
stock.cs:
using System;
using System.Data;
using System.EnterpriseServices;

using ETERNALASIA.EL.DataAcess;
using ETERNALASIA.EL.Common.Data ;
using ETERNALASIA.EL.Common ;


namespace ETERNALASIA.EL.BusinessRules
{
/// <summary>
/// Stock 的摘要说明。
/// </summary>
[Transaction(TransactionOption.RequiresNew)]
public class Stock : ServicedComponent
{
public Stock()
{

}

public DataSet GetInStockBillList(int ActorID)
{
try
{
using (ETERNALASIA.EL.DataAcess.Stock stock=new ETERNALASIA.EL.DataAcess.Stock())
{
DataSet dataset = stock.GetInStockBillList(ActorID);
ContextUtil.SetComplete();
return dataset;
}
}
catch(Exception e)
{
ContextUtil.SetAbort();
throw e;
}
}
}
}
hobowang 2004-09-10
  • 打赏
  • 举报
回复
把你机器的库弄出来,放到那上面去。。

用户名,密码也弄好,也可以用SSPI
ltq2001932 2004-09-10
  • 打赏
  • 举报
回复
学习中!!
noahart 2004-09-10
  • 打赏
  • 举报
回复
远程的那个库的和你本地的那个库结构是否一样!
应该是Stock.cs中的GetInStockBillList(Int32 ActorID)访问数据库报错,导致表示层InStockBillList.aspx.cs中的BindGrdInBillList()方法出错.
qingyuan18 2004-09-10
  • 打赏
  • 举报
回复
连接字符串贴出来看看。
RunatServer 2004-09-10
  • 打赏
  • 举报
回复
代码
ny_nicholas 2004-09-10
  • 打赏
  • 举报
回复
把连接字串贴出来看看
nswhy 2004-09-10
  • 打赏
  • 举报
回复
看看你的连接字符串,是不是一样
还有就是你的数据库登录用户名何密码是否相同
changlin365 2004-09-10
  • 打赏
  • 举报
回复
up
luckweb 2004-09-10
  • 打赏
  • 举报
回复
这个问题必需看代码一点一点调试了
dama2003 2004-09-10
  • 打赏
  • 举报
回复
代码...
hlzpf 2004-09-10
  • 打赏
  • 举报
回复
把连接部分贴出来!!帮你看看!!
bitsbird 2004-09-10
  • 打赏
  • 举报
回复
InStockBillList.aspx.cs 代码贴出来
bitsbird 2004-09-10
  • 打赏
  • 举报
回复
有没有代码出错的提示
lucky1983 2004-09-10
  • 打赏
  • 举报
回复
是啊 这样怎么看
kysyuan 2004-09-10
  • 打赏
  • 举报
回复
还有是在WEB FROM还是WINFORM,所采用的帐号是什么都有关系的,
加载更多回复(1)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧