locked
BC30451: Name 'DataSet12' is not declared. RRS feed

  • Question

  • User239970385 posted

    Hi

    I have problem with declaration of the dataset, I was looking a lot of source to find solution.

    My problem:

    Compiler Error Message: BC30451: Name 'DataSet12' is not declared.

    Source Error:

    Line 12: 		<form id="Form1" method="post" runat="server">
    Line 13: 			<asp:label style="Z-INDEX: 101; POSITION: absolute; TOP: 24px; LEFT: 388px" id="Label1" runat="server" Width="331px" Height="46px" BackColor="White" Font-Bold="True" Font-Names="Arial" Font-Size="X-Large">Covidien - Database </asp:label><IMG style="Z-INDEX: 102; POSITION: absolute; WIDTH: 291px; HEIGHT: 52px; TOP: 17px; LEFT: 17px" id="pic1" alt="" src="\test-databse\img\Covidien_logo.jpg" width="291" height="52">
    Line 14: <asp:dropdownlist style="Z-INDEX: 103; POSITION: absolute; TOP: 106px; LEFT: 41px" id="DropDownList1" runat="server" Width="261px" Height="159px" DataTextField="Cell" DataMember="Location" DataValueField="Cell" DataSource="<%# DataSet12 %>"> Line 15: 			</asp:dropdownlist></form>
    Line 16: 	</body>

    Source File: c:\inetpub\wwwroot\test-databse\WebForm1.aspx    Line: 14

    Show Detailed Compiler Output:

    C:\WINDOWS\system32> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\test-databse\d4a7f61d\9c17e308\App_global.asax.lqhch7jq.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\test-databse\d4a7f61d\9c17e308\assembly\dl3\7e69f7f0\3a1021cf_ffd1cc01\test-databse.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\test-databse\d4a7f61d\9c17e308\App_Web_glv--jle.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\test-databse\d4a7f61d\9c17e308\glv--jle.res" /define:_MYTYPE=\"Web\" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\test-databse\d4a7f61d\9c17e308\App_Web_glv--jle.0.vb" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\test-databse\d4a7f61d\9c17e308\App_Web_glv--jle.1.vb"
    
    
    Microsoft (R) Visual Basic Compiler version 8.0.50727.3053
    for Microsoft (R) .NET Framework version 2.0.50727.3625
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    c:\inetpub\wwwroot\test-databse\WebForm1.aspx(14) : error BC30451: Name 'DataSet12' is not declared.
    
                dataBindingExpressionBuilderTarget.DataSource = CType( DataSet12 ,Object)
            

    Dataset12 is declared in public section:

    Protected WithEvents DataSet12 As test_databse.DataSet1

    I fill that is very easily solution - but I cannot find it, I just beginner in ASP.NET.<o:p></o:p>

    Thank

    Arek

    Monday, January 16, 2012 12:10 PM

Answers

  • User239970385 posted

    Thanks for your reply, problem was different, I did not build after changes – habit from programming in php

    Best Regards

    Arek

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 24, 2012 12:02 PM

All replies

  • User-1401636618 posted

    Remove DataSource="<%# DataSet12 %>">, DataTextField="Cell" and DataValueField="Cell" from Dropdown list and bind it from code behind like below

    DropDownList1.DataSource = DataSet12
    DropDownList1.DataTextField="Cell"
    DropDownList1.DataValueField="Cell"
    DropDownList1.DataBind()

    Do it on PageLoad event of page under NOT IsPostBack for only one time bind the dropdownlist like below:

    If Not IsPostBack
            DropDownList1.DataSource = DataSet12
    	DropDownList1.DataTextField="Cell"
    	DropDownList1.DataValueField="Cell"
    	DropDownList1.DataBind()
    End If
    
    Tuesday, January 17, 2012 4:10 AM
  • User3866881 posted

    Compiler Error Message: BC30451: Name 'DataSet12' is not declared.

    Please check it carefully whether you have DataSet12 defined in your cs file。

    Reguards!

    Tuesday, January 17, 2012 9:06 PM
  • User239970385 posted

    Thanks for your reply, problem was different, I did not build after changes – habit from programming in php

    Best Regards

    Arek

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 24, 2012 12:02 PM
  • User3866881 posted

    Thanks for your reply, problem was different, I did not build after changes – habit from programming in php

    Best Regards

    Arek

    Glad to hear that you've found the problem and solved it……。

    Thursday, January 26, 2012 4:58 AM