Show tables from sql database
-
ADO.NET is ADO.NET whether you're using C#, VB.NET, MC++, etc. In fact, all assemblies work the same in any managed language. It's important to understand that. That being said, ADO.NET is an abstract interface to any database driver that uses either an OLE DB driver, ODBC driver, or has implemented a specific driver client implementing the ADO.NET interfaces. That does not mean, however, that every feature in a particular database is supported, since abstraction leads to simplification (which is why SQL Server, Oracle, and others have implemented their own clients for ADO.NET). Enumerating databases in a DBMS is different; so, what type of DBMS do you want to enumerate? In SQL Server, you can use the "sp_helpdb" stored procedure. For Access, there is no way other than searching your hard drive for *.mdb, since Access uses Jet Databases, which is a file-based database. It's different for MySQL, Oracle, and others, too.
Microsoft MVP, Visual C# My Articles
-
ADO.NET is ADO.NET whether you're using C#, VB.NET, MC++, etc. In fact, all assemblies work the same in any managed language. It's important to understand that. That being said, ADO.NET is an abstract interface to any database driver that uses either an OLE DB driver, ODBC driver, or has implemented a specific driver client implementing the ADO.NET interfaces. That does not mean, however, that every feature in a particular database is supported, since abstraction leads to simplification (which is why SQL Server, Oracle, and others have implemented their own clients for ADO.NET). Enumerating databases in a DBMS is different; so, what type of DBMS do you want to enumerate? In SQL Server, you can use the "sp_helpdb" stored procedure. For Access, there is no way other than searching your hard drive for *.mdb, since Access uses Jet Databases, which is a file-based database. It's different for MySQL, Oracle, and others, too.
Microsoft MVP, Visual C# My Articles
-
in mysql, i can use 'show tables' command to list down all the tables in particular database. i wanna know how to do this in sql server 2000. so that i can use C# to perform such operation using data adapter
There's several ways you can show tables in SQL Server, the easiest being the INFORMATION_SCHEMA metadata table:
SELECT table_name
FROM INFORMATION_SCHEMA.TABLESYou can also query the
sysobjects
table:SELECT name
FROM sysobjects
WHERE xtype = 'U' or xtype = 'S' -- U for user tables, S for system tablesMicrosoft MVP, Visual C# My Articles
-
There's several ways you can show tables in SQL Server, the easiest being the INFORMATION_SCHEMA metadata table:
SELECT table_name
FROM INFORMATION_SCHEMA.TABLESYou can also query the
sysobjects
table:SELECT name
FROM sysobjects
WHERE xtype = 'U' or xtype = 'S' -- U for user tables, S for system tablesMicrosoft MVP, Visual C# My Articles