本文介绍了如何从数据库中读取数据的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! string strDSN = @ Provider = Microsoft.Jet.OLEDB.4.0; Data Source = d:\ diyy.mdb; string strSQL = SELECT * FROM project其中ID =' + dbProjID + '; // 创建ADOConnection对象和ADOCommand OleDbConnection myConn = new OleDbConnection(strDSN); OleDbDataAdapter myCmd = new OleDbDataAdapter(strSQL,myConn); myConn.Open(); DataSet dtSet = new DataSet(); myCmd.Fill(dtSet, Developer); DataTable dTable = dtSet.Tables [ 0 ]; foreach (DataRow dtRow in dTable.Rows) { table.AddCell(dtRow [i] .ToString()); } 解决方案 string strDSN = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\diy.mdb"; string strSQL = "SELECT * FROM project where ID='" + dbProjID + "'"; // create Objects of ADOConnection and ADOCommand OleDbConnection myConn = new OleDbConnection(strDSN); OleDbDataAdapter myCmd = new OleDbDataAdapter(strSQL, myConn); myConn.Open(); DataSet dtSet = new DataSet(); myCmd.Fill(dtSet, "Developer"); DataTable dTable = dtSet.Tables[0];foreach (DataRow dtRow in dTable.Rows) { table.AddCell(dtRow[i].ToString()); } 解决方案 这篇关于如何从数据库中读取数据的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-08 05:47