O
OutdoorGuy
Greetings,
I am attempting to use VB.NET 2003 to loop through all of the tables in
a SQL Server 2005 database. However, I have yet to figure this out.
Does anyone have any suggestions? My existing code is below. Thanks in
advance!
Private Sub btnInsertDB_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnInsertDB.Click
Dim i As Integer
Dim i As Integer
Dim j As Integer
Dim sqlComm As New SqlClient.SqlCommand
Dim sqlConn As New SqlClient.SqlConnection
sqlConn.ConnectionString =
"SERVER=EMPIRE100;DATABASE=Mytest;trusted_connection=true;connection
timeout=30"
sqlConn.Open()
sqlComm.Connection = sqlConn
'// Code fails here
For j = 0 To sqlComm.Connection.Database
MessageBox.Show(j.ToString)
Next
...
I am attempting to use VB.NET 2003 to loop through all of the tables in
a SQL Server 2005 database. However, I have yet to figure this out.
Does anyone have any suggestions? My existing code is below. Thanks in
advance!
Private Sub btnInsertDB_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnInsertDB.Click
Dim i As Integer
Dim i As Integer
Dim j As Integer
Dim sqlComm As New SqlClient.SqlCommand
Dim sqlConn As New SqlClient.SqlConnection
sqlConn.ConnectionString =
"SERVER=EMPIRE100;DATABASE=Mytest;trusted_connection=true;connection
timeout=30"
sqlConn.Open()
sqlComm.Connection = sqlConn
'// Code fails here
For j = 0 To sqlComm.Connection.Database
MessageBox.Show(j.ToString)
Next
...