易截截图软件、单文件、免安装、纯绿色、仅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: ......

SQLITE与ACCESS性能简单测试对比

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

0xC0000005: Access Violation

vc编程debug时提示
First-chance exception in exShowBmp.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in exShowBmp.exe: 0xC0000005: Access Violation.
可能的原因:
内存访问错误。应该是访问了不该访问的地方,可能是使用“野指针”访问造成的。比如访问一个已经释放了堆 ......

C#读写Access数据库的OLE对象字段

(一)把文件内容写入Access数据库的OLE对象字段中:
if (File.Exists(txtBrow.Text) != false)   // 文本框txtBrow中内容为文件路径及文件名
{
     //获取文件后缀
     FileInfo p = new FileInfo(txtBrow.Text.Trim());
     F_str_Type = ......

Access中update能执行,VS下曝语法错误的怪异现象解决

        一直坚信自己SQL语句玩的还是不错的,但是这个怪异的问题还是一直弄得我很狼狈,一上午的时间没找到原因,oracle, MSSQL,MySQL,DB2都玩过,就没这么郁闷过。。从类型对应到字段。。再到数据库管理设置。。所有能检查的都检查了。。还没找到。。最后找到原因了。。sum us ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号