Click here to Skip to main content
12,239,778 members (63,330 online)
   

C#

 
GeneralRe: Save and Retrieve Image Pin
Richard MacCutchan31-Dec-12 23:50
mvpRichard MacCutchan31-Dec-12 23:50 
AnswerRe: Save and Retrieve Image Pin
Abhinav S29-Dec-12 0:38
mvpAbhinav S29-Dec-12 0:38 
GeneralRe: Save and Retrieve Image Pin
nirmalgopalakrishnan29-Dec-12 6:16
membernirmalgopalakrishnan29-Dec-12 6:16 
QuestionDynamic text box array and focus event Pin
Everetts28-Dec-12 9:41
memberEveretts28-Dec-12 9:41 
AnswerRe: Dynamic text box array and focus event Pin
Eddy Vluggen28-Dec-12 11:25
memberEddy Vluggen28-Dec-12 11:25 
GeneralRe: Dynamic text box array and focus event Pin
bambuz28-Dec-12 15:33
memberbambuz28-Dec-12 15:33 
GeneralRe: Dynamic text box array and focus event Pin
Everetts28-Dec-12 17:41
memberEveretts28-Dec-12 17:41 
QuestionConnection String in Properties.Settings Pin
TheJudeDude28-Dec-12 8:47
memberTheJudeDude28-Dec-12 8:47 
I am rewriting a desktop application in VS2010 that was written in .Net 1.1. While doing so, I decided to add a couple of features to the app. One is a data source for a drop down list. I am using a local database file (.sdf) for the data.
I noticed in the .Properties.Settings file that the connection string is a hard link to where I entered the file location (which is C:\Users\\Documents\db\). I need this to be more dynamic, due to the fact this app will be on many different computers.
I tried editing to :
"Data Source = " + System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) + @"\dbs\latefee.sdf")]
But I receive the following error at compile time:
Error	1	An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type	C:\Users\brian\AppData\Local\Temporary Projects\latefeedisc\Properties\Settings.Designer.cs	29	68	latefeedisc

How do I correct this?

Thank you in advance.
Jude

AnswerRe: Connection String in Properties.Settings Pin
SledgeHammer0128-Dec-12 9:27
memberSledgeHammer0128-Dec-12 9:27 
AnswerRe: Connection String in Properties.Settings Pin
Eddy Vluggen28-Dec-12 9:30
memberEddy Vluggen28-Dec-12 9:30 
GeneralRe: Connection String in Properties.Settings Pin
TheJudeDude28-Dec-12 9:49
memberTheJudeDude28-Dec-12 9:49 
GeneralRe: Connection String in Properties.Settings Pin
Eddy Vluggen28-Dec-12 10:01
memberEddy Vluggen28-Dec-12 10:01 
GeneralRe: Connection String in Properties.Settings Pin
PIEBALDconsult28-Dec-12 15:04
memberPIEBALDconsult28-Dec-12 15:04 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0129-Dec-12 8:18
memberSledgeHammer0129-Dec-12 8:18 
GeneralRe: Connection String in Properties.Settings Pin
PIEBALDconsult29-Dec-12 8:23
memberPIEBALDconsult29-Dec-12 8:23 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0129-Dec-12 8:29
memberSledgeHammer0129-Dec-12 8:29 
GeneralRe: Connection String in Properties.Settings Pin
PIEBALDconsult29-Dec-12 8:43
memberPIEBALDconsult29-Dec-12 8:43 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0129-Dec-12 8:47
memberSledgeHammer0129-Dec-12 8:47 
GeneralRe: Connection String in Properties.Settings Pin
PIEBALDconsult29-Dec-12 8:51
memberPIEBALDconsult29-Dec-12 8:51 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0129-Dec-12 8:56
memberSledgeHammer0129-Dec-12 8:56 
GeneralRe: Connection String in Properties.Settings Pin
jschell30-Dec-12 9:33
memberjschell30-Dec-12 9:33 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0130-Dec-12 9:56
memberSledgeHammer0130-Dec-12 9:56 
GeneralRe: Connection String in Properties.Settings Pin
jschell31-Dec-12 10:00
memberjschell31-Dec-12 10:00 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0131-Dec-12 11:11
memberSledgeHammer0131-Dec-12 11:11 
GeneralRe: Connection String in Properties.Settings Pin
jschell1-Jan-13 7:58
memberjschell1-Jan-13 7:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 28 Apr 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid