Click here to Skip to main content
       

C#

 
QuestionXML Serialization with large objects [modified] PinmemberKishore Hyd10-Nov-12 13:31 
AnswerRe: XML Serialization with large objects PinmemberEddy Vluggen11-Nov-12 0:35 
QuestionInheritance of an Abstract Class [modified] PinmemberASPnoob10-Nov-12 11:45 
AnswerRe: Inheritance of an Abstract Class PinmemberMycroft Holmes10-Nov-12 14:21 
AnswerRe: Inheritance of an Abstract Class PinmemberAlan N10-Nov-12 14:27 
GeneralRe: Inheritance of an Abstract Class PinmemberASPnoob10-Nov-12 15:24 
AnswerRe: Inheritance of an Abstract Class PinmemberRichard Deeming12-Nov-12 3:09 
QuestionC# issue: connection string to app.config file Pinmemberrachel_m10-Nov-12 9:05 
In a C# 2008 application, I used linq to sql to connect to a sql server 2008 database. Now I want to obtain the connection of the database from the
app.config file instead of hardcoding the value into the application. I want to be able to change the connection string to the database since I will be moving this application from unit testing database to user acceptance database to the the prodction database.
 
Right now I am getting the error message, ""Object reference not set to an instance of an object." I know this error message is coming from the line of code that I listed below since it is the only line of code I changed.
 
The following is a snippet of the code from the *.designer.cs file (this is part of the dbml file).
 
using System.Configuration;
 
public esampleDataContext() : 
 base(ConfigurationManager.ConnectionStrings["sample.Properties.Settings.DEVConnectionString"].ConnectionString,mappingSource)
 
**Note:  base(global::sample.Properties.Settings.Default.DEVConnectionString, mappingSource) is the line of code that I replaced that was generated by the
         .net framework
I want to mention the following:
1. The *.dbml file is associated with a particular project file.
2. The connection string settings for this *.dbml file are the following:
a. DEVConnectionString (settings)
b. Connection String = Data Source=dev1;Initial Catalog=DEV_test;Integrated Security=True
c. application settings=True
d. settings property name is DEVConnectionString.
3. The project file that has the *.dbml file. has a reference set to the system.configuration.
 
**Note: This code in similar applications that I wrote, but I do not why it does not work here.
 
Thus can you tell me, show me in code, and/or point me to a reference that I can use so I can obtain the value in the app.config file for the database connection string I want to use. I do not want to use a hard-coded connection string to the database.
AnswerRe: C# issue: connection string to app.config file PinmemberEddy Vluggen11-Nov-12 0:38 
GeneralRe: C# issue: connection string to app.config file Pinmemberrachel_m11-Nov-12 7:11 
AnswerRe: C# issue: connection string to app.config file Pinmemberjschell11-Nov-12 11:39 
QuestionSSRS: How to deploy RDLC files with visual-studio 2010 setup PinmemberTridip Bhattacharjee10-Nov-12 8:49 
AnswerRe: SSRS: How to deploy RDLC files with visual-studio 2010 setup PinmemberMycroft Holmes10-Nov-12 14:17 
GeneralRe: SSRS: How to deploy RDLC files with visual-studio 2010 setup PinmemberTridip Bhattacharjee11-Nov-12 7:57 
GeneralRe: SSRS: How to deploy RDLC files with visual-studio 2010 setup PinmemberMycroft Holmes11-Nov-12 12:39 
GeneralRe: SSRS: How to deploy RDLC files with visual-studio 2010 setup PinmemberTridip Bhattacharjee11-Nov-12 20:35 
GeneralRe: SSRS: How to deploy RDLC files with visual-studio 2010 setup PinmemberMycroft Holmes11-Nov-12 22:29 
GeneralRe: SSRS: How to deploy RDLC files with visual-studio 2010 setup PinmemberTridip Bhattacharjee13-Nov-12 20:53 
QuestionExport data from report to excel in the wrong format [modified] PinmemberNguyễn Duy Nhân9-Nov-12 20:29 
GeneralRe: Export data from report to excel in the wrong format PinmemberEddy Vluggen10-Nov-12 8:22 
AnswerRe: Export data from report to excel in the wrong format PinmemberMycroft Holmes10-Nov-12 14:11 
QuestionExplorerBand,Explorer extending,I want to add a bar to the WindowsExplorer(not IE). Pinmemberohsorry9-Nov-12 17:05 
QuestionDirect Sound PinmemberMichael Kurdík9-Nov-12 8:41 
AnswerRe: Direct Sound PinmemberMycroft Holmes10-Nov-12 14:05 
AnswerRe: Direct Sound PinmemberMichael Kurdík17-Nov-12 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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.141216.1 | Last Updated 17 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid