★从Access数据库里查询数据后 怎么用 Response.Write()直接把查询返回的数据输出在页面上?
string dbname;
dbname=Server.MapPath( "authors.mdb ");
myConnection = new OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source= " + dbname );
myConnection.Open();
myCommand = new OleDbCommand( "SELECT [member], [desc], [address], [image] FROM [member] " );
从Access数据库里查询数据后 怎么用 Response.Write()直接把查询返回的数据输出在页面上?
------解决方案--------------------oldDataReader dataReader =mycommd.ExecuteReader();
string str= " ";
然后while(datareader.read())
{
str+=datareader[ "member "].toString();
}
类似于这样去就行了.