易截截图软件、单文件、免安装、纯绿色、仅160KB

Access数据库的连接方法

  这两天开始学习ACCESS数据库的连接,感觉不是特别的顺手,对数据库的连接的整个过程还不是特别的了解。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
string strPath = Application.StartupPath + "\\ip.mdb";
string ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:DataBase Password='" + this.textBox1.Text + "'; User Id=admin;Data source=" + strPath;
OleDbConnection oleCon = new OleDbConnection(ConStr);
OleDbDataAdapter oleDap = new OleDbDataAdapter("select * from ip", oleCon);
DataSet ds = new DataSet();
oleDap.Fill(ds, "ip");
this.dataGridView1.DataSource = ds.Tables[0].DefaultView;
oleCon.Close();
oleCon.Dispose();
}
catch (Exception ey)
{
MessageBox.Show(ey.Message);
}
}
}
}


相关文档:

Failed to access IIS metabase

Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: ......

"Failed to access IIS metabase"解决方法

原因:IIS没有注册,我是原有系统的IIS删了,造成运行IIS中的应用程序出现这种错误!
解决办法:
在CMD中进入目录C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727,运行aspnet_regiis
1、aspnet_regiis -ga administrator(administrator为当前用户)
2、aspnet_regiis -i (注册IIS)
3、iisreset /noforce (重启IIS)
......

SQLITE与ACCESS性能简单测试对比

这段时间在做CMS(客户管理系统,不是内容管理)的访问管理功能,要求实现对服务提供设备,客户端,计费,权限认证等信息的存储统计,远程管理。要求系统发布要方便,远程管理软件要跑在WIN平台。考虑到系统规模,客户要求,最后选择了WIN+ACCESS的方案,而最近又发现一个免费的SQLITE,而且可能在以后的手持设备上用,花点 ......

C#中使用DataTable显示Access数据库中文件列表


private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
             this.comboBox2.Items.Clear();
            switch(this.comboBox1.SelectedIndex)
       ......

ACCESS数据库存储大批量采集信息的问题

由于工作需要,使用ACCESS数据库存储港口周围AIS设备接收到的船舶数据。由于在全国很多港口有采集点,因此,数据量很大,每三分钟存储一次数据的话,那么一次将有2000多新的船位数据。这些数据入库后,数据库文件大小将新增1M到2M左右。根据这个频率,一个小时数据库文件将增加40M,一天就是960M。
为了提高数据库效率,我 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号