473,403 Members | 2,270 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,403 software developers and data experts.

Asp.Net 2.0 Profile: Need help in Class. Thank You.

Hello,

I am saving a complex type in Asp.Net 2.0 profile.
I am using an SQL 2005 database as a profile provider.

I have been consulting MSDN as help to create my class.
(Please, see my code at the end of this post)

OBJECTIVE:
- Save the documents published by each user in profile.
- Create operations to manage documents.

My main problems and questions are:

1. How to retrieve ALL items (documents) from ALL users?

2. To remove an item (document) I use Me._documents.Remove(document).
How to specify which document to retrive?
Which field should I use?

3. I need to search trough my documents using keywords inserted in a
textbox.
I was looking at System.Predicate but I am having a few problems.

a) Should I use or not System.Predicate

b) How to solve the error:
"Value of type 'System.Collections.Generic.List(Of Document)'
cannot be converted to 'Document'"
I get in the code line.
"Dim document As Document = _documents.FindAll(predicate)"

c) I have no idea of how to translate the keywords in my textbox to
my predicate.
If it could work with "AND", "OR" or "List Field = ..." like in
Google it would be a dream.

Could someone, please, help me?

Here is the code I have in this moment:

' ----------------------
Imports Microsoft.VisualBasic
<Serializable()> Public Class Document

Private _title As String
Private _subject As String
Private _file As String

Public Property Title() As String
Get
Return _title
End Get
Set(ByVal value As String)
If _title = value Then
Return
End If
_title = value
End Set
End Property

Public Property Subject() As String
Get
Return _subject
End Get
Set(ByVal value As String)
If _subject = value Then
Return
End If
_subject = value
End Set
End Property

Public Property File() As String
Get
Return _file
End Get
Set(ByVal value As String)
If _file = value Then
Return
End If
_file = value
End Set
End Property

End Class
<Serializable()> Public Class Documents

Private _documents As New Generic.List(Of Document)

Public ReadOnly Property All() As Generic.List(Of Document)
Get
Return Me._documents
End Get
End Property

Public Sub Add(ByVal document As Document)
Me._documents.Add(document)
End Sub

Public Sub Remove(ByVal documento As Document)
Me._documents.Remove(document)
End Sub

Public ReadOnly Property Find(ByVal predicate As Predicate(Of
Document)) As Generic.List(Of Document)
Get
Dim document As Document = _documents.FindAll(predicate)
Return _documents
End Get
End Property

End Class

' ---------------------

Thank You Very Much,
Miguel

Jan 29 '06 #1
0 1337

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

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
1
by: Trevor Bezotte | last post by:
Hi, I'm new to asp.net. I am having trouble updating and displaying a profile property through a dropdownlist. I believe the problem has something to do with autoeventwireup but I'm not sure. If...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
0
by: shapper | last post by:
Hello, I read everything I could find and still I get an error ... this is not making much sense. The objective: Create a profile for an existing user. I need to use: Multiple classes with...
9
by: Kirk | last post by:
I have successfully, implemented a custom Membership Provider to a SQL 2000 table, however, I am having problems doing the same with a Profile Provider. As I understand it, the steps for both of...
3
by: shapper | last post by:
Hello, In my Page's VB.NET code I am changing the value of the Profile property NAME. Profile.Name = tbName.Text However, I need to change this property value from a class in my App_Code...
0
by: Nano | last post by:
Hi, In an assembly I have created a class like this: <Serializable()_ Public Class Profile : Inherits System.Web.Profile.ProfileBase 'some private vars and public properties
4
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
I'm attempting to reference a profile item i set in a class for some reason profile.myitem will be seen in a code file for a page, but not in the class. Anyone know how to reference items in a...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.