Need help!

Results 1 to 2 of 2

Thread: Need help!

  1. #1
    Join Date
    Dec 1969

    Default Need help!

    I am using codebehide. here are the three files: DepartmentList.ascx(user control), DeparmentList.vb and catalog.vb. <BR>bellow is catalog file:<BR>Imports System.Data.SqlClient<BR><BR>Public Class Catalog<BR> Public Shared Function GetDepartments() As SqlDataReader<BR> <BR> Dim connection As New SqlConnection(connectionString)<BR> <BR> Dim command As New SqlCommand("GetDepartments", connection)<BR> command.CommandType = CommandType.StoredProcedure<BR> <BR> connection.Open()<BR> <BR> Return command.ExecuteReader(CommandBehavior.CloseConnect ion)<BR> End Function<BR><BR> End Class<BR><BR>I define method GetDepartments() as shared. and in DeparmentList.vb use it like this: list.DataSource = Catalog.GetDepartments()<BR><BR>But I got a error message: can&#039;t find Catalog. I have put Catlog.vb and DeparmentList.vb in the same folder. So, what&#039;s wrong here?<BR><BR>thank you for your response!<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Need help!

    Are both files included in the same project? If they are, they should compile into one application dll and there should be no problem refering to classes contained in the codebehind.

Posting Permissions

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