关于C#代码操作远程2003服务器的数据库和FTP的问题,很奇怪,请高手解答

over1982 2007-08-22 03:18:57
现在情况是这样的,有一个远程服务器 系统是2003,在上面搭建了数据库2000,和FTP服务器,本地用程序连接本地的数据库和FTP没有问题,但是一改成连接远程就有问题,连接远程数据库时报错
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
明明就是2000的数据库,却说我要连接的2005,很郁闷.连接数据库代码如下
SqlConnection cn = db.conn;
// Add file info into DB
string strQuery = "Delete from esPlatform_FileContent where fldGuid = "
+ "'" + FldGuid.ToString() + "'";
;
cn.Open();
SqlCommand sqlComm = new SqlCommand(strQuery, cn);


// Get new file ID
sqlComm.ExecuteNonQuery();
sqlComm.Dispose();

连接FTP的时候报错:由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败..手动通过IE访问FTP没有问题,一用代码连接就出错.....请高手解答!
...全文
93 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
优途科技 2008-09-22
  • 打赏
  • 举报
回复
downmoon 2008-07-18
  • 打赏
  • 举报
回复
参考

http://blog.csdn.net/downmoon/archive/2008/01/29/2071776.aspx
http://www.cnblogs.com/downmoon/archive/2008/01/29/1057726.html
yangpeiyu 2007-08-23
  • 打赏
  • 举报
回复
这个还没有遇到过.
over1982 2007-08-23
  • 打赏
  • 举报
回复
ding
wangfeizjk 2007-08-22
  • 打赏
  • 举报
回复
学习

110,567

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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