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

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.
可能的原因:
内存访问错误。应该是访问了不该访问的地方,可能是使用“野指针”访问造成的。比如访问一个已经释放了堆 ......

解决mysql“Access denied for user

解决mysql“Access denied for user
我的系统是ubuntu6.06,最近新装好的mysql在进入mysql工具时,总是有错误提示:
# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
使用网上介绍的方法修改root用户的密码:
# mysqladmin -uroot -p p ......

access 操作

1.now() 获取当前时间;
2.关于Access内部的模糊查询:
在C#里写应写成 Select * from Table Where Name Like '%ABC%' 
                        Select * from Table Where Name Like '_AB ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号