By benjaminhowarth on
Sat, 27 Sep 2008 23:06:56 GMT
I'm about to set up a new website, powered by DotNetNuke (my favourite CMS at the moment, mainly because it's free), and I want to install a Counter-Strike game server onto the same machine. I also want a little module that will show visitors to my site how many people are logged onto the CS server and some basic stats. Sounds simple right? The problem is that when Counter-Strike server is installed, the database name is generated at random. So I can't create a connection string that points to a data source because I don't know the name of the database. However, I do know what the CS tables look like. In SQL Server, there's no way of obtaining all the table names in all the database just by running one query. So, I created a bit of code which:
Gets all the databases on the server; Queries the INFORMATION_SCHEMA.tables table, which holds the names of all the tables in the database; Return the name of the database which contains the CS tables (in this case, cs_server). The following piece of code does...
Read More »