Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
QuestionC# and Power Point Pin
PDTUM3-May-11 7:55
PDTUM3-May-11 7:55 
AnswerRe: C# and Power Point Pin
Pete O'Hanlon3-May-11 9:36
mvePete O'Hanlon3-May-11 9:36 
AnswerRe: C# and Power Point Pin
PDTUM3-May-11 13:01
PDTUM3-May-11 13:01 
GeneralRe: C# and Power Point Pin
wizardzz4-May-11 10:01
wizardzz4-May-11 10:01 
QuestionConnection String problem Pin
si_693-May-11 6:01
si_693-May-11 6:01 
AnswerRe: Connection String problem Pin
Ian Shlasko3-May-11 6:17
Ian Shlasko3-May-11 6:17 
AnswerRe: Connection String problem Pin
Pete O'Hanlon3-May-11 6:18
mvePete O'Hanlon3-May-11 6:18 
AnswerRe: Connection String problem Pin
DaveAuld3-May-11 6:20
professionalDaveAuld3-May-11 6:20 
The error is being generated on this line;

si_69 wrote:
SqlConnection myConnectionCP2 = new SqlConnection(con);


which appears at present after the block shown below, with a bit of jiggery pokery, move the object declaration and the initilisation so you end up with the code refactored to;
C#
        SqlConnection myConnectionCP2;               //Declare the object here

public Service1()
{
    //CODEGEN: This call is required by the ASP.NET Web Services Designer
    InitializeComponent();
    ReadIniSettings();
    con=CreateConnectionString();
                myConnectionCP2 = new SqlConnection(con);   //Initialise the object here
}


That should hopefully fix the problem
Dave
Find Me On: Web|Facebook|Twitter|LinkedIn

Folding Stats: Team CodeProject

AnswerRe: Connection String problem Pin
Luc Pattyn3-May-11 6:28
sitebuilderLuc Pattyn3-May-11 6:28 
GeneralRe: Connection String problem Pin
Pete O'Hanlon3-May-11 6:44
mvePete O'Hanlon3-May-11 6:44 
GeneralRe: Connection String problem Pin
Luc Pattyn3-May-11 6:51
sitebuilderLuc Pattyn3-May-11 6:51 
Questiona try inside another Pin
Ali Al Omairi(Abu AlHassan)3-May-11 0:44
professionalAli Al Omairi(Abu AlHassan)3-May-11 0:44 
AnswerRe: a try inside another Pin
Rick van Woudenberg3-May-11 1:07
Rick van Woudenberg3-May-11 1:07 
AnswerRe: a try inside another Pin
Luc Pattyn3-May-11 1:12
sitebuilderLuc Pattyn3-May-11 1:12 
GeneralRe: a try inside another Pin
Rick van Woudenberg3-May-11 1:21
Rick van Woudenberg3-May-11 1:21 
GeneralRe: a try inside another PinPopular
Pete O'Hanlon3-May-11 1:44
mvePete O'Hanlon3-May-11 1:44 
GeneralRe: a try inside another Pin
Rick van Woudenberg3-May-11 1:57
Rick van Woudenberg3-May-11 1:57 
GeneralRe: a try inside another Pin
J4amieC3-May-11 3:00
J4amieC3-May-11 3:00 
GeneralRe: a try inside another Pin
Rick van Woudenberg3-May-11 4:14
Rick van Woudenberg3-May-11 4:14 
GeneralRe: a try inside another Pin
J4amieC3-May-11 4:36
J4amieC3-May-11 4:36 
GeneralRe: a try inside another Pin
BobJanova3-May-11 4:44
BobJanova3-May-11 4:44 
GeneralRe: a try inside another Pin
J4amieC3-May-11 4:50
J4amieC3-May-11 4:50 
GeneralRe: a try inside another Pin
Pete O'Hanlon3-May-11 5:41
mvePete O'Hanlon3-May-11 5:41 
GeneralRe: a try inside another Pin
Rick van Woudenberg3-May-11 23:52
Rick van Woudenberg3-May-11 23:52 
GeneralRe: a try inside another Pin
Gary Wheeler4-May-11 0:44
Gary Wheeler4-May-11 0:44 

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.