错误 1 当前上下文中不存在名称“tblstudent”
void FillNationality()
{
SqlConnection connection = new SqlConnection();
connection.ConnectionString = "Integrated Security=true; Initial Catalog = student; Data Source = Yudish-PC";
connection.Open();
SqlDataAdapter d = new SqlDataAdapter("select country from tbl_nationality", connection);
DataSet dt = new DataSet();
d.Fill(dt);
cmbnationality.DataSource = dt.Tables[0]; /// assign the first table of dataset
cmbnationality.DisplayMember = "country"; /// assign the column country to be displayed
cmbnationality.DataBindings.Add("SelectedValue", tblstudent, "nationality_id");
connection.Close();
}