小白,求大神解决一下,谢谢O(∩_∩)O谢谢

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Lesson2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

    private void Form1_Load(object sender, EventArgs e)
    {
        // TODO: 这行代码将数据加载到表“students.Student”中。您可以根据需要移动或删除它。
        this.studentTableAdapter.Fill(this.students.Student);
        DataGridViewDataLoad();
        ComboBoxDataLoad();
    }
    private void DataGridViewDataLoad(string sql = "select * from Student")
    {
        //创建SqlConnection、SqlDataAdapter和 DataSet的对象
        SqlConnection con = new SqlConnection("server=YUANZHANG-PC\\SQLSERVER; Initial Catalog=itcast;Integrated Security =true;");
        SqlDataAdapter adapter = new SqlDataAdapter(sql, con);
        DataSet ds = new DataSet();
        con.Open();
        //获取并填充数据
        adapter.Fill(ds);
        con.Close();
        //将获取的数据设置为控件的数据源
        dataGridView1.DataSource = ds.Tables[0];
    }
    /// <summary>
    /// 加载ComboBox中的数据
    /// </summary>
    private void ComboBoxDataLoad()
    {
        //清空ComboBox,防止重复绑定
        cmbSubject.Items.Clear();
        cmbSubject.Items.Add("全部");
        cmbSubject.SelectedIndex = 0;
        SqlConnection con = new SqlConnection("server=YUANZHANG-PC\\SQLSERVER;database=itcast;uid=sa;pwd=13201319");
        string sql = "select distinct subject from Student";
        SqlCommand cmd = new SqlCommand(sql, con);
        con.Open();-->显示这个地方有问题!问题如下!
        SqlDataReader reader = cmd.ExecuteReader();
        //reader的HasRows属性表示是否有返回数据
        if (reader.HasRows)
        {
            //Read()方法表示读取下一条记录,读到数据返回True,否则返回false
            while (reader.Read())
            {
                //将读取的第一列数据添加的下拉列表项中
                cmbSubject.Items.Add(reader[0]);
            }
        }
        //关闭对象
        reader.Close();
        con.Close();
    }
}

}

问题:
“System.Data.SqlClient.SqlException”类型的未经处理的异常在 System.Data.dll 中发生 其他信息: 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - 无法打开到 SQL Server 的连接)

谢谢大神!T^T

不是代码的问题,而是数据连接配置的问题
http://www.cnblogs.com/xpxu/archive/2010/01/29/1659476.html
http://blog.csdn.net/wedypei/article/details/3265200