Get name tables, name columns, name datas using .net
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" a开发者_如何学JAVAs 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
You can use SqlConnection.GetSchema
method.
Retrieving Database Schema Information (ADO.NET)
Alternatively on SQL side you could use system views like this: SELECT [TABLE_NAME] FROM [INFORMATION_SCHEMA].[TABLES]
精彩评论