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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many arguments to 'Public Sub New()'. ??

Status
Not open for further replies.

thetickisme

Programmer
Oct 19, 2005
12
US
What does this mean?? And how can I fix it?

Compiler Error Message: BC30057: Too many arguments to 'Public Sub New()'.

Source Error:


Line 32: If Not Page.IsPostBack()
Line 33: ' load an initial, default view of data
Line 34: ds = New DataSet( "ProductsData" )
Line 35: da = New SqlDataAdapter( "select CategoryId, CategoryName from Categories", New SqlConnection( "server=REMOVED;" ) )
Line 36: da.Fill( ds, "Categories" )



<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %><%@ Import Namespace="System.Data.SqlClient" %>

<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MMataSet
id="ProductsData"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_northwind") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_northwind") %>'
CommandText='<%# "select CategoryId, CategoryName from Categories" %>'
PageSize="10"
Debug="true"
></MMataSet>
<MMataSet
id="CategoriesData"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_northwind") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_northwind") %>'
CommandText='<%# "select CategoryId, CategoryName from Categories" %>'
Debug="true"
></MMataSet>
<MMageBind runat="server" PostBackBind="true" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<script runat="server">


Dim ds As DataSet
Dim da As SqlDataAdapter
Sub Page_Load ( sender As Object, E As EventArgs )
If Not Page.IsPostBack()
' load an initial, default view of data
ds = New DataSet( "ProductsData" )
da = New SqlDataAdapter( "select CategoryId, CategoryName from Categories", New SqlConnection( "server=REMOVED) )
da.Fill( ds, "Categories" )

DataGrid1.DataSource = ds.Table( "Products" )
DataGrid1.DataBind()

' populate the drop down with a list of product Categories
ds = New DataSet( "CategoriesData" )
da = New SqlDataAdapter( "select CategoryId, CategoryName from
Categories", New SqlConnection( "server=REMOVED;" ) )
da.Fill( ds, "Categories" )

DropDownList1.DataSource = ds.Tables( "Categories" )
DropDownList1.DataValueField = "CategoryId"
DropDownList1.DataTextField = "CategoryName"
DropDownList1.DataBind()
End If
End Sub

Sub DropDownList_Click( sender As Object, E As EventArgs )
Dim selectedCategoryId As Integer = Convert.ToInt32(
DropDownList1.SelectedValue )
Dim sql As String = "Select * From Products Where Category Id = " &
selectedCategoryId

ds = New DataSet( "ProductsData" )
da = New SqlDataAdapter( sql, New SqlConnection( "server=REMOVED) )
da.Fill( ds, "Products" )

DataGrid1.DataSource = ds.Tables( "Products" )
DataGrid1.DataBind()
End Sub
</script>


<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>


<form runat="server">
<aspropDownList ID="DropDownList1" runat="server"></aspropDownList>
<aspataGrid id="DataGrid1" runat="server"></aspataGrid>
</form>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top