Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BC30451 is not declared dataset error

Status
Not open for further replies.

JSMITH242B

Programmer
Joined
Mar 7, 2003
Messages
352
Location
GB
Hi Group,
This error is causing me grief!!
I've already spent a couple of days trying to compile the class, now this!!
I've got the following in my vb class (I'm using code-behind)

Imports System
Imports System.Web
Imports System.Web.UI.WebControls
Imports Microsoft.VisualBasic
Imports System.Web.UI.Page
Imports System.Data
Imports System.Data.SqlClient

I use the following command line to compile:
vbc /t:library /r:system.web.dll,system.dll, system.data.dll myPage.vb

I get the following error message:
Compiler Error Message: BC30451: Name 'dsetSiteData1' is not declared.

This is the line in my .aspx file that causes the error:
align="center" MS_POSITIONING="GridLayout"><asp:datagrid id=dagSiteData style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 16px" runat="server" Width="736px" CssClass="datagrid-basic" DataSource="<%# dsetSiteData1 %>" AutoGenerateColumns="False">


In my code-behind, I've got the following declaration:
Protected WithEvents dsetSiteData1 As pbay_web.dsetSiteData


Why is this occurring?
Any explanations/solutions appreciated!!

Regards
 
before the session is set if u try to get its value it will return empty value.

e.g.:
response.write(Session("Hi"))
Session("Hi")="ASD"
response.write(Session("Hi"))

Known is handfull, Unknown is worldfull
 
it's the creating the dataview bit I wasn't sure of but I'll do the above as a check
 
Hi vbkris
The session returns a value but still no data is being displayed.
Here's the code in it's entirety:
.aspx page
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Suspension.aspx.vb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Suspension</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content=" name="vs_targetSchema">
<LINK href="PBayStyles.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<script language="javascript">
function btnFindClient_onclick() {
window.showModalDialog("dlgFindClient.aspx", self, "status:no; help:no; dialogWidth:750px")
}

function btnAddress_onclick() {
if (<%=Session("ClientID")%> != "0") {
window.showModalDialog("dlgAltAddress.aspx", self, "status:no; help:no; dialogWidth:750px")
}
}
</script>
<form id="SuspensionMaint" method="post" runat="server">
<%if Request.querystring("Sitedetails") = "Y" then%>
<div id="SiteDetails" style="OVERFLOW: auto; WIDTH: 779px; POSITION: relative; HEIGHT: 100px"
align="center" MS_POSITIONING="GridLayout"><asp:datagrid id=dagSiteData style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 16px" runat="server" Width="736px" CssClass="datagrid-basic" AutoGenerateColumns="False">

code-behind .aspx.vb

Imports System.Data.SqlClient

Public Class SuspensionMaint
'Inherits System.Web.UI.Page
Inherits ClientSidePage
Dim intRowNo As Integer
Dim strSuspID As String
Dim strSuspReadOnly As String

Protected WithEvents daSites As System.Data.SqlClient.SqlDataAdapter
Protected WithEvents connDBConnect As System.Data.SqlClient.SqlConnection
Protected WithEvents dagSiteData As System.Web.UI.WebControls.DataGrid
Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents dsetSiteData1 As pbay_web.dsetSiteData
Dim strViewOnly As String

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.cmdDBCommand = New System.Data.SqlClient.SqlCommand
Me.daSites = New System.Data.SqlClient.SqlDataAdapter
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.connDBConnect = New System.Data.SqlClient.SqlConnection
Me.dsetSiteData1 = New pbay_web.dsetSiteData
CType(Me.dsetSiteData1, System.ComponentModel.ISupportInitialize).BeginInit()
'
'daSites
'
Me.daSites.SelectCommand = Me.SqlSelectCommand1
Me.daSites.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "SiteData", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("SiteID", "SiteID"), New System.Data.Common.DataColumnMapping("SuspensionStart", "SuspensionStart"), New System.Data.Common.DataColumnMapping("SuspensionEnd", "SuspensionEnd"), New System.Data.Common.DataColumnMapping("SiteDesc", "SiteDesc"), New System.Data.Common.DataColumnMapping("CodeDesc", "CodeDesc"), New System.Data.Common.DataColumnMapping("NotReq", "NotReq"), New System.Data.Common.DataColumnMapping("MergeID", "MergeID"), New System.Data.Common.DataColumnMapping("UPRN", "UPRN"), New System.Data.Common.DataColumnMapping("USRN", "USRN"), New System.Data.Common.DataColumnMapping("NameNo", "NameNo"), New System.Data.Common.DataColumnMapping("Address1", "Address1"), New System.Data.Common.DataColumnMapping("PostCode", "PostCode"), New System.Data.Common.DataColumnMapping("Archived", "Archived")})})
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT SiteData.SiteID, SiteData.SuspensionStart, SiteData.SuspensionEnd, SiteDat" & _
"a.SiteDesc, Codes.CodeDesc, SiteData.NotReq, SiteData.MergeID, SiteData.UPRN, Si" & _
"teData.USRN, SiteData.NameNo, SiteData.Address1, SiteData.PostCode, SiteData.Arc" & _
"hived FROM Suspension INNER JOIN SiteData ON Suspension.SuspensionID = SiteData." & _
"SuspensionID INNER JOIN Codes ON Suspension.Status = Codes.Code"
Me.SqlSelectCommand1.Connection = Me.connDBConnect
'
'connDBConnect
'
Me.connDBConnect.ConnectionString = "workstation id=""ITS-1010652-XP"";packet size=4096;integrated security=SSPI;data so" & _
"urce=DEVSQL2;persist security info=False;initial catalog=pbaydevdb"
'
'dsetSiteData1
'
Me.dsetSiteData1.DataSetName = "dsetSiteData"
Me.dsetSiteData1.Locale = New System.Globalization.CultureInfo("en-GB")
Me.ID = "SuspensionMaint"
CType(Me.dsetSiteData1, System.ComponentModel.ISupportInitialize).EndInit()

End Sub


'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region
'Public dsetSiteData As DataSet
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

dagSiteData.datasource=dsetSiteData1
dagSiteData.DataBind()


'MonitorChanges(txtFirstName)
If Not Page.IsPostBack Then
Session("SuspMode") = Request.QueryString("mode")
strSuspID = Request.QueryString("suspensionid")
strSuspReadOnly = Request.QueryString("readonly")
If strSuspReadOnly = "" Then strSuspReadOnly = "N"

PopulateDropdowns()
If Session("SuspMode") = "N" Then
InitNewSuspension()
Else
InitUpdateSuspension()
FillSiteDataGrid(True)
End If
Else
If Session("SuspMode") <> "N" Then
intRowNo = 0
dsetSiteData1 = Session("SiteData")
End If
End If

End Sub



I've noticed that further down in the code-behind page this is used: If Session("ClientID") <> "0" instead of this if (<%=Session("ClientID")%> != "0") syntax.

Is this because the latter is Javascript?

Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top