views:

30

answers:

2

How to get all name tables, name columns, and values in database.

Example i have database "Northwind" in sqlserver 2005. The name or value may store in collection like System.Web.UI.WebControls.Table or list collection, or other possible accessible. Example: "Customers" as name table, "CompanyName" as name columns, and "" as values in column "Bólido Comidas preparadas".

The reason I wish make this, i want to make script update with condition..

Regard

+3  A: 

You can use SqlConnection.GetSchema method.

Retrieving Database Schema Information (ADO.NET)

DixonD
A: 

Alternatively on SQL side you could use system views like this: SELECT [TABLE_NAME] FROM [INFORMATION_SCHEMA].[TABLES]

Stas