Friday, September 27, 2013

How to get the datasource name from an Entity Framework in C#

If the entity framework model is in a different project, you have to add System.Data.Entity as a reference.
Assuming the name of the Entity Framework context is

"LIQBillsAndStatementsEntities"

then this is how you do it: Its hard.
 
textBoxStagingdataSource.Text = new LIQBillsAndStatementsEntities().Connection.DataSource;

No comments:

Post a Comment