Getting database names from a server using LINQ

How can I get the database names from my server using LINQ, since server does not save any table so I can create common share entity  table<> to map.
MasterabhiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
I know how to retrieve the list of databases in MySQL query:
http://dev.mysql.com/doc/refman/5.1/en/show-databases.html

however, not sure if that can be "translated" into LINQ...
0
MasterabhiAuthor Commented:
I am sorry this didn't work, but I figured it out though.
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
could you please share the solution?
and then close the question accordingly!
a3
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

MasterabhiAuthor Commented:
I am afraid to say that I am not using LINQ in that just because of time constraint of my application to be done. so I used old way to  get access from master database.
SELECT * FROM master.sys.databases.
Using LINQ i was wondering how am I going to manage the entity table which should be same as in database table. but  database names are not stored in master as tables. I believe they are saved as directories.
So if you find out the way to do that please let me know.
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>SELECT * FROM master.sys.databases.
this is MS SQL Server, right?

while MySQL indeed creates a folder per database, the list is still available in the information_schema views ...

in MySQL, the "database" is actually referred to as schema:
http://dev.mysql.com/doc/refman/5.0/en/schemata-table.html

while the same view exists in MS SQL Server, there it referes to the SCHEMA of the selected database.
the list of databases is indeed available in master.sys.databases (sql 2005+) or master.dbo.sysdatabases (sql 2000-)
http://msdn.microsoft.com/en-us/library/ms178534.aspx
0
MasterabhiAuthor Commented:
Thanks.
0
ee_autoCommented:
Question PAQ'd, 500 points refunded, and stored in the solution database.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.