1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
using System.Data; using System.Data.OleDb; string mySQL = "SELECT ProjectNo , ProjectName FROM M_Project"; OleDbCommand myCommand = new OleDbCommand(mySQL, myConn); myCommand.Connection.Open(); OleDbDataReader myReader = myCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection); while (myReader.Read()) { string strProjectNo = myReader.GetString(0)); string strProjectName = myReader.GetString(1)); } myReader.Close(); myConn.Close(); |
コメント