|
-
Sep 4th, 2002, 05:34 AM
#1
Thread Starter
New Member
Sub Main Not Found In Console App with DLL
I have a class lib named DatabaseOverviewClassLib with the following code:
Option Strict On
Imports System.Data.SqlClient
Public Class DatabaseOverview
Public m_ip As String
Public m_login As String
Public m_password As String
Public m_database As String
Public m_port As String
Public Sub GetDatabaseOverview(ByVal ip As String, ByVal login As String, ByVal password As String, ByVal database As String, Optional ByVal port As String = "1433")
m_ip = ip
m_login = login
m_password = password
m_database = database
m_port = port
Dim query As String = "select * from sysobjects type = 'U'"
Dim connStr As String = "Provider=SQLOLEDB;Datasource=" & ip & ";Initial Catalog=" & database & ";User ID=" & login & ";Password=" & password
Dim conn As SqlConnection = New SqlConnection(connStr)
Dim reader As SqlDataReader
Dim command As SqlCommand = New SqlCommand(query, conn)
Try
conn.Open()
reader = command.ExecuteReader
While reader.Read()
Console.WriteLine((reader.GetString(0).ToString & ", " & reader.GetString(1)))
End While
Catch ex As SqlException
Finally
conn.Close()
End Try
End Sub
End Class
==========================================
And I have a console app with the following code
Imports DatabaseOverview
Module Module1
Sub Main()
End Sub
End Module
============================================
When I build the console app i get the following error
'Sub Main' was not found in 'DatabaseOverviewApp.DatabaseOverviewApp.DatabaseOverview.Module1'.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|