GridView1不显示SQL语句带来的数据 为:
... {用于选择放置SQL语句的属性和条件的语句} (关于SQL的示例:SELECT [患者] .name_ Patient来自患者,visitFACTABLE,日期时间,疾病,其中[患者] .Id_ Patient = [visitFACTABLE] .Id AND [visitFACTABLE] .Id = [datetime] .Id_datetime AND [Patient] .gender_ Patient = “男”)
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
con.Open();
string q_sql = "SELECT " + slct + " FROM patient, visitFACTABLE, datetime, disease WHERE [patient].Id_patient = [visitFACTABLE].Id AND [visitFACTABLE].Id = [datetime].Id_datetime " + w;SqlDataAdapter da = new SqlDataAdapter(q_sql, con);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();