1
OleDbConnection OleConn = new OleDbConnection();
2
OleConn.ConnectionString =
@"Provider=Microsoft.Jet.OleDb.4.0;data source=D:\WorkStation\Dialy_Sol\Dialy\Dialy.mdb";
3
OleDbCommand OleCmd = new OleDbCommand();
4
OleCmd.Connection = OleConn;
5
OleCmd.CommandType = CommandType.Text;
6
OleCmd.CommandText =
"SELECT Dialy_Content FROM Dialy_Info WHERE Dialy_Date='2008-5-2'";
7
if (OleConn.State == ConnectionState.Closed)
8
{
9
OleConn.Open();
10
}
11
string DialyContent = "";
12
byte[] Buff = new byte[1000];
13
OleDbDataReader OleReader = OleCmd.ExecuteReader();
14
while (OleReader.Read())
15
{
16
OleReader.GetBytes(0, 0, Buff, 0, 1000);
17
DialyContent += Encoding.Unicode.GetString(Buff);
18
}
< /span>19< span style="color: #000000;">
//DialyContent就是
读取出来后的中文

2

@"Provider=Microsoft.Jet.OleDb.4.0;data source=D:\WorkStation\Dialy_Sol\Dialy\Dialy.mdb";
3

4

5

6

"SELECT Dialy_Content FROM Dialy_Info WHERE Dialy_Date='2008-5-2'";
7

8

9

10

11

12

13

14

15

16

17

18

< /span>19< span style="color: #000000;">
