-1
如何使用連接到Access數據庫填充GridView
?如何使用到Access數據庫的連接填充GridView
到目前爲止,我有以下代碼:
OleDbConnection myConnection = default(OleDbConnection);
OleDbCommand myCommand = default(OleDbCommand);
string strSQL = null;
strSQL = "SELECT * FROM tblLoginInfo " + "WHERE username='" + CustID.Replace("'", "''") + "' " + "AND password='" + CustPass.Replace("'", "''") + "';";
myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source=" + Server.MapPath("login.mdb") + ";");
myCommand = new OleDbCommand(strSQL, myConnection);
myConnection.Open();
但現在該怎麼辦?