Click here to Skip to main content
15,920,956 members
Home / Discussions / C#
   

C#

 
QuestionBest way to access a database Pin
Terence van Schalkwyk2-May-10 9:09
Terence van Schalkwyk2-May-10 9:09 
AnswerRe: Best way to access a database [modified] Pin
PIEBALDconsult2-May-10 9:35
mvePIEBALDconsult2-May-10 9:35 
AnswerRe: Best way to access a database [modified] PinPopular
Pete O'Hanlon2-May-10 9:52
mvePete O'Hanlon2-May-10 9:52 
GeneralRe: Best way to access a database Pin
PIEBALDconsult2-May-10 9:56
mvePIEBALDconsult2-May-10 9:56 
GeneralRe: Best way to access a database Pin
Pete O'Hanlon2-May-10 10:10
mvePete O'Hanlon2-May-10 10:10 
GeneralRe: Best way to access a database Pin
PIEBALDconsult2-May-10 10:29
mvePIEBALDconsult2-May-10 10:29 
GeneralRe: Best way to access a database Pin
Pete O'Hanlon2-May-10 10:33
mvePete O'Hanlon2-May-10 10:33 
GeneralRe: Best way to access a database Pin
PIEBALDconsult2-May-10 10:53
mvePIEBALDconsult2-May-10 10:53 
GeneralRe: Best way to access a database Pin
Terence van Schalkwyk2-May-10 20:01
Terence van Schalkwyk2-May-10 20:01 
GeneralRe: Best way to access a database Pin
Pete O'Hanlon2-May-10 20:38
mvePete O'Hanlon2-May-10 20:38 
GeneralRe: Best way to access a database Pin
Terence van Schalkwyk2-May-10 20:58
Terence van Schalkwyk2-May-10 20:58 
GeneralRe: Best way to access a database Pin
Pete O'Hanlon2-May-10 21:21
mvePete O'Hanlon2-May-10 21:21 
QuestionRe: Best way to access a database [modified] Pin
Terence van Schalkwyk2-May-10 23:37
Terence van Schalkwyk2-May-10 23:37 
AnswerRe: Best way to access a database Pin
Pete O'Hanlon3-May-10 2:33
mvePete O'Hanlon3-May-10 2:33 
Terence van Schalkwyk wrote:
Its still not liking ConfigurationManager


You need to add a reference to System.Configuration. It's not included in your list of references - right click on your reference, select Add reference and choose it from the .NET tab.


Terence van Schalkwyk wrote:
_connectionString = ConfigurationManager.ConnectionStrings["connection_string_stored_in_config_file"]


Now that we know what you are going to call your connection string, change this line to:
_connectionString = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
The connection string you add in here largely depends on the database type and connection details. There is a handy online resource that shows many different types of connection string - it's available here[^].

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



Questionimage protect Pin
hameduser2-May-10 4:40
hameduser2-May-10 4:40 
AnswerRe: image protect Pin
Dave Kreskowiak2-May-10 5:51
mveDave Kreskowiak2-May-10 5:51 
GeneralRe: image protect Pin
AspDotNetDev2-May-10 14:14
protectorAspDotNetDev2-May-10 14:14 
GeneralRe: image protect Pin
loyal ginger2-May-10 14:32
loyal ginger2-May-10 14:32 
GeneralRe: image protect Pin
AspDotNetDev2-May-10 19:15
protectorAspDotNetDev2-May-10 19:15 
GeneralRe: image protect Pin
loyal ginger3-May-10 17:38
loyal ginger3-May-10 17:38 
GeneralRe: image protect Pin
Dave Kreskowiak2-May-10 14:38
mveDave Kreskowiak2-May-10 14:38 
GeneralRe: image protect Pin
AspDotNetDev2-May-10 19:20
protectorAspDotNetDev2-May-10 19:20 
GeneralRe: image protect Pin
Anthony Mushrow2-May-10 15:37
professionalAnthony Mushrow2-May-10 15:37 
GeneralRe: image protect Pin
AspDotNetDev2-May-10 19:19
protectorAspDotNetDev2-May-10 19:19 
QuestionDropDownList inside GridView Pin
msomar1-May-10 21:57
msomar1-May-10 21:57 

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.