请帮助访问数据库只读异常! [英] Please Help with access database read only exception!!

查看:46
本文介绍了请帮助访问数据库只读异常!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当简单但访问量很大的数据库,但是一旦将其加载到我的项目中,添加适配器时它就会崩溃Visual Studio.net或错误.

错误是连接字符串是只读的?

我已经尝试了一切,并四处寻找可以更改连接字符串的方法,这样它不仅是只读的,而且除了沮丧和死胡同之外什么都没有.

没有人请帮忙吗?

我尝试添加一个sql数据库,但收到一条错误消息,该错误消息甚至在安装visual net 2008和sp1更新后读取了一些与该数据库不兼容的服务器2008信息.

我完全没有想法

我的适配器添加到load事件的行是

I have a fairly simple but large access database but once I load it to my project it either crashes Visual studio.net or errors when the adapter is added.

The error is connectionstring is read only?

I have tried everything and looked every where to find out how to change the connection string so that it is not read only but have come up with nothing but frustration and dead ends

wont anyone please help?

I have tried to add a sql database but I get a error which reads something about the database is not compatible up to server 2008 or something even after installing visual net 2008 and the sp1 update.

Im completely out of ideas

the line my adapter adds to the load event is

Me.MD5_Virus_DatabaseTableAdapter.Fill(Me.Virus_Signature_Database_beDataSet.MD5_Virus_Database)



错误所在的行是:



and the line that it errors on is:

Settings3.Virus_Signature_Database_beConnectionString = resources.GetString("Settings3.Virus_Signature_Database_beConnectionString")



和:



and:

Settings4.Virus_Signature_Database_beConnectionString = resources.GetString("Settings4.Virus_Signature_Database_beConnectionString")



非常感谢您指出我的错误
:)



thank you very much if your able to point out my errors
:)

推荐答案

种很难分辨的是,如果我们不知道什么是Settings3和4.但是,如果将鼠标悬停在Settings3/4.Virus_Signature_Database_beConnectionString上,请右键单击,然后在上下文菜单中单击转到定义",您可能会发现如下所示的内容:
Kind of hard to tell If we don''t know what Settings3 and 4 is. However, if you hover over Settings3/4.Virus_Signature_Database_beConnectionString, right click and in the context menu click ''Go to definition'' you''ll probably find something that looks like this:
Public ReadOnly Property Virus_Signature_Database_beConnectionString As String
   Get
      Return _someVar
      ' possibly Return _someConnection.ConnectionString
   End Get
End Property


如您所见,此属性没有设置器,这意味着您无法在类之外更改_someVar的值(除非有其他一些属性或方法对其进行更改).
您应该更改属性以便可以对其进行设置(删除ReadOnly关键字并添加Setter),或者找到另一个可以更改它的方法.
也许您应该寻找类似的内容:Settings3.Connection.ConnectionString.

祝您好运,希望对您有所帮助!


As you can see this Property has no Setter, this means you can not change the value of _someVar outside your Class (unless there is some other Property or Method that alters it).
You should either change the Property so that it can be set (deleting the ReadOnly keyword and adding the Setter), or find another method that can change it.
Perhaps you should look for something like: Settings3.Connection.ConnectionString.

Good luck and I hope it helps!


这篇关于请帮助访问数据库只读异常!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆