if (!Page.IsPostBack )
ViewState["ID"]=Request.QueryString ["NewsID"];
sqlConnection1.Open ();
string strSQL = "SELECT * FROM News WHERE ID=" + ID;
DataSet objDataset;
objDataset=new DataSet();
sqlDataAdapter1.Fill(objDataset,"dstable");
Label1.Text =objDataset.Tables["dstable"].Rows [0][0].ToString ();
Label2.Text =objDataset.Tables["dstable"].Rows [0][1].ToString ();
Label3.Text =objDataset.Tables["dstable"].Rows [0][2].ToString ();
Label4.Text =objDataset.Tables["dstable"].Rows [0][3].ToString ();
我有这样一段代码 ,可是我对"string strSQL = "SELECT * FROM TABLE2 WHERE ID=" + ID"这段代码意思不太明白,有哪位能帮解释一下?
还有数据库中如果有多行,是不是需要将"Rows [0][0]"前一个0改为一个变量i,又该怎样定义变量i呢?