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
 
>> Protected WithEvents dsetSiteData1 As pbay_web.dsetSiteData

this method is used for accessing servre controls that are used in an ASPX file inside a code behind file. so i am guessing that the declaration is NOT happening at all (as when u compile code behind using VBC it DOES not take the aspx file into account)...

Known is handfull, Unknown is worldfull
 
Thanks for this info.
How do I get over this hurdle?

The code-behind build-action property is set to compile whereas the aspx is set to content - which I think is OK?

cheers
 
what editor are u using? VS.NET???

Known is handfull, Unknown is worldfull
 
hmm try this:
Dim dsetSiteData1 As pbay_web.dsetSiteData

Known is handfull, Unknown is worldfull
 
Thanks for your help vbkris but including the Dim statement still returns the same error.
 
why dont u try binding the grid at run time (rather than setting it as a porperty)...

Known is handfull, Unknown is worldfull
 
How do I do this? I didn't write the code.
cheers
 
Remove DataSource
<asp:datagrid id=dagSiteData style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 16px" runat="server" Width="736px" CssClass="datagrid-basic" AutoGenerateColumns="False">


in ur page_load
dagSiteData.datasource=dsetSiteData1
dagSiteData.DataBind()

Known is handfull, Unknown is worldfull
 
Hi vbkris,
This runs without the error but no data is returned.

thanks for your help.
 
>>dsetSiteData1

what is it anyway? is it a dataset???

Known is handfull, Unknown is worldfull
 
Hi vbkris,
I get a syntax error on the following line:
if ( != "0") {
Here is the code as shown in the debugger in runtime mode:
function btnAddress_onclick() {
if ( != "0") {
window.showModalDialog("dlgAltAddress.aspx", self, "status:no; help:no; dialogWidth:750px")
}
}


Here is the code in design mode for the same .aspx file.

function btnAddress_onclick() {
if (<%=Session("ClientID")%> != "0") {
window.showModalDialog("dlgAltAddress.aspx", self, "status:no; help:no; dialogWidth:750px")
}
}

Why is it losing the session tag?
This is the page I've made the changes to.

So it gives the above error first then loads the page with no data.

thanks for your help

 
and where is it set???

Known is handfull, Unknown is worldfull
 
using the DataSetName property for the object. The datasetname is pointing to an .xsd file.
thanks
 
an XSD file is just schema, where does the data come from???

Known is handfull, Unknown is worldfull
 
>>(<%=Session("ClientID")%>

first time it may have not been set.

before bidning it could u create a DataView out of it and display a record count???

Known is handfull, Unknown is worldfull
 
how? sorry I'm new to this.
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top