Avatar of Jacque Scott
Jacque Scott
Flag for United States of America asked on

Visual Studio 2012 How to find the existing connection string

I need to update a project and I am looking for the DB connection string.  It is not in an obvious place.  Here is how we call the DB.
String cs3 = "INSERT INTO tblWP_TS_Day VALUES(NEWID(),@sd,@st,@et,@lit,@lot,@nt,@ot,@sit,@hot,@vat,@tt,@euk,@ct,'');";
                        Cm.ex(Cm.plw, cs3, null, ch, null, null, null, null, null, null, false);

Open in new window


The 'plw' contains the connection string but I can't find where that is set.  I right clicked on it and went to 'Go To Definition' and it brought me to this.

namespace BaseClassLibrary
{
    public class Cm
    {
        public static string cp;
        public static string plc;
        public static string pld;
        public static string pldt;
        public static string plw;

        public Cm();

        public static string ex(string cmm, string fc, string cmt, Hashtable ch, string ot, Ob rob, ArrayList al, Ts gts, Dl gdl, Label rl, bool q);
    }
}

Open in new window


I am trying to find where these variables are set.  I've done a search on the whole project and nothing shows up.  I am thinking there is a 'behind the scenes' spot where it can be set in a project.  I've looked in the 'Properties' page and clicked through each link and can't find it.  

Any idea?

Thanks
C#.NET Programming

Avatar of undefined
Last Comment
Jacque Scott

8/22/2022 - Mon
Arana (G.P.)

do you even know the name of the database? try searching for your database name or your username in the whole project, Since we can see the rest of the code I would also look into ODBC data sources in control panel. or in the project DATASOURCES
Jacque Scott

ASKER
Where do I find the project DataSources?  I have tried to search for my database name and can't find it.
Jacque Scott

ASKER
I clicked on the 'Data Sources' on the far left and it states that there are none to show.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Arana (G.P.)

do you have any  third party addons in your project? (infrgistics or similar? ), or data binding controls? if you have then the connection might be a property in one of them:

    DataColumn
    DataTable
    DataView
    DataSet
    DataViewManager
Jacque Scott

ASKER
Can you set variables in a library?
Arana (G.P.)

I mean in design mode control properties.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Jacque Scott

ASKER
I found it.  I was stepping through my program and it brought me to a page that had all of the variables for the DB set.  It is called Cm.cs.  I am looking for this page under the Solution Explorer and I don't see it.  Because of the extension '.cs' I looked under the 'Classes' and I don't see 'Cm.cs' there, I also looked in all of those links.

Any idea of how to find this page again?
Jacque Scott

ASKER
The namespace is BaseClassLibrary.  How do I get to this file?
ASKER CERTIFIED SOLUTION
Arana (G.P.)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jacque Scott

ASKER
I found it by looking through the files on my computer.  This file is used on all my programs, which makes sense.  

What I don't get is that I load this library on my program but I wasn't able to search in it or access it unless I step through my code and it loads that page or I open it using 'File - Open'.  Is there any other way of opening it?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
kaufmed

Is this code obfuscated? Your variable names don't look very sensible, which is usually the kind of thing an obfuscator would do.
Jacque Scott

ASKER
The variables are very obfuscated but I am unable to change the code that was already written.  :-(
Jacque Scott

ASKER
Thank you for all of your help.  I know I didn't give much to go on but I didn't know what to give.  

Thanks again!!!
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
kaufmed

OK, the variables are, but I'm specifically asking if your code is obfuscated. Because typically obfuscators will have logic built in that defeats reverse engineering the code (for hopefully obvious reasons). If this code was run through an obfuscator, then you'll probably have a difficult time tracing through it.
Jacque Scott

ASKER
The person who wrote the program did not write any notes or very few.  I have never heard of an obfuscator before.  I doubt the programmer used one.