回覆列表
  • 1 # epgti24751

    常用思路:利用datatable來儲存資料,然後遍歷。如string strsql="select a from test" SqlConnection conHand = new SqlConnection(strConnection); SqlDataAdapter adaHand = new SqlDataAdapter(strSql, conHand); if (conHand.State == 0) conHand.Open(); DataSet setHand = new DataSet(); adaHand.Fill(setHand, "tables"); setHand.RemotingFormat = SerializationFormat.Binary; conHand.Close(); datatable tmpTable=setHand.Tables[0];foreach(datarow tmpRow in tmpTable.rows){ consoles.writeline(tmpRow["a"].toString());}

  • 中秋節和大豐收的關聯?
  • 求推薦幾首舒緩心情的鋼琴曲?