Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

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


and the line that it errors on is:

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


and:

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


thank you very much if your able to point out my errors
:)
Posted
Updated 29-Jan-12 1:39am
v3

1 solution

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:
VB
Public ReadOnly Property Virus_Signature_Database_beConnectionString As String
   Get
      Return _someVar
      ' possibly Return _someConnection.ConnectionString
   End Get
End Property

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!
 
Share this answer
 
Comments
Dale 2012 29-Jan-12 17:59pm    
You are bang on the money with this but once I fix the section you say I get a new error white message:

Resource was of type 'Microsoft.VSDesigner.VSDesignerPackage.SerializableConnectionString' instead of String - call GetObject instead.

Please Help Im pulling my hair out over this thing.

thank you if you can and if you cant please let me know what else I can tell you to solve this issue.
Sander Rossel 29-Jan-12 18:14pm    
Are you sure your property is of type String?
Perhaps you would need something like:
Public Property Virus_Signature_Database_beConnectionString As Microsoft.VSDesigner.VSDesignerPackage.SerializableConnectionString

Don't know if that makes any sense, because I have no idea what it's talking about... :s
Dale 2012 29-Jan-12 19:13pm    
Maybe this might give you some insight as to the problem im having

<global.system.configuration.applicationscopedsettingattribute(), _
="" global.system.diagnostics.debuggernonusercodeattribute(),="" global.system.configuration.specialsettingattribute(global.system.configuration.specialsetting.connectionstring)=""> _
Public Property Virus_Signature_Database_be___CopyConnectionString() As String
Get
Return CType(Me("Virus_Signature_Database_be___CopyConnectionString"), String)
End Get
Set(value As String)

End Set
End Property
Sander Rossel 29-Jan-12 19:17pm    
This code looks very weird an unreadable... Sorry to tell you this, but you really need to use some more readable names. What does Me(stringParam) do? And why are you casting the result to a String? And what do you need the Attribute for? Why haven't you implemented the setter?...
Dale 2012 29-Jan-12 19:23pm    
This is all form generated code not anything I have done. the code is in my settings designer and was generated when I added my access database to my project. sounds lame to ask but what is the setter?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900