BC30260

P

psychomad

I'm getting this error, can someone please HELP!!!!!! thx

--------------------------------------------------------------------------------------------------------------------------------------------

Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: BC30260: 'btnQuery1' is already declared as
'Protected Dim WithEvents btnQuery1 As
System.Web.UI.WebControls.Button' in this class.

Source Error:



Line 5: <SCRIPT LANGUAGE="VB" RUNAT="server">
Line 6:
Line 7: Sub btnQuery1(Sender As Object, E As System.EventArgs)
Line 8: Dim oConn As OleDbConnection
Line 9: Dim oDA As OleDbDataAdapter


Source File: c:\inetpub\wwwroot\bhavish\products_update.aspx Line:
7



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\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS
\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /
R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices
\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:
\WINDOWS\assembly\GAC_32\System.Data
\2.0.0.0__b77a5c561934e089\System.Data.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.Web.Services\2.0.0.0__b03f5f7f11d50a3a
\System.Web.Services.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\Temporary ASP.NET Files\root
\26676eb7\92c7e946\App_Code.wwr45mvl.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.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /
out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root\26676eb7\92c7e946\App_Web_o0pukmuo.dll" /debug- /
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
\root\26676eb7\92c7e946\App_Web_o0pukmuo.0.vb" "C:\WINDOWS
\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root
\26676eb7\92c7e946\App_Web_o0pukmuo.1.vb"


Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

c:\inetpub\wwwroot\bhavish\products_update.aspx(7) : error BC30260:
'btnQuery1' is already declared as 'Protected Dim WithEvents btnQuery1
As System.Web.UI.WebControls.Button' in this class.

Sub btnQuery1(Sender As Object, E As System.EventArgs)
~~~~~~~~~






--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42


--------------------------------------------------------------------------------------------------------------------------------------------

Here is my code....





<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<SCRIPT LANGUAGE="VB" RUNAT="server">

Sub btnQuery1(Sender As Object, E As System.EventArgs)
Dim oConn As OleDbConnection
Dim oDA As OleDbDataAdapter
Dim oDS As New DataSet
oConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\wwwroot\bhavish\StoresDbs.mdb")
oConn.Open()
dim str as string = txtSQL.text
oDA = New OleDbDataAdapter("SELECT * FROM product", oConn)
dim cmdSelect as New OleDbCommand(sSelectSQL,cnAccess)
oDA.Fill(oDS, "product")
dgBands.DataSource = oDS
dgBands.DataBind()
oDS.Dispose()
oDS = Nothing
oDA.Dispose()
oDA = Nothing
oConn.Close()
oConn = Nothing

txtSQL.visible = "false"
btnQuery1.visible = "false"
dgbands.visible = "true"
End Sub
</SCRIPT>

<html>

<body background="pale.jpg" bgproperties="fixed">

<title> Our Stores </title>

<form id="xx" runat="server">
<asp:TextBox id="txtSQL" runat="server" />
<asp:Button id="btnQuery1" text="Find" runat="server" />




</form>
<asp:DataGrid id="dgBands" runat="server"
BorderColor="#000000"
BorderWidth="2"
GridLines="Both"
CellPadding="5"
CellSpacing="0"
Font-Name="Arial"
HeaderStyle-BackColor="#C0C0C0"
visible="false"
/>
</BODY>
</html>
 
G

Guest

you have two members with name btnQuery1: a sub and a Button instance.
Renaming the sub as btnQuery1_Click will fix the problem and make the sub
name meaningful...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top