-1
private void button1_Click(object sender, EventArgs e)
{
string CS = ConfigurationManager.ConnectionStrings["Test_Evaluate"].ConnectionString;
using(SqlConnection con = new SqlConnection(CS))
{
SqlCommand cmd = new SqlCommand("select * from Applicant_Details where ApplicantID like @ApplicantID", con);
cmd.Parameters.AddWithValue("@ApplicantID", RetrieveRecord_txt + "%");
con.Open();
SqlDataReader rd = cmd.ExecuteReader();
BindingSource source = new BindingSource();
source.DataSource = rd;
dataGridView1.DataSource = source;
}
}
和錯誤是什麼? – Guy