این خطایی که شما گفتید ماله زمانی هستش که نوع کانکشنتون غلطه و C#‎ نمیتونه به دیتابیس شما وصل بشه این یک نوع صحیح ساختن کانکشن هستش

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


namespace WindowsFormsApplication21
{
public partial class Form1 : Form
{
bool newMode;
DataSet ds = new DataSet();
string strSql;
string strCon = "Data Source = KEIVAN-4A994B5F ; Initial Catalog = Student ; Integrated Security = True";
SqlDataAdapter da;
SqlConnection con;
DataRow newRow;
SqlCommandBuilder cb;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
newMode = false;
strSql = "SELECT * FROM stTable";
con = new SqlConnection(strCon);
con.Open();
da = new SqlDataAdapter(strSql, con);
da.Fill(ds, "stTable");
textBox2.DataBindings.Add(new Binding("Text", ds, "stTable.stNo"));
textBox3.DataBindings.Add(new Binding("Text", ds, "stTable.Name"));
textBox4.DataBindings.Add(new Binding("Text", ds, "stTable.Ave"));
checkBox1.DataBindings.Add(new Binding("Checked", ds, "stTable.Sex"));
textBox5.DataBindings.Add(new Binding("Text", ds, "stTable.numUnit"));
con.Close();
}

}



اینم یک سایت برای آموزش ساختن کانکشن