Dim cnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("Test.mdb")
Dim strSQL As String = "SELECT TOP 21 Title,CreateDate FROM Document ORDER By CreateDate DESC"
Dim cn As New OleDbConnection(cnString)
cn.Open()
Dim cmd As New OleDbCommand(strSQL, cn)
Dim db As OleDbDataReader
db = cmd.ExecuteReader(CommandBehavior.CloseConnection)
DataGrid1.DataSource = db
DataGrid1.DataBind()
cn.Close()
cn = Nothing
cmd = Nothing
db.Close()
db = Nothing
Dim strSQL As String = "SELECT TOP 21 Title,CreateDate FROM Document ORDER By CreateDate DESC"
Dim cn As New OleDbConnection(cnString)
cn.Open()
Dim cmd As New OleDbCommand(strSQL, cn)
Dim db As OleDbDataReader
db = cmd.ExecuteReader(CommandBehavior.CloseConnection)
DataGrid1.DataSource = db
DataGrid1.DataBind()
cn.Close()
cn = Nothing
cmd = Nothing
db.Close()
db = Nothing
解决方案 »
- ADO.NET 实体类数据模型这个是干嘛用的,怎么用
- 一个文本内容解析的请教
- NumericUpDown 控件能让它输入负值吗
- 容器内控件布局问题(在线等)
- 如何把字符型转换成double型??(急,请进,谢谢了!!)
- [winform]点击任务栏图标的消息时多少?非托盘图标
- 新人学习.NET,使用DataSet疑问,请教大家帮忙啊!!!急!!!
- 运行时提示".net数据 ole db 提供程序(system.data.oledb)要求microsot 数据访问组件(mdac)2.6或更高版本,发现当前安装的是2.52
- C# WebClient对象如何获取响应头Location所指的地址?
- delete ,update,insert无法操作
- 菜问题,怎么弄带输入框的messagebox?
- 100分相送:datagrid+数据更新问题
改为了string myConnectString = "provider=microsoft.jet.oledb.4.0;Data Source=" + "db1.mdb";
并且把数据库放在了bin目录下
还是不行,错误一样是什么原因啊
string strcon="update nssbb set 字段名='"+textbox1.text+"'"+"where 字段名='"+textbox2.text+"'"
是这样我更新的那句话中djbh是主键,字符型,我现在要再加两个字符BA,这个语句怎么写,你上面的例子不行的