0
當我PatientId
它工作正常更換EmerPacienti
,爲什麼發生?無效的列名工作正常
if (DropDownList3.SelectedItem.Value == "In-Pacient")
{
SqlDataAdapter Da = new SqlDataAdapter("select * from Ipacient where EmerPacienti=" + TextBox11.Text + "", cn);
//SqlCommandBuilder Cmd = new SqlCommandBuilder(Da);
DataSet Ds = new DataSet();
Da.Fill(Ds, "Ipacient");
GridView1.DataSource = Ds.Tables[0];
GridView1.DataBind();
您應該添加一個qoutes SELECT * FROM Ipacient其中EmerPacienti ='」 + TextBox11.Text +「'」 講究 –