Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2004, 06:48 AM
Registered User
 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with compiling DLL using VBC

Hi all, newbie here and to the world of ASP.NET.

Im using WebMatrix for writing ASPX and VB files and VBC to compile the VB files into DLLs.

Im having the following problem when I try to compile a VB file. I have all the DLL files reference (System.Data.dll, System.dll etc) and considering System.Data.dll should include the NameSpace 'System.Data.SqlClient', Im not sure while it doesnt compile.

I've read the thread http://p2p.wrox.com/topic.asp?TOPIC_ID=3796 on this forum and made sure Im using the correct syntax and I've put all the VBC, and DLL files needed to compile the VB files into a folder like the one described at http://it.maconstate.edu/tutorials/A...pnet15-03.aspx

Any help appreciated!

Regards,
Ray

====== START ======
C:\Web Services>vbc /t:library /out:BooksDB.dll /r:System.dll /r:System.Data.dll /r:System.Web.Services.dll /r:System.XML.dll BooksDB.vb
Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322.573
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Web Services\BooksDB.vb(52) : error BC30002: Type 'SqlConnection' is not defined.

            Dim objConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("C onnectionString"))
                           ~~~~~~~~~~~~~

C:\Web Services\BooksDB.vb(53) : error BC30002: Type 'SqlCommand' is not defined.

            Dim objCmd As SqlCommand = New SqlCommand("sp_Book_Detail2", objConn)
                          ~~~~~~~~~~

C:\Web Services\BooksDB.vb(56) : error BC30451: Name 'CommandType' is not declared.

            objCmd.CommandType = CommandType.StoredProcedure
                                 ~~~~~~~~~~~
C:\Web Services\BooksDB.vb(59) : error BC30002: Type 'SqlParameter' is not defined.

            Dim parameterBookID As SqlParameter = New SqlParameter("@BookID", SqlDbType.int, 4)
                                   ~~~~~~~~~~~~
====== END ======

====== VB File START ======
Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient

Namespace KoganPage.Commerce

    '************************************************* ******
    '
    ' BookDetails Class
    '
    ' A simple data class that encapsulates details about
    ' a particular book inside the Kogan Page
    ' database.
    '
    '************************************************* ******

    Public Class BookDetails

        Public ISBN As String
        Public Title As String
        Public Description As String
        Public PricePound As Decimal

    End Class

    '************************************************* ******
    '
    ' BooksDB Class
    '
    ' Business/Data Logic Class that encapsulates all data
    ' logic necessary to query books within
    ' the Kogan Page database.
    '
    '************************************************* ******

    Public Class BooksDB
        '************************************************* ******
        '
        ' BooksDB.GetBookDetails() Method <a name="GetBookDetails"></a>
        '
        ' The GetBookDetails method returns a BookDetails
        ' struct containing specific details about a specified
        ' book within the Kogan Page Database.
        '
        '
        '************************************************* ******

        Public Function GetBookDetails(ByVal BookID As Integer) As BookDetails

            ' Create Instance of Connection and Command Object
            Dim objConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("C onnectionString"))
            Dim objCmd As SqlCommand = New SqlCommand("sp_Book_Detail2", objConn)

            ' Mark the Command as a SPROC
            objCmd.CommandType = CommandType.StoredProcedure

            ' Add Parameters to SPROC
            Dim parameterBookID As SqlParameter = New SqlParameter("@BookID", SqlDbType.int, 4)
            parameterBookID.Value = BookID
            objCmd.Parameters.Add(parameterBookID)


            ' Open the connection and execute the Command
            objConn.Open()
            objCmd.ExecuteNonQuery()
            objConn.Close()

            ' Create and Populate BookDetails Struct using
            ' Output Params from the SPROC
            Dim objBookDetails As BookDetails = New BookDetails()

            objBookDetails.ISBN = "1"
            objBookDetails.Title = "2"
            objBookDetails.Description = "3"
            objBookDetails.PricePound = "4"

            Return objBookDetails

        End Function
    End Class


End Namespace
====== VB File END ======








 
Old August 23rd, 2004, 07:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Add /r:System.Data.SqlClient.dll

Brian
 
Old August 23rd, 2004, 08:09 AM
Registered User
 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just did a search on my pc for 'system.data.sqlclient.dll' and its nowhere to be found. I'ved installed the .NET (1.1) Framework and SDK already. Is the file in another download?

 
Old August 23rd, 2004, 09:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

No, it's in the framework, I'm using it right now. It is the client tools for SQL Server, which define the SQLConnection, SQLCommand, etc. You have it inherited in your code; I thought that may be an issue because it wasn't in the /r list.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling Website to a DLL ashu_from_india .NET Framework 2.0 2 April 18th, 2008 05:20 AM
Compiling the website into dll sunnyjassal General .NET 1 November 3rd, 2006 05:14 PM
Problem with compiling - 2005 pghTech Visual C++ 2005 0 June 28th, 2006 11:13 AM
Compiling problem secko Visual C++ 1 March 15th, 2005 06:17 AM
problem with compiling centy Visual C++ 4 February 8th, 2005 02:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.