Can't connect to database in project

Blake81

Well-known member
Joined
Feb 23, 2006
Messages
304
Location
Georgia, USA
Programming Experience
1-3
I'm trying to populate a datagrid from a table, and I can connect when I set up the connection and see the fields of the table, but when I run the project, it says "Configuration system failed to initialize", and it highlights this line in the Designer file:

Return CType(Me("ConnectionString"),String)

That section of the Designer is this code:
VB.NET:
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]ReadOnly[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][SIZE=2] ConnectionString() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]String
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Get
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#800000]"ConnectionString"[/COLOR][/SIZE][SIZE=2]),[/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Get
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]
[/COLOR][/SIZE]

Thanks for any help.

 
Aha! I just fixed it. I changed that line to this:

Return "Data Source=myservername;Persist Security Info=True;User ID=sa;Password" & _
"=mypassword"
 
ermm.. im not sure youre really supposed to be messing around with the config settings code like that..

.Designer.vb shouldnt be edited. its contents will be overwritten by the IDE whenever a change is made that necessitates regeneration (in this case, adding, editing or removing a setting should do it). Fix the cause, not the symptoms.. ;)
 
Back
Top