LINQ2SQL ... Mini SQL Browser

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

I am developing a mini SQL browser wherein I display all database objects
such as tables, functions etc.,

Upon selecting a table, its contents to be displayed.

I use Mapping.GetTables() and Mapping.GetFunctions() to get the list.

Writing dynamic linq query and displaying seems little problem

Any help would be appreciated

Regards
Raj
 
I am developing a mini SQL browser wherein I display all database objects
such as tables, functions etc.,

Upon selecting a table, its contents to be displayed.

I use Mapping.GetTables() and Mapping.GetFunctions() to get the list.

Writing dynamic linq query and displaying seems little problem
LINQ is hardly the right tool for the job here. LINQ is most appropriate if
you need a strongly-typed interface to the database. While you *can* write
dynamic LINQ queries
(http://weblogs.asp.net/scottgu/arch...t-1-using-the-linq-dynamic-query-library.aspx)
this is most useful for when you have dynamic search conditions, not dynamic
column sets. There is no point trying to use LINQ on fully dynamic result
sets; it's the proverbial square peg in a round hole.

Consider using SQL Server Management Objects instead
(http://msdn.microsoft.com/en-us/library/ms162169.aspx) or simply query the
system information views (INFORMATION_SCHEMA.TABLES or sys.tables),
SqlCommand.ExecuteDataReader() with the CommandBehavior.SchemaOnly option
and plain old DataTables (which are excellent for dynamic result sets).

Also, I assume you are already aware that SQL Server Management Studio is
probably better at doing whatever you're developing, but it still bears
mentioning.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top