I need to show all tables from a database, well I dont know how, look:
Try
sqlx.Open()
Dim ver As Object
Dim sqlstring As String = "select.......Idon`t know jaja"
Dim sqlc As New SqlCommand(sqlstring, sqlx)
ver = sqlc.ExecuteNonQuery()
sqlstring = Convert.ToString(ver)
ListView1.Items.Add(sqlstring)
Catch ex As Exception
MsgBox("No tables Found")
End Try
I need a query or something to list all tables... HOW???
how to select all tables from sql server with VB.netselect help from dreamincode.net
Page 1 of 1
5 Replies - 9615 Views - Last Post: 20 November 2008 - 10:06 PM
#1
how to select all tables from sql server with VB.net
Posted 31 July 2008 - 09:41 PM
Replies To: how to select all tables from sql server with VB.net
#2
Re: how to select all tables from sql server with VB.net
Posted 31 July 2008 - 09:51 PM
Are you trying to list all the tables that are included in that database or are you attempting to view all the data from the tables?
They are actually two different things:
The first will give you a list of all the databases / tables that are contained within the SQL server.
The other will give all the data contained within the database/table you are querying.
They are actually two different things:
The first will give you a list of all the databases / tables that are contained within the SQL server.
The other will give all the data contained within the database/table you are querying.
#3
Re: how to select all tables from sql server with VB.net
Posted 31 July 2008 - 09:56 PM
nono, I have to show all the tables of a database...
maybe the code that I showed you, it is not completely well, but the idea is that to show all the tables
thanks......
maybe the code that I showed you, it is not completely well, but the idea is that to show all the tables
thanks......
#4
Re: how to select all tables from sql server with VB.net
Posted 31 July 2008 - 10:16 PM
You have two options, you can use
Or for a more ANSI orientated result you can use
SELECT * FROM sysobjects WHERE type = 'U'
Or for a more ANSI orientated result you can use
SELECT * FROM INFORMATION_SCHEMA.TABLES
#5
Re: how to select all tables from sql server with VB.net
Posted 20 November 2008 - 01:33 PM
DeCompile, on 31 Jul, 2008 - 08:51 PM, said:
Are you trying to list all the tables that are included in that database or are you attempting to view all the data from the tables?
They are actually two different things:
The first will give you a list of all the databases / tables that are contained within the SQL server.
The other will give all the data contained within the database/table you are querying.
They are actually two different things:
The first will give you a list of all the databases / tables that are contained within the SQL server.
The other will give all the data contained within the database/table you are querying.
so how to get the list of database??
I am trying to get it and it is still couldn't find any information found on web sites yet.
#6
Re: how to select all tables from sql server with VB.net
Posted 20 November 2008 - 10:06 PM
select * from sys.databases
Depending what you want to do you can also use the SQL SMO .NET objects to manage a SQL Server.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|