Name 'CommandType' Is not declared/

Results 1 to 2 of 2

Thread: Name 'CommandType' Is not declared/

  1. #1
    Join Date
    Dec 1969

    Default Name 'CommandType' Is not declared/

    I have created a class file (shoppingcart.v) for a shopping cart, taken from a book beinning e-commerce. I am trying to compile the file so I can use it but I am getting some errors that are baffling me. The first is in trying to specify the connection to the db from web.config, the compiler is stating:<BR>error BC30451: Name &#039;ConfigurationSettings&#039; is not declared.<BR>Return ConfigurationSettings.AppSettings("connectionstrin g")<BR>(it has a squiggle under ConfigurationSettings)<BR><BR>I am having exactly the same issues with any line that has CommandType.StoredProcudure in it (saying CommandType is not declared and on one line where it is saying CommandBehaviour is not declared when I have this line:<BR>Return command.ExecuteReader(CommandBehaviour.CloseConnec tion)<BR><BR><BR>Can anyone shed any light on these?<BR>I&#039;m not using visual even though the book does although I don&#039;t think that matters much with the code I am using.<BR><BR>Cheers in advance<BR>Lloyd

  2. #2
    Join Date
    Dec 1969

    Default RE: Name 'CommandType' Is not declared/

    You need to include the following in your class declaration:<BR><BR>Imports system<BR>Imports System.Data<BR>Imports System.Configuration<BR>Imports System.Data.SqlClient<BR><BR>Are you compiling with vbc? You need to reference the correct assemblies in your statement<BR><BR>vbc /t:Library /r:system.dll, c:PathToVBFile<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts