C# 连接sql2000数据库的问题 急待 你telnet IP 1433 试试..通不通.. 通的话就是没问题的、 不通的话,原因一,有可能是作为服务器的那台机器防火墙给阻挡了、 原因二,SQL没有打补丁、 原因三,其他.嘿嘿 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SQL2000的话~~应该要打上sp4的补丁 sql2000远程访问的话是要sql4以上的补丁才可以的你在查询分析器里面执行select @@version好像是低于8.01的要打补丁 我在服务器的防火墙里面添加了1433端口,为什么在本机telnet 192.168.0.101 1433 还是显示在1433端口连接失败 我先下载一个补丁看看,sql2005里面,好像也存在这个问题哦。本机程序打开可以访问数据库,其他局域网的机器上的程序也连不上数据库。大家遇到过没有? 1.防火墙影响,或者其他的一些杀毒之类的保护软件;2.sql中的配置,可能不允许远程登录3.还有可能是一些其他的恶意程序导致网路通讯问题 sql2000好像就是补丁的问题,安装了sp4的补丁后可以远程访问了谢谢大家。 namespace ad{ partial class f1 { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows 窗体设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.t1 = new System.Windows.Forms.Timer(this.components); this.tp_1_1 = new System.Windows.Forms.TabPage(); this.tc_1 = new System.Windows.Forms.TabControl(); this.tc_1.SuspendLayout(); this.SuspendLayout(); // // t1 // this.t1.Interval = 5000; // // tp_1_1 // this.tp_1_1.Location = new System.Drawing.Point(4, 21); this.tp_1_1.Name = "tp_1_1"; this.tp_1_1.Padding = new System.Windows.Forms.Padding(3); this.tp_1_1.Size = new System.Drawing.Size(630, 399); this.tp_1_1.TabIndex = 1; this.tp_1_1.Text = "我操"; this.tp_1_1.UseVisualStyleBackColor = true; // // tc_1 // this.tc_1.Controls.Add(this.tp_1_1); this.tc_1.Dock = System.Windows.Forms.DockStyle.Fill; this.tc_1.Location = new System.Drawing.Point(0, 0); this.tc_1.Name = "tc_1"; this.tc_1.SelectedIndex = 0; this.tc_1.Size = new System.Drawing.Size(638, 424); this.tc_1.TabIndex = 0; // // f1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.ClientSize = new System.Drawing.Size(638, 424); this.Controls.Add(this.tc_1); this.MaximizeBox = false; this.Name = "f1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "单机广告主窗体"; this.Load += new System.EventHandler(this.f1_Load); this.tc_1.ResumeLayout(false); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Timer t1; private System.Windows.Forms.TabPage tp_1_1; private System.Windows.Forms.TabControl tc_1; }} this.tp_1_1.Text = "我操 8; private ";;""; 1:保证你的程序写的没有问题!2:保证你的数据库安置的没有问题 !分类解决吧 1: SqlConnection conn1 = new SqlConnection(); conn1.ConnectionString = "server=168.1.1.242;database=erp2010;uid=sa;pwd=123456"; SqlCommand com = new SqlCommand(); com = new SqlCommand("update NJ001 set D='True' ,d_re='" + textBox3.Text.Trim() + "',d_DATE='" + System.DateTime.Now.ToString("yyyy-MM-dd") + "',d_man='" + DataClass.Class1.ID_Name + "' ,end_date='" + dateTimePicker1.Text + "' where cycode='" + textBox1.Text.Trim() + "'", conn1); if (conn1.State == ConnectionState.Closed) { conn1.Open(); } com.ExecuteNonQuery(); conn1.Close(); conn1.Dispose();2:如果是导入别的数据库的话 最好是要保证补丁一样 否则也有可能出问题! 然后最重要是我看你写的连接字符串好像是2005的吧.2000应该是server=168.1.1.242;database=erp2010;uid=sa;pwd=123456 C# api 调用 C#在线通讯 局域网内通讯 C#数组如何传递? -----------------C#问题非高手务进------------------- 一道面试题,哪位大哥会做呀?我没有分了。。。 请帮忙,OdbcDataAdapter.Fill出错,但是找不到原因 请教datagrid控件怎样手动来设置宽度 新版的qq表情怎么实现? 这段代码总是出错 谁给我讲讲C#中的引用的概念? 动态加载TreeView并对其操作 为了积分啊 怎么做最快啊
你在查询分析器里面执行select @@version好像是低于8.01的要打补丁
sql2005里面,好像也存在这个问题哦。本机程序打开可以访问数据库,其他局域网的机器上的程序也连不上数据库。大家遇到过没有?
2.sql中的配置,可能不允许远程登录
3.还有可能是一些其他的恶意程序导致网路通讯问题
谢谢大家。
{
partial class f1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region Windows 窗体设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.t1 = new System.Windows.Forms.Timer(this.components);
this.tp_1_1 = new System.Windows.Forms.TabPage();
this.tc_1 = new System.Windows.Forms.TabControl();
this.tc_1.SuspendLayout();
this.SuspendLayout();
//
// t1
//
this.t1.Interval = 5000;
//
// tp_1_1
//
this.tp_1_1.Location = new System.Drawing.Point(4, 21);
this.tp_1_1.Name = "tp_1_1";
this.tp_1_1.Padding = new System.Windows.Forms.Padding(3);
this.tp_1_1.Size = new System.Drawing.Size(630, 399);
this.tp_1_1.TabIndex = 1;
this.tp_1_1.Text = "我操";
this.tp_1_1.UseVisualStyleBackColor = true;
//
// tc_1
//
this.tc_1.Controls.Add(this.tp_1_1);
this.tc_1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tc_1.Location = new System.Drawing.Point(0, 0);
this.tc_1.Name = "tc_1";
this.tc_1.SelectedIndex = 0;
this.tc_1.Size = new System.Drawing.Size(638, 424);
this.tc_1.TabIndex = 0;
//
// f1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(638, 424);
this.Controls.Add(this.tc_1);
this.MaximizeBox = false;
this.Name = "f1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "单机广告主窗体";
this.Load += new System.EventHandler(this.f1_Load);
this.tc_1.ResumeLayout(false);
this.ResumeLayout(false);
} #endregion private System.Windows.Forms.Timer t1;
private System.Windows.Forms.TabPage tp_1_1;
private System.Windows.Forms.TabControl tc_1;
}
}
2:保证你的数据库安置的没有问题 !分类解决吧
1: SqlConnection conn1 = new SqlConnection();
conn1.ConnectionString = "server=168.1.1.242;database=erp2010;uid=sa;pwd=123456";
SqlCommand com = new SqlCommand();
com = new SqlCommand("update NJ001 set D='True' ,d_re='" + textBox3.Text.Trim() + "',d_DATE='" + System.DateTime.Now.ToString("yyyy-MM-dd") + "',d_man='" + DataClass.Class1.ID_Name + "' ,end_date='" + dateTimePicker1.Text + "' where cycode='" + textBox1.Text.Trim() + "'", conn1);
if (conn1.State == ConnectionState.Closed)
{
conn1.Open();
}
com.ExecuteNonQuery();
conn1.Close();
conn1.Dispose();2:如果是导入别的数据库的话 最好是要保证补丁一样 否则也有可能出问题!