resolve the address to the Access database
来源:互联网 发布:台州椒江区网络诈骗 编辑:程序博客网 时间:2024/06/01 10:52
// resolve the address to the Access database
string fileNameString = this.MapPath(".");
fileNameString += "..\\..\\..\\..\\data\\chartdata.mdb";
// initialize a connection string
string myConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileNameString;
// define the database query
string mySelectQuery;
mySelectQuery = "SELECT REGIONS.RegionName, Sum(REPS_SALES.Sales) AS SumOfSales ";
mySelectQuery += "FROM REPS_SALES INNER JOIN REGIONS ON REPS_SALES.RegionID = REGIONS.RegionID ";
mySelectQuery += "GROUP BY REGIONS.RegionName;";
// create a database connection object using the connection string
OleDbConnection myConnection = new OleDbConnection(myConnectionString);
// create a database command on the connection using query
OleDbCommand myCommand = new OleDbCommand(mySelectQuery, myConnection);
// open the connection
myCommand.Connection.Open();
// create a database reader
OleDbDataReader myReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
// since the reader implements and IEnumerable, pass the reader directly into
// the DataBind method with the name of the Column selected in the query
Chart1.Series["Sales"].Points.DataBindXY(myReader, "RegionName", myReader, "SumOfSales");
// close the reader and the connection
myReader.Close();
myConnection.Close();
- resolve the address to the Access database
- Access the Address Book
- Add data to the Access database using ADO
- Query whether you have the access to a specific database
- Error code: 0x80004005 "The Microsoft Access database engine cannot open or write to the file ''
- Issue: Server principal is not able to access the database under the current security context
- The database has local access protection and you are not authorized to access it locally
- resolve the problem that IE7 cannot access the TD
- to designer about the database
- SOCI - The C++ Database Access Library
- Tell you how to resolve Oracle 10g EM login problem: The database status is currently unavailable.
- Database Engine service could not resolve the specified file location
- does not map back to the address
- Your server IP address is in the SORBS DNSBL database
- unable to resolve host address
- As the manager, how to resolve the contention.
- R to access the MS Access
- CCS3.3移植时cmd文件出错DMC Error: Non Aligned access to the configuration space address
- 关于HDS用户启用与USERDB用户启用情况表分析
- 从JSP页面向数据库提交信息,乱码。读取数据库中原有的中文信息不乱码
- ADHelper 活动目录用户操作类
- Chapter 12 Classes
- cocos2d编译错误之新老版本差异
- resolve the address to the Access database
- 程序的内存分布
- 使用libxml2读取文件解析xml
- Linux 挂载移动存储设备
- Apache HTTP Server服务器的使用
- 关于主板报警 在linux下通过发出接口命令触发蜂鸣器鸣叫代码
- delete和delete[] 的区别
- K8-MSSQL综合利用工具V1.1 可秒脱百万/千万记录数据
- Win32 平台下OpenSSL编写SSL,TLS程序