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

access 中的文本到数据类型的转换

用Cdbl()试试
CDbl(str)   -->   双精度
CInt(str)   -->   整型
CLng(str)   -->   长整型
CSng(str)   -->   单精度
CDate(str)   -->   日期型 ......

asp连接ACCESS数据库--未指定错误解决方法


今天把以前做的ASP网站放到IIS里面 突然出现数据库连接错误 输出来为未指定错误 郁闷!以前还是好好的 自己学C#的 对ASP不是非常了解 在网上查了一下 有银多原因 最大的可能是驱动错误,但是我试了我做的asp.ne的网站运行的好好的 应该不是驱动的问题 找了半天终于找到一个修改temp的权限 最终才解决 
修改 ......

解决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 ......

create table(access环境下)自动编号类型的写法

create table(access环境下)自动编号类型的写法
方法一:
create table tablename(id counter constraint primarykey primary key)
需要注意的地方是:第二个primary中间有空格,另外,关键字不区分大小写.
方法二:
create table mytb (id autoincrement(25,1) primary key,age int)

create table testtb (id aut ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号