Click here to Skip to main content
15,907,913 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Building a DNS server Pin
Dave Kreskowiak22-Apr-07 4:52
mveDave Kreskowiak22-Apr-07 4:52 
GeneralRe: Building a DNS server Pin
TomPanjer197422-Apr-07 21:56
TomPanjer197422-Apr-07 21:56 
QuestionPlease help - Parallel Arrays VB.NET Pin
laura h20-Apr-07 7:06
laura h20-Apr-07 7:06 
AnswerRe: Please help - Parallel Arrays VB.NET Pin
Dave Kreskowiak20-Apr-07 7:28
mveDave Kreskowiak20-Apr-07 7:28 
GeneralRe: Please help - Parallel Arrays VB.NET Pin
Merinda Bratton17-Mar-10 11:25
Merinda Bratton17-Mar-10 11:25 
GeneralRe: Please help - Parallel Arrays VB.NET - Figured it out Pin
Merinda Bratton17-Mar-10 11:56
Merinda Bratton17-Mar-10 11:56 
AnswerRe: Please help - Parallel Arrays VB.NET Pin
Christian Graus20-Apr-07 20:18
protectorChristian Graus20-Apr-07 20:18 
QuestionDisplaying tables in vb.net using sqlDMO Pin
gavthegenius20-Apr-07 5:30
gavthegenius20-Apr-07 5:30 
just wondering if anyone knows y this wont work, i want to display the tables of the database selected in the next combo box and it gets stuck on "SQLDatabase = SQLServer.Databases.Item(cboDatabases.Text)" in the button2_click procedure , prob easy i no but brain not functioning, cheers


Option Strict Off
Option Explicit On

Friend Class Form1
Inherits System.Windows.Forms.Form
Public SQLServer As New SQLDMO.SQLServer
Dim SQLDatabase As SQLDMO.Database
'UPGRADE_WARNING: Event chkNTAuthentication.CheckStateChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
Private Sub chkNTAuthentication_CheckStateChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles chkNTAuthentication.CheckStateChanged
' Enable Disable the Authentication dialog box ...
If chkNTAuthentication.CheckState = 1 Then
txtLogin.Enabled = False
txtPassword.Enabled = False
Else
txtLogin.Enabled = True
txtPassword.Enabled = True
End If
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sqlApp As New SQLDMO.Application
Dim NameList As SQLDMO.NameList
Dim index As Integer

NameList = sqlApp.ListAvailableSQLServers

' Get the Servers on the network and display the Values into the combo
For index = 1 To NameList.Count
cboServer.Items.Add(NameList.Item(index))
Next

' Enable NT Auth by deafult.
If chkNTAuthentication.CheckState = 1 Then
txtLogin.Enabled = False
txtPassword.Enabled = False
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SQLServer As New SQLDMO.SQLServer

On Error GoTo ErrorHandler
SQLServer.LoginTimeout = 10

' Check for the type of authentication and Logon to the Server.
If chkNTAuthentication.CheckState Then
' For Integrated NT security
SQLServer.LoginSecure = True
SQLServer.Connect(cboServer.Text)
Else
' SQL Server security
SQLServer.Connect(cboServer.Text, txtLogin.Text, txtPassword.Text)
End If

cboDatabases.Visible = True
Label4.Visible = True
Button2.Visible = True


Dim db As SQLDMO.Database
cboDatabases.Items.Clear()

' Fill the database combobox
For Each db In SQLServer.Databases
If Not db.SystemObject Then
cboDatabases.Items.Add(db.Name)
End If
Next db
' Select the first database by default
cboDatabases.SelectedIndex = 0



Exit Sub




ErrorHandler:
MsgBox(Err.Description, MsgBoxStyle.Critical, "Error - Connecting")
End Sub



Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim tbl As SQLDMO.Table
Dim sp As SQLDMO.StoredProcedure
cboTables.Visible = True
Label5.Visible = True
' Get a reference to the selected database
SQLDatabase = SQLServer.Databases.Item(cboDatabases.Text)



' Fill the Tables combo
cboTables.Items.Clear()
cboTables.Items.Add("(none)")
cboTables.Items.Add("(all)")

' Fill all the table looping from the SQL Object
For Each tbl In SQLDatabase.Tables
If Not tbl.SystemObject Then
cboTables.Items.Add(tbl.Name)
End If
Next tbl
cboTables.SelectedIndex = 0
End Sub
End Class

gvm
QuestionQuestion regarding the keyword "Using" Pin
Marcus J. Smith20-Apr-07 5:03
professionalMarcus J. Smith20-Apr-07 5:03 
AnswerRe: Question regarding the keyword "Using" Pin
Dave Kreskowiak20-Apr-07 6:10
mveDave Kreskowiak20-Apr-07 6:10 
GeneralRe: Question regarding the keyword "Using" [modified] Pin
Marcus J. Smith20-Apr-07 6:11
professionalMarcus J. Smith20-Apr-07 6:11 
GeneralRe: Question regarding the keyword "Using" Pin
Dave Kreskowiak20-Apr-07 6:32
mveDave Kreskowiak20-Apr-07 6:32 
QuestionMax(rows) of msflexgrid Pin
Navneet Hegde20-Apr-07 1:45
Navneet Hegde20-Apr-07 1:45 
AnswerRe: Max(rows) of msflexgrid Pin
Tim Carmichael20-Apr-07 3:25
Tim Carmichael20-Apr-07 3:25 
AnswerRe: Max(rows) of msflexgrid Pin
Dave Kreskowiak20-Apr-07 4:30
mveDave Kreskowiak20-Apr-07 4:30 
QuestionGetting DOS output Pin
johnjsm20-Apr-07 1:43
johnjsm20-Apr-07 1:43 
AnswerRe: Getting DOS output Pin
kubben20-Apr-07 2:25
kubben20-Apr-07 2:25 
AnswerRe: Getting DOS output Pin
sthotakura20-Apr-07 7:58
sthotakura20-Apr-07 7:58 
GeneralRe: Getting DOS output Pin
johnjsm20-Apr-07 11:10
johnjsm20-Apr-07 11:10 
QuestionHow do you add code snippets Pin
directred20-Apr-07 1:25
directred20-Apr-07 1:25 
AnswerRe: How do you add code snippets Pin
Dave Kreskowiak20-Apr-07 4:28
mveDave Kreskowiak20-Apr-07 4:28 
QuestionUPLOADING IMAGE USING OPEN FILE DIALOG Pin
klaydze19-Apr-07 22:10
klaydze19-Apr-07 22:10 
AnswerRe: UPLOADING IMAGE USING OPEN FILE DIALOG Pin
Christian Graus19-Apr-07 23:52
protectorChristian Graus19-Apr-07 23:52 
GeneralRe: UPLOADING IMAGE USING OPEN FILE DIALOG Pin
klaydze20-Apr-07 15:46
klaydze20-Apr-07 15:46 
QuestionDirectory share and fileshare problem [modified] Pin
battulga19-Apr-07 21:56
battulga19-Apr-07 21:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.