locked
database RRS feed

  • General discussion

  • how would we know the database name in which we ll connected in .net
    Saturday, November 20, 2010 2:20 PM

All replies

  • Have a look at the .net connection string, it should specify the database/initial catalog. Otherwise use activity monitor or sp_who2 from SQL Server Management Studio to find the connection using the hostname or application name and see what database is being accessed.

     

    Thanks


    /Neil Moorthy - Senior SQL Server DBA/Developer (MCITP (2005), MCAD, OCA 11g) Please click the Mark as Answer button if a post solves your problem
    Saturday, November 20, 2010 2:37 PM
  • Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;

    Or if you already connected run select db_name().....

     


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Sunday, November 21, 2010 6:42 AM
  • From Web Config File:

        <connectionStrings>
            <add name="TestConnectionString" connectionString="Database=Temp ;Server=TESTSERVER\SQL2008;Integrated Security = SSPI"/>
        </connectionStrings>

    thanks...
    - M S (We are what we repeatedly do, Excellence, then, is not an act, but a habit.)
    Monday, November 22, 2010 7:20 AM