tags:

views:

20

answers:

1

Hi All!

I have a requirement that, I populate all database in one DropDownList and when i changed the database name. I need to display all objects present in the database into a gridview. I need to do it in LINQ to SQl could any one please help me to solve this problem?

Thanks and Regards, G. Kiran

A: 

I found this code somewhere

Northwind db = ...from somewhere
var model = db.Mapping;
foreach (var mt in model.GetTables())
   Console.WriteLine(mt.TableName);
Mustafa Magdy