返回首页

我有2个btnSave的Click事件中使用的方法,起初我还以为连接是确定的和什么是错用SQL,但通过离职后,我得到一个错误连接时试图打开(conn.Open( );}

真的很感谢任何帮助。
以下是错误信息:

[System.Data.SqlClient.SqlException] = {"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (p...

这里是我的代码:

{C}
关于

ð

回答

评论会员:deanmichaelcook 时间:2012/02/07
!我已经解决了自己的解决方案是一个@符号

这:{C2的}
应该是这样的:{体C3}
叹息LOL

感谢任何意见。

关于

评论会员:游客 时间:2012/02/07
SajithDilhan:检查SQL服务器运作良好或不转到SQLServer配置管理和检查所有相关的服务是否正在运行:爱德华・卢
喜deanmichaelcook,

你尝试调试它呢?上线/部分没有出现错误?

的问候,
爱德华

尝试这样做:

{
/ /向下移动
SqlCommand的CMD =新的SqlCommand(sqlInsert,CONN);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@客户",this.Client)
,cmd.Parameters.AddWithValue("联系",this.Contact)
cmd.Parameters.AddWithValue("地址",this.Address)
cmd.Parameters.AddWithValue("@电话",this.Telephone)
cmd.Parameters.AddWithValue("@ Jobcount",this.NumberOfJobs)
cmd.Parameters.AddWithValue("@ Lastjob",this.LastJob)
conn.Open();
cmd.ExecuteNonQuery()
}

希望这个工程。

问候。