查询加上条件即可。
SqlConnection cn = new SqlConnection();
cn.ConnectionString = "server=.;database=yourdb;uid=sa;pwd=pwd";
cn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = "select regdate from yourtable where carNO=@no";
cmd.Parameters.AddWithValue("@no",textBox1.Text.Trim());
var date = cmd.ExecuteScalar();
cn.Close();
if(date!=System.DBNull.Value )
{
this.textBox2.Text = date.ToString();
}
在查询click事件中写查询然后给textbox2赋值