473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

asp.net help needed

i want to display some data in a grid but this is the error i get.

withEvents variable 'DataGrid1' implicitly defines '_DataGrid1', which conflicts with a member of the same name in class 'mastersearch'.


i tried renaming the variables but that does not help because it EITHER doesnt bind the data at all OR does bind it but doesnt trigger the page change event


this is the code if it helps
thanks in advance


Public Class mastersearch
Inherits Page

' Methods
Public Sub New()
AddHandler MyBase.Init, New EventHandler(AddressOf Me.Page_Init)
AddHandler MyBase.Load, New EventHandler(AddressOf Me.Page_Load)
Me.qry = ""
End Sub

Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As DataGridPageChangedEventArgs)
Me.DataGrid1.CurrentPageIndex = e.NewPageIndex
Me.doSearch()
End Sub

Public Sub doSearch()
Try
Me.DataView1.RowFilter = Me.Session.Item("qry").ToString
Me.OleDbDataAdapter1.Fill(Me.DataSet21.Tables.Item (0))
Me.Response.Write(("<b>" & StringType.FromInteger(Me.DataView1.Count) & " records found.</b><p>"))
Me.DataGrid1.DataBind()
Catch exception2 As Exception
ProjectData.SetProjectError(exception2)
Dim exception1 As Exception = exception2
Me.Response.Write(("Could not perform search, please try again" & ChrW(13) & "<!-- " & exception1.Message & "-->"))
ProjectData.ClearProjectError()
End Try
End Sub

<DebuggerStepThrough()> _
Private Sub InitializeComponent()

.....parameters and declarations not shown here ......

Private Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
Me.InitializeComponent()
End Sub

Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not Me.IsPostBack Then
Dim text1 As String = Me.Request.Item("_mode")
If (Not Me.Request.Item("_dir") Is Nothing) Then
Me.qry = ("surname like '" & Me.Request.Item("_dir") & "%'")
ElseIf ((Not text1 Is Nothing) AndAlso (StringType.StrCmp(text1, "adv", False) = 0)) Then
Dim num2 As Integer = (Me.Request.Form.Count - 1)
Dim num1 As Integer = 0
Do While (num1 <= num2)
If Not Me.Request.Form.Keys.Item(num1).StartsWith("_") Then
If (StringType.StrCmp(Me.qry, "", False) <> 0) Then
Me.qry = (Me.qry & " AND ")
End If
Dim textArray1 As String() = New String() {Me.qry, "[", Me.Request.Form.Keys.Item(num1), "] like '%", Me.Request.Form.Item(num1), "%' "}
Me.qry = String.Concat(textArray1)
End If
num1 += 1
Loop
End If
Me.Session.Item("qry") = Me.qry
Me.doSearch()
End If
End Sub


' Properties
Protected Overridable Property DataGrid1() As DataGrid
Get
Return Me._DataGrid1
End Get
Set(ByVal WithEventsValue As DataGrid)
If (Not Me._DataGrid1 Is Nothing) Then
RemoveHandler Me._DataGrid1.PageIndexChanged, New DataGridPageChangedEventHandler(AddressOf Me.DataGrid1_PageIndexChanged)
End If
Me._DataGrid1 = WithEventsValue
If (Not Me._DataGrid1 Is Nothing) Then
AddHandler Me._DataGrid1.PageIndexChanged, New DataGridPageChangedEventHandler(AddressOf Me.DataGrid1_PageIndexChanged)
End If
End Set
End Property

Protected Overridable Property DataSet21() As DataSet2
Get
Return Me._DataSet21
End Get
Set(ByVal WithEventsValue As DataSet2)
If (Not Me._DataSet21 Is Nothing) Then
End If
Me._DataSet21 = WithEventsValue
If (Not Me._DataSet21 Is Nothing) Then
End If
End Set
End Property

Protected Overridable Property DataView1() As DataView
Get
Return Me._DataView1
End Get
Set(ByVal WithEventsValue As DataView)
If (Not Me._DataView1 Is Nothing) Then
End If
Me._DataView1 = WithEventsValue
If (Not Me._DataView1 Is Nothing) Then
End If
End Set
End Property

Protected Overridable Property OleDbConnection1() As OleDbConnection
Get
Return Me._OleDbConnection1
End Get
Set(ByVal WithEventsValue As OleDbConnection)
If (Not Me._OleDbConnection1 Is Nothing) Then
End If
Me._OleDbConnection1 = WithEventsValue
If (Not Me._OleDbConnection1 Is Nothing) Then
End If
End Set
End Property

Protected Overridable Property OleDbDataAdapter1() As OleDbDataAdapter
Get
Return Me._OleDbDataAdapter1
End Get
Set(ByVal WithEventsValue As OleDbDataAdapter)
If (Not Me._OleDbDataAdapter1 Is Nothing) Then
End If
Me._OleDbDataAdapter1 = WithEventsValue
If (Not Me._OleDbDataAdapter1 Is Nothing) Then
End If
End Set
End Property

Protected Overridable Property OleDbDeleteCommand1() As OleDbCommand
Get
Return Me._OleDbDeleteCommand1
End Get
Set(ByVal WithEventsValue As OleDbCommand)
If (Not Me._OleDbDeleteCommand1 Is Nothing) Then
End If
Me._OleDbDeleteCommand1 = WithEventsValue
If (Not Me._OleDbDeleteCommand1 Is Nothing) Then
End If
End Set
End Property

Protected Overridable Property OleDbInsertCommand1() As OleDbCommand
Get
Return Me._OleDbInsertCommand1
End Get
Set(ByVal WithEventsValue As OleDbCommand)
If (Not Me._OleDbInsertCommand1 Is Nothing) Then
End If
Me._OleDbInsertCommand1 = WithEventsValue
If (Not Me._OleDbInsertCommand1 Is Nothing) Then
End If
End Set
End Property

Protected Overridable Property OleDbSelectCommand1() As OleDbCommand
Get
Return Me._OleDbSelectCommand1
End Get
Set(ByVal WithEventsValue As OleDbCommand)
If (Not Me._OleDbSelectCommand1 Is Nothing) Then
End If
Me._OleDbSelectCommand1 = WithEventsValue
If (Not Me._OleDbSelectCommand1 Is Nothing) Then
End If
End Set
End Property

Protected Overridable Property OleDbUpdateCommand1() As OleDbCommand
Get
Return Me._OleDbUpdateCommand1
End Get
Set(ByVal WithEventsValue As OleDbCommand)
If (Not Me._OleDbUpdateCommand1 Is Nothing) Then
End If
Me._OleDbUpdateCommand1 = WithEventsValue
If (Not Me._OleDbUpdateCommand1 Is Nothing) Then
End If
End Set
End Property


' Fields
<AccessedThroughProperty("DataGrid1")> _
Public _DataGrid1 As DataGrid
<AccessedThroughProperty("DataSet21")> _
Private _DataSet21 As DataSet2
<AccessedThroughProperty("DataView1")> _
Private _DataView1 As DataView
<AccessedThroughProperty("OleDbConnection1")> _
Private _OleDbConnection1 As OleDbConnection
<AccessedThroughProperty("OleDbDataAdapter1")> _
Private _OleDbDataAdapter1 As OleDbDataAdapter
<AccessedThroughProperty("OleDbDeleteCommand1")> _
Private _OleDbDeleteCommand1 As OleDbCommand
<AccessedThroughProperty("OleDbInsertCommand1")> _
Private _OleDbInsertCommand1 As OleDbCommand
<AccessedThroughProperty("OleDbSelectCommand1")> _
Private _OleDbSelectCommand1 As OleDbCommand
<AccessedThroughProperty("OleDbUpdateCommand1")> _
Private _OleDbUpdateCommand1 As OleDbCommand
Private qry As String
End Class
Jul 26 '06 #1
0 1130

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: System | last post by:
Hello All, Redhat 9.0 Mysql 3.23.56 ==> Running I want to upgarde to 4.0.13 but this is the error it says: # rpm -Uvh MySQL-server-4.0.13-0.i386.rpm warning: MySQL-server-4.0.13-0.i386.rpm: V3...
8
by: Stephen | last post by:
I am trying to add some code to below to include a datatable and fill the datatable. The reason for doing this is so as I can check to see whether there are any rows returned by the stored...
13
by: Joe Feldman | last post by:
This position is located in the South Bay Area in Northern California. If you are interested please send me your resume in a word .doc so that I can review it. If this does not look like a match,...
0
by: Cindy B | last post by:
Please send your resume and position to Cindy@AtlanticResource.com! I CAN NOT accept candidates that ARE OUTSIDE OF THE US! NO PHONE CALLS PLEASE! Email your resume to me! Position:SQL...
3
by: Wade | last post by:
I would like to install the .Net 1.1 framework on a Web Server running W2K to be able to run ASP.NET files, but I'm not sure where to find the files I need for the .Net framework. I have ".NET...
17
by: dingoatemydonut | last post by:
The C99 standard states: "In the abstract machine, all expressions are evaluated as specified by the semantics. An actual implementation need not evaluate part of an expression if it can deduce...
5
by: Steve | last post by:
Hi, I am sitting down to design our next set of internal apps. I would like to approach this in a way that would allow me to break logical parts of the application that handle specific tasks...
0
by: ultradiv | last post by:
I have a VB.NET application partly built that produces an xml output (just a file at present) I have a .NET webserver and SQLserver 2000 I need to be able to send the xml to the webserver/database...
28
by: Ian Davies | last post by:
Hello I would appreciate some help from someone who has knowledge of working with css, php javascript and how they interact. Ive been working on a task for the last few days and have started to...
37
by: C_guy | last post by:
Does anyone know of a (hopefully free) tool that can traverse a project and determine which "#include"s are not needed or needed in every .C file? This would be helpful in removing header...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.