Showing posts with label structure. Show all posts
Showing posts with label structure. Show all posts

Thursday, March 22, 2012

Structure

Hello,

I have created a structure, MyStruct, with 3 properties: Name
(String), Valid (Boolean) and Type (Enumeration Type).

I need to do the following:
1. Create a list of items of type MyStruct using a simple method like:
MyStruct.Add(...)
2. Access each list item using a For Loop.

Could someone, please help me out?

I have been trying collections, arrays, adding methods inside my
structure but I have not been able to make this work.

Thank You Very Much,
MiguelIf you are using 2.0, a generic list is the best approach.

dim something as new List(of MyStruct)

something.Add(firstStructure)

for each struct as MyStruct in something
'do something
next

Karl

In 1.x, you can either use an ArrayList, or create a custom collection by
extending the CollectionBase class

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"shapper" <mdmoura@.gmail.comwrote in message
news:1173113846.509770.105130@.q40g2000cwq.googlegr oups.com...

Quote:

Originally Posted by

Hello,
>
I have created a structure, MyStruct, with 3 properties: Name
(String), Valid (Boolean) and Type (Enumeration Type).
>
I need to do the following:
1. Create a list of items of type MyStruct using a simple method like:
MyStruct.Add(...)
2. Access each list item using a For Loop.
>
Could someone, please help me out?
>
I have been trying collections, arrays, adding methods inside my
structure but I have not been able to make this work.
>
Thank You Very Much,
Miguel
>

structure

what is the best way of sharing a structure among different pages of my
asp.net application?Hi,

Try putting the Structure in a separate file to your web pages and making it
'public static' (or 'Public Shared' in VB.NET).

James

"Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
news:%23LYbPYrUEHA.4048@.TK2MSFTNGP12.phx.gbl...
> what is the best way of sharing a structure among different pages of my
> asp.net application?

structure

what is the best way of sharing a structure among different pages of my
asp.net application?Muhammad,
I assume you mean the Visual style of the pages?
There are a few ways this can be done, I personally use
WilsonMasterPages: -
http://authors.aspalliance.com/Paul...Articles/?id=14
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
Hi,
Try putting the Structure in a separate file to your web pages and making it
'public static' (or 'Public Shared' in VB.NET).
James
"Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
news:%23LYbPYrUEHA.4048@.TK2MSFTNGP12.phx.gbl...
> what is the best way of sharing a structure among different pages of my
> asp.net application?
>
sorry didn't make myself clear, I want to use a data structure and assign
values to its members on different pages and offcourse want to retain all
values assigned on different pages.
"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote i
n
message news:camdst$oni@.odak26.prod.google.com...
> Muhammad,
> I assume you mean the Visual style of the pages?
> There are a few ways this can be done, I personally use
> WilsonMasterPages: -
> http://authors.aspalliance.com/Paul...Articles/?id=14
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
> http://www.myservicescentral.com
>
Muhammad,
You could store this structure in the Application object, and update it
there. Although you may have threading issues, so use locking when
accessing it.
James
"Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
news:eFIQYgrUEHA.2388@.TK2MSFTNGP09.phx.gbl...
> sorry didn't make myself clear, I want to use a data structure and assign
> values to its members on different pages and offcourse want to retain all
> values assigned on different pages.
> "Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote
in
> message news:camdst$oni@.odak26.prod.google.com...
>
Is it possible to definte a user defined stucture as application variable.
just of the sake of example
public struct student
{
int id;
string name;
float age;
string address1;
string address2;
}
How can I create an object of student type as an application variable?
"James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
news:e4qMukrUEHA.2520@.TK2MSFTNGP10.phx.gbl...
> Muhammad,
> You could store this structure in the Application object, and update it
> there. Although you may have threading issues, so use locking when
> accessing it.
> James
> "Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
> news:eFIQYgrUEHA.2388@.TK2MSFTNGP09.phx.gbl...
assign
all
in
>
Define the struct as you have in a file within your project. In the
Application_Start event handler in the Global.asax file of your project,
enter the following code:
VB:
Dim oStudent As SomeNamespace.student
' Initialise
oStudent.ID = 0
oStudent.Age = 15
..
' Add the student to the application object
Application("Student") = oStudent
C#:
SomeNamespace.student oStudent;
// Initialise
oStudent.ID = 0;
oStudent.Age = 15;
..
// Add the student to the application object
Application["Student"] = oStudent;
The student struct will then be available to each page. To access it, use
the following code:
VB:
CType(Application("Student"), SomeNamespace.student) ...
C#:
(SomeNamespace.student)Application["Student"] ...
Hope this helps,
James
"Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
news:uTCmXtrUEHA.2972@.TK2MSFTNGP12.phx.gbl...
> Is it possible to definte a user defined stucture as application variable.
> just of the sake of example
> public struct student
> {
> int id;
> string name;
> float age;
> string address1;
> string address2;
> }
> How can I create an object of student type as an application variable?
> "James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
> news:e4qMukrUEHA.2520@.TK2MSFTNGP10.phx.gbl...
> assign
> all
> in
>
Excellent! that make 100% sense, will give it a go now thank you for help.
"James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
news:u2jIuzrUEHA.1036@.TK2MSFTNGP12.phx.gbl...
> Define the struct as you have in a file within your project. In the
> Application_Start event handler in the Global.asax file of your project,
> enter the following code:
> VB:
> Dim oStudent As SomeNamespace.student
> ' Initialise
> oStudent.ID = 0
> oStudent.Age = 15
> ...
> ' Add the student to the application object
> Application("Student") = oStudent
> C#:
> SomeNamespace.student oStudent;
> // Initialise
> oStudent.ID = 0;
> oStudent.Age = 15;
> ...
> // Add the student to the application object
> Application["Student"] = oStudent;
> The student struct will then be available to each page. To access it, use
> the following code:
> VB:
> CType(Application("Student"), SomeNamespace.student) ...
> C#:
> (SomeNamespace.student)Application["Student"] ...
> Hope this helps,
> James
> "Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
> news:uTCmXtrUEHA.2972@.TK2MSFTNGP12.phx.gbl...
variable.
it
retain
wrote
>
Muhammad,
James' sample is great, you might also want to take a look at an
article I put together a while ago on the subject: -
http://aspalliance.com/431
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
that is extremely helpful. thank you phil.
"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote i
n
message news:camn5j$65l@.odak26.prod.google.com...
> Muhammad,
> James' sample is great, you might also want to take a look at an
> article I put together a while ago on the subject: -
> http://aspalliance.com/431
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
> http://www.myservicescentral.com
>

Structure

Hello,

I have created a structure, MyStruct, with 3 properties: Name (String), Valid (Boolean) and Type (Enumeration Type).

I need to do the following:
1. Create a list of items of type MyStruct using a simple method like:
MyStruct.Add(...)
2. Access each list item using a For Loop.

Could someone, please help me out?

I have been trying collections, arrays, adding methods inside my structure but I have not been able to make this work.

Thank You Very Much,
Miguel

shapper:

Hello,

I have created a structure, MyStruct, with 3 properties: Name (String), Valid (Boolean) and Type (Enumeration Type).

I need to do the following:
1. Create a list of items of type MyStruct using a simple method like:
MyStruct.Add(...)

Rather Use Classes where you can have the above 3 properties & also get Methods Like Add() ,Delete() etc.Then Create an Array of that Class.
2. Access each list item using a For Loop.
When u make the Array of a Class u can use the For/ForEach loops to access the element of the array.
Could someone, please help me out?

I have been trying collections, arrays, adding methods inside my structure but I have not been able to make this work.

Thank You Very Much,
Miguel

structure

Muhammad,

I assume you mean the Visual style of the pages?

There are a few ways this can be done, I personally use
WilsonMasterPages: -

http://authors.aspalliance.com/Paul...Articles/?id=14

Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.comsorry didn't make myself clear, I want to use a data structure and assign
values to its members on different pages and offcourse want to retain all
values assigned on different pages.

"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote in
message news:camdst$oni@.odak26.prod.google.com...
> Muhammad,
> I assume you mean the Visual style of the pages?
> There are a few ways this can be done, I personally use
> WilsonMasterPages: -
> http://authors.aspalliance.com/Paul...Articles/?id=14
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
> http://www.myservicescentral.com
Muhammad,

You could store this structure in the Application object, and update it
there. Although you may have threading issues, so use locking when
accessing it.

James

"Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
news:eFIQYgrUEHA.2388@.TK2MSFTNGP09.phx.gbl...
> sorry didn't make myself clear, I want to use a data structure and assign
> values to its members on different pages and offcourse want to retain all
> values assigned on different pages.
> "Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote in
> message news:camdst$oni@.odak26.prod.google.com...
> > Muhammad,
> > I assume you mean the Visual style of the pages?
> > There are a few ways this can be done, I personally use
> > WilsonMasterPages: -
> > http://authors.aspalliance.com/Paul...Articles/?id=14
> > Hth,
> > Phil Winstanley
> > Microsoft ASP.NET MVP
> > http://www.myservicescentral.com
Is it possible to definte a user defined stucture as application variable.
just of the sake of example

public struct student
{
int id;
string name;
float age;
string address1;
string address2;
}

How can I create an object of student type as an application variable?

"James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
news:e4qMukrUEHA.2520@.TK2MSFTNGP10.phx.gbl...
> Muhammad,
> You could store this structure in the Application object, and update it
> there. Although you may have threading issues, so use locking when
> accessing it.
> James
> "Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
> news:eFIQYgrUEHA.2388@.TK2MSFTNGP09.phx.gbl...
> > sorry didn't make myself clear, I want to use a data structure and
assign
> > values to its members on different pages and offcourse want to retain
all
> > values assigned on different pages.
> > "Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote
in
> > message news:camdst$oni@.odak26.prod.google.com...
> > > Muhammad,
> > > > I assume you mean the Visual style of the pages?
> > > > There are a few ways this can be done, I personally use
> > > WilsonMasterPages: -
> > > > http://authors.aspalliance.com/Paul...Articles/?id=14
> > > > Hth,
> > > Phil Winstanley
> > > Microsoft ASP.NET MVP
> > > http://www.myservicescentral.com
>
Define the struct as you have in a file within your project. In the
Application_Start event handler in the Global.asax file of your project,
enter the following code:

VB:
Dim oStudent As SomeNamespace.student
' Initialise
oStudent.ID = 0
oStudent.Age = 15
...

' Add the student to the application object
Application("Student") = oStudent

C#:
SomeNamespace.student oStudent;
// Initialise
oStudent.ID = 0;
oStudent.Age = 15;
...

// Add the student to the application object
Application["Student"] = oStudent;

The student struct will then be available to each page. To access it, use
the following code:

VB:
CType(Application("Student"), SomeNamespace.student) ...

C#:
(SomeNamespace.student)Application["Student"] ...

Hope this helps,

James

"Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
news:uTCmXtrUEHA.2972@.TK2MSFTNGP12.phx.gbl...
> Is it possible to definte a user defined stucture as application variable.
> just of the sake of example
> public struct student
> {
> int id;
> string name;
> float age;
> string address1;
> string address2;
> }
> How can I create an object of student type as an application variable?
> "James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
> news:e4qMukrUEHA.2520@.TK2MSFTNGP10.phx.gbl...
> > Muhammad,
> > You could store this structure in the Application object, and update it
> > there. Although you may have threading issues, so use locking when
> > accessing it.
> > James
> > "Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
> > news:eFIQYgrUEHA.2388@.TK2MSFTNGP09.phx.gbl...
> > > sorry didn't make myself clear, I want to use a data structure and
> assign
> > > values to its members on different pages and offcourse want to retain
> all
> > > values assigned on different pages.
> > > > "Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote
> in
> > > message news:camdst$oni@.odak26.prod.google.com...
> > > > Muhammad,
> > > > > > I assume you mean the Visual style of the pages?
> > > > > > There are a few ways this can be done, I personally use
> > > > WilsonMasterPages: -
> > > > > > http://authors.aspalliance.com/Paul...Articles/?id=14
> > > > > > Hth,
> > > > Phil Winstanley
> > > > Microsoft ASP.NET MVP
> > > > http://www.myservicescentral.com
> > > >
Excellent! that make 100% sense, will give it a go now thank you for help.

"James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
news:u2jIuzrUEHA.1036@.TK2MSFTNGP12.phx.gbl...
> Define the struct as you have in a file within your project. In the
> Application_Start event handler in the Global.asax file of your project,
> enter the following code:
> VB:
> Dim oStudent As SomeNamespace.student
> ' Initialise
> oStudent.ID = 0
> oStudent.Age = 15
> ...
> ' Add the student to the application object
> Application("Student") = oStudent
> C#:
> SomeNamespace.student oStudent;
> // Initialise
> oStudent.ID = 0;
> oStudent.Age = 15;
> ...
> // Add the student to the application object
> Application["Student"] = oStudent;
> The student struct will then be available to each page. To access it, use
> the following code:
> VB:
> CType(Application("Student"), SomeNamespace.student) ...
> C#:
> (SomeNamespace.student)Application["Student"] ...
> Hope this helps,
> James
> "Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
> news:uTCmXtrUEHA.2972@.TK2MSFTNGP12.phx.gbl...
> > Is it possible to definte a user defined stucture as application
variable.
> > just of the sake of example
> > public struct student
> > {
> > int id;
> > string name;
> > float age;
> > string address1;
> > string address2;
> > }
> > How can I create an object of student type as an application variable?
> > "James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
> > news:e4qMukrUEHA.2520@.TK2MSFTNGP10.phx.gbl...
> > > Muhammad,
> > > > You could store this structure in the Application object, and update
it
> > > there. Although you may have threading issues, so use locking when
> > > accessing it.
> > > > James
> > > > "Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
> > > news:eFIQYgrUEHA.2388@.TK2MSFTNGP09.phx.gbl...
> > > > sorry didn't make myself clear, I want to use a data structure and
> > assign
> > > > values to its members on different pages and offcourse want to
retain
> > all
> > > > values assigned on different pages.
> > > > > > "Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name>
wrote
> > in
> > > > message news:camdst$oni@.odak26.prod.google.com...
> > > > > Muhammad,
> > > > > > > > I assume you mean the Visual style of the pages?
> > > > > > > > There are a few ways this can be done, I personally use
> > > > > WilsonMasterPages: -
> > > > > > > > http://authors.aspalliance.com/Paul...Articles/?id=14
> > > > > > > > Hth,
> > > > > Phil Winstanley
> > > > > Microsoft ASP.NET MVP
> > > > > http://www.myservicescentral.com
> > > > > > > > >
there is no need to use the application collection. you can just declare a
static version of your struct.

class myGlobal
{
static public struct student = initStudent();
}

you will need to sync access to members

-- bruce (sqlwork.com)

"James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
news:u2jIuzrUEHA.1036@.TK2MSFTNGP12.phx.gbl...
> Define the struct as you have in a file within your project. In the
> Application_Start event handler in the Global.asax file of your project,
> enter the following code:
> VB:
> Dim oStudent As SomeNamespace.student
> ' Initialise
> oStudent.ID = 0
> oStudent.Age = 15
> ...
> ' Add the student to the application object
> Application("Student") = oStudent
> C#:
> SomeNamespace.student oStudent;
> // Initialise
> oStudent.ID = 0;
> oStudent.Age = 15;
> ...
> // Add the student to the application object
> Application["Student"] = oStudent;
> The student struct will then be available to each page. To access it, use
> the following code:
> VB:
> CType(Application("Student"), SomeNamespace.student) ...
> C#:
> (SomeNamespace.student)Application["Student"] ...
> Hope this helps,
> James
> "Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
> news:uTCmXtrUEHA.2972@.TK2MSFTNGP12.phx.gbl...
> > Is it possible to definte a user defined stucture as application
variable.
> > just of the sake of example
> > public struct student
> > {
> > int id;
> > string name;
> > float age;
> > string address1;
> > string address2;
> > }
> > How can I create an object of student type as an application variable?
> > "James Doran" <jamied1@.NO_SPAMbreathe.com> wrote in message
> > news:e4qMukrUEHA.2520@.TK2MSFTNGP10.phx.gbl...
> > > Muhammad,
> > > > You could store this structure in the Application object, and update
it
> > > there. Although you may have threading issues, so use locking when
> > > accessing it.
> > > > James
> > > > "Muhammad Sheikh" <Muhammad.Sheikh@.4mat.com> wrote in message
> > > news:eFIQYgrUEHA.2388@.TK2MSFTNGP09.phx.gbl...
> > > > sorry didn't make myself clear, I want to use a data structure and
> > assign
> > > > values to its members on different pages and offcourse want to
retain
> > all
> > > > values assigned on different pages.
> > > > > > "Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name>
wrote
> > in
> > > > message news:camdst$oni@.odak26.prod.google.com...
> > > > > Muhammad,
> > > > > > > > I assume you mean the Visual style of the pages?
> > > > > > > > There are a few ways this can be done, I personally use
> > > > > WilsonMasterPages: -
> > > > > > > > http://authors.aspalliance.com/Paul...Articles/?id=14
> > > > > > > > Hth,
> > > > > Phil Winstanley
> > > > > Microsoft ASP.NET MVP
> > > > > http://www.myservicescentral.com
> > > > > > > > >

structure

Muhammad,

James' sample is great, you might also want to take a look at an
article I put together a while ago on the subject: -

http://aspalliance.com/431

Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.comthat is extremely helpful. thank you phil.

"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote in
message news:camn5j$65l@.odak26.prod.google.com...
> Muhammad,
> James' sample is great, you might also want to take a look at an
> article I put together a while ago on the subject: -
> http://aspalliance.com/431
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
> http://www.myservicescentral.com

Structure and Class

Hello,
I have a class which I am using in my profile.
I made this class Serializable by using:
<Serializable()> _
Public Class Options
One of the properties in this class is of type Level where level is a
structure:
Public Structure Level
Dim Delete As Boolean
Dim Create As Boolean
Dim Update As Boolean
Dim View As Boolean
End Structure ' Level
' Access
Private _Access As Level
Public Property Access() As Level
Get
Return _Access
End Get
Set(ByVal value As Level)
_Access = value
End Set
End Property ' Access
Can I make this?
I am not sure if I can use the structure as described since my class
is Serializable because of profile.
Should I turn Level into a Serializable class to with 4 properties?
Thanks,
Miguel> Public Structure Level
> Dim Delete As Boolean
> Dim Create As Boolean
> Dim Update As Boolean
> Dim View As Boolean
> End Structure ' Level

> Should I turn Level into a Serializable class to with 4 properties?
Why not make it a simple enum with Flags!
<Flags> Public Enum Level
Delete = 1
Create = 2
Update = 4
View = 8
End Enum
IMHO, this would be a better choice for you!
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
---
You can use a structure, certainly. However, private members of classes and
structures are not serialized as XML.
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"shapper" <mdmoura@.gmail.com> wrote in message
news:1182349298.570647.201260@.w5g2000hsg.googlegroups.com...
> Hello,
> I have a class which I am using in my profile.
> I made this class Serializable by using:
> <Serializable()> _
> Public Class Options
> One of the properties in this class is of type Level where level is a
> structure:
> Public Structure Level
> Dim Delete As Boolean
> Dim Create As Boolean
> Dim Update As Boolean
> Dim View As Boolean
> End Structure ' Level
> ' Access
> Private _Access As Level
> Public Property Access() As Level
> Get
> Return _Access
> End Get
> Set(ByVal value As Level)
> _Access = value
> End Set
> End Property ' Access
> Can I make this?
> I am not sure if I can use the structure as described since my class
> is Serializable because of profile.
> Should I turn Level into a Serializable class to with 4 properties?
> Thanks,
> Miguel
>
On Jun 21, 2:11 pm, "Kevin Spencer" <unclechut...@.nothinks.com> wrote:
> You can use a structure, certainly. However, private members of classes an
d
> structures are not serialized as XML.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Printing Components, Email Components,
> FTP Client Classes, Enhanced Data Controls, much more.
> DSI PrintManager, Miradyne Component Libraries:http://www.miradyne.net
> "shapper" <mdmo...@.gmail.com> wrote in message
> news:1182349298.570647.201260@.w5g2000hsg.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
Hi,
I am serializing my profile classes as binary:
<add allowAnonymous = "false" name = "Collaborator" type =
"Collaborator" serializeAs = "Binary" />
And my class is as follows (I am using the <flag> enum sugestion from
Gaurav):
<Serializable()> _
Public Class Collaborator
' Permissions
Private _Permissions As Security
Public Property Permissions() As Security
Get
Return _Permissions
End Get
Set(ByVal value As Security)
_Permissions = value
End Set
End Property ' Permissions
' Security
<Serializable()> _
Public Class Security
' Level
<Flags()> Public Enum Level
Delete = 1
Create = 2
Update = 4
View = 8
End Enum ' Level
' Blogger
Private _Blogger As Level
Public Property Blogger() As Level
Get
Return _Blogger
End Get
Set(ByVal value As Level)
_Blogger = value
End Set
End Property ' Blogger
' Scheduler
Private _Scheduler As Level
Public Property Scheduler() As Level
Get
Return _Scheduler
End Get
Set(ByVal value As Level)
_Scheduler = value
End Set
End Property ' Scheduler
..
End Class ' Security
End Class ' Collaborator
Is this ok?
Thanks,
Miguel
Hi Miguel,

> Is this ok?
I do not see any problems.
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
---

Structure and Class

Hello,

I have a class which I am using in my profile.
I made this class Serializable by using:

<Serializable()_
Public Class Options

One of the properties in this class is of type Level where level is a
structure:

Public Structure Level
Dim Delete As Boolean
Dim Create As Boolean
Dim Update As Boolean
Dim View As Boolean
End Structure ' Level

' Access
Private _Access As Level
Public Property Access() As Level
Get
Return _Access
End Get
Set(ByVal value As Level)
_Access = value
End Set
End Property ' Access

Can I make this?

I am not sure if I can use the structure as described since my class
is Serializable because of profile.

Should I turn Level into a Serializable class to with 4 properties?

Thanks,
MiguelPublic Structure Level

Quote:

Originally Posted by

Dim Delete As Boolean
Dim Create As Boolean
Dim Update As Boolean
Dim View As Boolean
End Structure ' Level


Quote:

Originally Posted by

Should I turn Level into a Serializable class to with 4 properties?


Why not make it a simple enum with Flags!

<FlagsPublic Enum Level
Delete = 1
Create = 2
Update = 4
View = 8
End Enum

IMHO, this would be a better choice for you!

--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-------------
You can use a structure, certainly. However, private members of classes and
structures are not serialized as XML.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"shapper" <mdmoura@.gmail.comwrote in message
news:1182349298.570647.201260@.w5g2000hsg.googlegro ups.com...

Quote:

Originally Posted by

Hello,
>
I have a class which I am using in my profile.
I made this class Serializable by using:
>
<Serializable()_
Public Class Options
>
One of the properties in this class is of type Level where level is a
structure:
>
Public Structure Level
Dim Delete As Boolean
Dim Create As Boolean
Dim Update As Boolean
Dim View As Boolean
End Structure ' Level
>
' Access
Private _Access As Level
Public Property Access() As Level
Get
Return _Access
End Get
Set(ByVal value As Level)
_Access = value
End Set
End Property ' Access
>
Can I make this?
>
I am not sure if I can use the structure as described since my class
is Serializable because of profile.
>
Should I turn Level into a Serializable class to with 4 properties?
>
Thanks,
Miguel
>


On Jun 21, 2:11 pm, "Kevin Spencer" <unclechut...@.nothinks.comwrote:

Quote:

Originally Posted by

You can use a structure, certainly. However, private members of classes and
structures are not serialized as XML.
>
--
HTH,
>
Kevin Spencer
Microsoft MVP
>
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:http://www.miradyne.net
>
"shapper" <mdmo...@.gmail.comwrote in message
>
news:1182349298.570647.201260@.w5g2000hsg.googlegro ups.com...
>

Quote:

Originally Posted by

Hello,


>

Quote:

Originally Posted by

I have a class which I am using in my profile.
I made this class Serializable by using:


>

Quote:

Originally Posted by

<Serializable()_
Public Class Options


>

Quote:

Originally Posted by

One of the properties in this class is of type Level where level is a
structure:


>

Quote:

Originally Posted by

Public Structure Level
Dim Delete As Boolean
Dim Create As Boolean
Dim Update As Boolean
Dim View As Boolean
End Structure ' Level


>

Quote:

Originally Posted by

' Access
Private _Access As Level
Public Property Access() As Level
Get
Return _Access
End Get
Set(ByVal value As Level)
_Access = value
End Set
End Property ' Access


>

Quote:

Originally Posted by

Can I make this?


>

Quote:

Originally Posted by

I am not sure if I can use the structure as described since my class
is Serializable because of profile.


>

Quote:

Originally Posted by

Should I turn Level into a Serializable class to with 4 properties?


>

Quote:

Originally Posted by

Thanks,
Miguel


Hi,

I am serializing my profile classes as binary:
<add allowAnonymous = "false" name = "Collaborator" type =
"Collaborator" serializeAs = "Binary" />

And my class is as follows (I am using the <flagenum sugestion from
Gaurav):

<Serializable()_
Public Class Collaborator

' Permissions
Private _Permissions As Security
Public Property Permissions() As Security
Get
Return _Permissions
End Get
Set(ByVal value As Security)
_Permissions = value
End Set
End Property ' Permissions

' Security
<Serializable()_
Public Class Security

' Level
<Flags()Public Enum Level
Delete = 1
Create = 2
Update = 4
View = 8
End Enum ' Level

' Blogger
Private _Blogger As Level
Public Property Blogger() As Level
Get
Return _Blogger
End Get
Set(ByVal value As Level)
_Blogger = value
End Set
End Property ' Blogger

' Scheduler
Private _Scheduler As Level
Public Property Scheduler() As Level
Get
Return _Scheduler
End Get
Set(ByVal value As Level)
_Scheduler = value
End Set
End Property ' Scheduler
...

End Class ' Security

End Class ' Collaborator

Is this ok?

Thanks,
Miguel
Hi Miguel,

Quote:

Originally Posted by

Is this ok?


I do not see any problems.

--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-------------

Structure Data Type

If I want to pass a structure data type to a function then what data type is it? Object? Or is it just a bad thing to pass structs?

Thanks,
TreyA struct type is a "value type" so it is not an object ( reference type ).

Sam
so say i have a sub like:


sub insertX( byVal someValue as ___________)

end sub

What goes in the ___________ part.

Thanks,
Trey
You would pass it the name of the struct you created. Say you create a struct called Employee, here is how you would pass it:

sub insertX( byVal someValue as Employee a)

//Do stuff with a

end sub

Sam
The ____ will be the structure type:

<%@. Page Language="VB" %>
<html>
<head>
<script runat="server">
Structure Favourite
Public Colour As String
Public Number As Integer
End Structure

Sub Page_Load(sender As Object, e As EventArgs)
Dim MyFavourite As New Favourite
MyFavourite.Colour = "black"
Myfavourite.Number = "10"
Report( MyFavourite )
End Sub

Sub Report( ThisFavourite As Favourite )
Message.Text = "Your favourite colour is " & ThisFavourite.Colour
Message.Text &= ", and your favourite number is " & ThisFavourite.Number.ToString()
End Sub
</script>
</head>
<body>
<form runat="server">
<asp:Label id="Message" runat="server" />
</form>
</body>
</html>


thanks....that helped me figure out what i was doing wrong.

Trey

Structure of a 3-tier application

Hi to all. I'm new using Visual Web Developer and I'm just getting familiar with the folder structure in projects (App_Data, App_Code, etc.).

In previous versions of Visual Studio you create a Solution and then you could add projects into it...so, a three tier app would be composed of 1 solution, and 3 projects (Business, Data, UI).

With this new approach, what would be the right structure (folders, etc.) of the application project for a 3-tier app!!??

Thanks in advance!!Visit the following: http://www.15seconds.com/issue/050721.htm

Hope this helps!
Wow, that's great!!

Thanks eccsolutions for your help!!! Just what I was looking for!

Structure of website

Hi all,

using 1.1

I am creating a dynamic menu structure for my site, however, I may refer to
the structure many times within a page. This would be fine if I was doing it
all in the codebehind of the page, but I am trying to create seperate tiers
for seperate areas. The menu structure I suppose is a middle tier...

The menu is built using a recursive function to build the tree. My page
would normally call a seperate class and function to build the menu. This
would effectively mean that every time I wanted to use the menu in whatever
classes elsewhere in my page, I would have to create the menu from scratch
again to work with it.

This is what I am trying to avoid, as it can be an expensive process to call
the database for every operation.

To throw more confusion into the pot, my page codebehind is derived from my
own class, which is in turn derived from system.web.ui.page. This means that
the codebehind for the page itself has very little code in it, all the work
being done in my derived class.

On the page itself, I have custom controls and user controls. The user
controls also work like the pages where the codebehind is derived from my
derived class, which derives from usercontrol. The custom and user controls
must also be able to work with the menu class.

Where would be the best place to set up the initial menu, so that my derived
page, the page codebehind and my controls can all interact with it, without
having to build the menu each time?

Thanks for your time. If this is a little confusing, please ask me to
attempt to make it clearer.

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises availableHi,

I am guessing that I didn't phrase this question easily...

Basically, I want to have a base class that on the first call to the page,
creates and populates a menu object.

When I need to refer to the menu at any time within the page (such as
creating a menu tree or finding which page I am on through following the menu
tree, or creating a breadcrumb trail), I don't want to have to create a menu
class for each instance.

What may add to the confusion is that my page, user controls and custom
controls derive from my own base classes, so there is an extra layer of
confusion. I would like my page base class to be able to know about the menu
(which can pass it to the page class), and my UCs base class to know about
it, which can pass to the UC codebehind.

I don't mind creating the menu for each page, but I really only want to
create it once, because it uses a database call, I don't want to have an
expensive process for each use of it.

All help is appreciated.

Regards,
Dave Colliver.
http://www.DerbyFOCUS.com
~~
http://www.FOCUSPortals.com - Portal franchises available

"David" wrote:

Quote:

Originally Posted by

Hi all,
>
using 1.1
>
I am creating a dynamic menu structure for my site, however, I may refer to
the structure many times within a page. This would be fine if I was doing it
all in the codebehind of the page, but I am trying to create seperate tiers
for seperate areas. The menu structure I suppose is a middle tier...
>
The menu is built using a recursive function to build the tree. My page
would normally call a seperate class and function to build the menu. This
would effectively mean that every time I wanted to use the menu in whatever
classes elsewhere in my page, I would have to create the menu from scratch
again to work with it.
>
This is what I am trying to avoid, as it can be an expensive process to call
the database for every operation.
>
To throw more confusion into the pot, my page codebehind is derived from my
own class, which is in turn derived from system.web.ui.page. This means that
the codebehind for the page itself has very little code in it, all the work
being done in my derived class.
>
On the page itself, I have custom controls and user controls. The user
controls also work like the pages where the codebehind is derived from my
derived class, which derives from usercontrol. The custom and user controls
must also be able to work with the menu class.
>
Where would be the best place to set up the initial menu, so that my derived
page, the page codebehind and my controls can all interact with it, without
having to build the menu each time?
>
Thanks for your time. If this is a little confusing, please ask me to
attempt to make it clearer.
>
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
>
>
>


Hi all,

I am really struggling with this still. Any help would be appreciated...

I don't know if this will work, I am thinking along the lines of ...

In my base page, in the page_init (override), create a new instance of the
class that calls the database for the menu, and create the menu structure
into a dataset (or my own structure)

Then, in my controls (or even the page itself), open the dataset (or my own
structure) that has been created from the base page.

So, for example, I have a data layer... if I have a property in the
datalayer class that stores my dataset, that I populate on the page_init,
when I come to use it in the controls, can I do something as simple as...

MyMenu = this.Menu as MyClass.Menu;

(I am using c#, .net 1.1)

Will it then access the already created Menu?

If it is likely to work, I am not sure of the way to code it. Any help here
is appreciated.

If you don't think it will work the way outlined above, but know of another
way, again, any help is appreciated.

The idea is to just call the database once for something that is likely to
be expensive to create. I don't need it on application or session level.
Page level will be fine. The problem with application or session level is
that if any changes are made to the menu structure, they won't be visible
until it has timed out.

Thanks for your time.

Best regards,
Dave Colliver.
http://www.CardiffFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

"David Colliver" <DavidColliver@.discussions.microsoft.comwrote in message
news:FA252579-0E4C-41FD-979D-171CA8DB9E8F@.microsoft.com...

Quote:

Originally Posted by

Hi,
>
I am guessing that I didn't phrase this question easily...
>
Basically, I want to have a base class that on the first call to the page,
creates and populates a menu object.
>
When I need to refer to the menu at any time within the page (such as
creating a menu tree or finding which page I am on through following the
menu
tree, or creating a breadcrumb trail), I don't want to have to create a
menu
class for each instance.
>
What may add to the confusion is that my page, user controls and custom
controls derive from my own base classes, so there is an extra layer of
confusion. I would like my page base class to be able to know about the
menu
(which can pass it to the page class), and my UCs base class to know about
it, which can pass to the UC codebehind.
>
I don't mind creating the menu for each page, but I really only want to
create it once, because it uses a database call, I don't want to have an
expensive process for each use of it.
>
All help is appreciated.
>
Regards,
Dave Colliver.
http://www.DerbyFOCUS.com
~~
http://www.FOCUSPortals.com - Portal franchises available
>
>
>
"David" wrote:
>

Quote:

Originally Posted by

>Hi all,
>>
>using 1.1
>>
>I am creating a dynamic menu structure for my site, however, I may refer
>to
>the structure many times within a page. This would be fine if I was doing
>it
>all in the codebehind of the page, but I am trying to create seperate
>tiers
>for seperate areas. The menu structure I suppose is a middle tier...
>>
>The menu is built using a recursive function to build the tree. My page
>would normally call a seperate class and function to build the menu. This
>would effectively mean that every time I wanted to use the menu in
>whatever
>classes elsewhere in my page, I would have to create the menu from
>scratch
>again to work with it.
>>
>This is what I am trying to avoid, as it can be an expensive process to
>call
>the database for every operation.
>>
>To throw more confusion into the pot, my page codebehind is derived from
>my
>own class, which is in turn derived from system.web.ui.page. This means
>that
>the codebehind for the page itself has very little code in it, all the
>work
>being done in my derived class.
>>
>On the page itself, I have custom controls and user controls. The user
>controls also work like the pages where the codebehind is derived from my
>derived class, which derives from usercontrol. The custom and user
>controls
>must also be able to work with the menu class.
>>
>Where would be the best place to set up the initial menu, so that my
>derived
>page, the page codebehind and my controls can all interact with it,
>without
>having to build the menu each time?
>>
>Thanks for your time. If this is a little confusing, please ask me to
>attempt to make it clearer.
>>
>Best regards,
>Dave Colliver.
>http://www.AshfieldFOCUS.com
>~~
>http://www.FOCUSPortals.com - Local franchises available
>>
>>
>>

Structure of website

Hi all,
using 1.1
I am creating a dynamic menu structure for my site, however, I may refer to
the structure many times within a page. This would be fine if I was doing it
all in the codebehind of the page, but I am trying to create seperate tiers
for seperate areas. The menu structure I suppose is a middle tier...
The menu is built using a recursive function to build the tree. My page
would normally call a seperate class and function to build the menu. This
would effectively mean that every time I wanted to use the menu in whatever
classes elsewhere in my page, I would have to create the menu from scratch
again to work with it.
This is what I am trying to avoid, as it can be an expensive process to call
the database for every operation.
To throw more confusion into the pot, my page codebehind is derived from my
own class, which is in turn derived from system.web.ui.page. This means that
the codebehind for the page itself has very little code in it, all the work
being done in my derived class.
On the page itself, I have custom controls and user controls. The user
controls also work like the pages where the codebehind is derived from my
derived class, which derives from usercontrol. The custom and user controls
must also be able to work with the menu class.
Where would be the best place to set up the initial menu, so that my derived
page, the page codebehind and my controls can all interact with it, without
having to build the menu each time?
Thanks for your time. If this is a little confusing, please ask me to
attempt to make it clearer.
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises availableHi,
I am guessing that I didn't phrase this question easily...
Basically, I want to have a base class that on the first call to the page,
creates and populates a menu object.
When I need to refer to the menu at any time within the page (such as
creating a menu tree or finding which page I am on through following the men
u
tree, or creating a breadcrumb trail), I don't want to have to create a menu
class for each instance.
What may add to the confusion is that my page, user controls and custom
controls derive from my own base classes, so there is an extra layer of
confusion. I would like my page base class to be able to know about the menu
(which can pass it to the page class), and my UCs base class to know about
it, which can pass to the UC codebehind.
I don't mind creating the menu for each page, but I really only want to
create it once, because it uses a database call, I don't want to have an
expensive process for each use of it.
All help is appreciated.
Regards,
Dave Colliver.
http://www.DerbyFOCUS.com
~~
http://www.FOCUSPortals.com - Portal franchises available
"David" wrote:

> Hi all,
> using 1.1
> I am creating a dynamic menu structure for my site, however, I may refer t
o
> the structure many times within a page. This would be fine if I was doing
it
> all in the codebehind of the page, but I am trying to create seperate tier
s
> for seperate areas. The menu structure I suppose is a middle tier...
> The menu is built using a recursive function to build the tree. My page
> would normally call a seperate class and function to build the menu. This
> would effectively mean that every time I wanted to use the menu in whateve
r
> classes elsewhere in my page, I would have to create the menu from scratch
> again to work with it.
> This is what I am trying to avoid, as it can be an expensive process to ca
ll
> the database for every operation.
> To throw more confusion into the pot, my page codebehind is derived from m
y
> own class, which is in turn derived from system.web.ui.page. This means th
at
> the codebehind for the page itself has very little code in it, all the wor
k
> being done in my derived class.
> On the page itself, I have custom controls and user controls. The user
> controls also work like the pages where the codebehind is derived from my
> derived class, which derives from usercontrol. The custom and user control
s
> must also be able to work with the menu class.
> Where would be the best place to set up the initial menu, so that my deriv
ed
> page, the page codebehind and my controls can all interact with it, withou
t
> having to build the menu each time?
> Thanks for your time. If this is a little confusing, please ask me to
> attempt to make it clearer.
> Best regards,
> Dave Colliver.
> http://www.AshfieldFOCUS.com
> ~~
> http://www.FOCUSPortals.com - Local franchises available
>
>
Hi all,
I am really struggling with this still. Any help would be appreciated...
I don't know if this will work, I am thinking along the lines of ...
In my base page, in the page_init (override), create a new instance of the
class that calls the database for the menu, and create the menu structure
into a dataset (or my own structure)
Then, in my controls (or even the page itself), open the dataset (or my own
structure) that has been created from the base page.
So, for example, I have a data layer... if I have a property in the
datalayer class that stores my dataset, that I populate on the page_init,
when I come to use it in the controls, can I do something as simple as...
MyMenu = this.Menu as MyClass.Menu;
(I am using c#, .net 1.1)
Will it then access the already created Menu?
If it is likely to work, I am not sure of the way to code it. Any help here
is appreciated.
If you don't think it will work the way outlined above, but know of another
way, again, any help is appreciated.
The idea is to just call the database once for something that is likely to
be expensive to create. I don't need it on application or session level.
Page level will be fine. The problem with application or session level is
that if any changes are made to the menu structure, they won't be visible
until it has timed out.
Thanks for your time.
Best regards,
Dave Colliver.
http://www.CardiffFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"David Colliver" <DavidColliver@.discussions.microsoft.com> wrote in message
news:FA252579-0E4C-41FD-979D-171CA8DB9E8F@.microsoft.com...
> Hi,
> I am guessing that I didn't phrase this question easily...
> Basically, I want to have a base class that on the first call to the page,
> creates and populates a menu object.
> When I need to refer to the menu at any time within the page (such as
> creating a menu tree or finding which page I am on through following the
> menu
> tree, or creating a breadcrumb trail), I don't want to have to create a
> menu
> class for each instance.
> What may add to the confusion is that my page, user controls and custom
> controls derive from my own base classes, so there is an extra layer of
> confusion. I would like my page base class to be able to know about the
> menu
> (which can pass it to the page class), and my UCs base class to know about
> it, which can pass to the UC codebehind.
> I don't mind creating the menu for each page, but I really only want to
> create it once, because it uses a database call, I don't want to have an
> expensive process for each use of it.
> All help is appreciated.
> Regards,
> Dave Colliver.
> http://www.DerbyFOCUS.com
> ~~
> http://www.FOCUSPortals.com - Portal franchises available
>
> "David" wrote:
>

Structure Of Yahoo Messenger

hi

Please help me about Structure Of Yahoo Messenger !

thanks

Please help me !


yavary:

hi

Please help me about Structure Of Yahoo Messenger !

thanks

Hi,

Please look for support from Yahoo, thanks.


Hi yavary,

does this article help?http://www.codeproject.com/useritems/YCC_Trainer.asp

Hope my suggestion helps :)

This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


hi and thanks a lot for your answers

i search for my problem

but i decided use .NET Remoting technology

please look in my friends

http://www.codeproject.com/useritems/RemotingEvent.asp?msg=2051788#xx2051788xx

please help me about this link

thanks for your attention !


hello

Please help me !


Hi,

You can download those code and learn for it.

Download demo project and source - 88 KbDownload demo project and source (Asyncronous) - 125 Kb

hi my friend

excuse me for be amator

i download this file and study it and convert to vb.net

but

this is my error

** Could not load file or assembly 'Remotable' or one of its dependencies. The system cannot find the file specified. **

please help me.

thank you


Hi,

You should add your assembly 'Remotable' in your project. It seems there is no such assembly in your project.

In addition, I also download it and find that there are three files, including Remotable class. You may ignore the class.

Hope this helps. Thanks.


hi my friend

thanks aloooooooooooooooooooooot for your attention !

please look at picture (up) !

i don t ignore this class

i don t understand why occure this Error !

thanks for per helps !


Possible Causes

This message might appear because of one of the following problems:

The referenced assembly has not been installed in the global assembly cache (GAC).

hi my friend

unfortunately , i feel Error related to my convert

namely , this project not be correct to vb.net

become thankful help me to convert this .

ashamed !

thank you



hi

TNX , my problem removed !

but i have a chatroom with remoting !

how can do private chat with remoting? without Timer please

beforehand , thank you for your ideas !

TNX


hello

please help me !

thanks


Hi,

yavary:

hi

TNX , my problem removed !

but i have a chatroom with remoting !

how can do private chat with remoting? without Timer please

beforehand , thank you for your ideas !

TNX

For private chat, you should encript your message before sending to remote desk.

Thanks.

Structure vs class

in vb.net you can define a structure...what exactly is this, why would I want to use it and what is the advantage as opposed to a class?

Thanks!

Hi,

structure is a value type, while a class is a reference type. Types that developers use most often are value types (such as Integer), while most types in .NET Framework Base Class Library are reference types (classes)

Difference is that reference type is allocated from the managed heap (New operator you use to instantiate it returns the memory address of the object, this is what happens under the covers).E.g with reference types you are given a reference to the object on the managed heap. And reference types are subject to garbage collection.

Value types on the other hand are allocated on thread's stack, it has no pointer to instance, the variable is the instance itself. Therefore value types are lighter for the CLR than reference types (value types are not GC'd). But they also have limitations, and in scenarios where they are needed to treat like an object (which causes boxing and unboxing), they can also cause performance overhead.

Here's also a quick list to see their differences:
http://msdn2.microsoft.com/en-US/library/2hkbth2a(VS.80).aspx

Structure/Array Question - Easy

I have a Structure and need to create array of Structures for example... How do I accomplish this?

Structure MyStruct

Dim Input1 As String

Dim Input2 As String

End Structure

dim t() as MyStruct

try this

Dim myarray(10)As MyStruct

(if you want the length of the array to be 10)


This is your Structure:

Structure myStruct
Dim Input1 As String
Dim Input2 As String
End Structure

if you want to have an array of your structure with a fix length... then you can do it as..

Dim t(10) As myStruct

if you want to have an array of your structure with dynamic length... i mean if you are not sure what is the length then... you can do it as...

Dim t1() As myStruct
Dim iRow As Integer = 0
While (True) '...an endless loop... just to show example...
ReDim Preserve t1(iRow)
t1(iRow) = New myStruct
t1(iRow).Input1 = ""
t1(iRow).Input2 = ""
iRow += 1
End While

hope it helps./.

Structures vs Variables - Or can I even do this?

Hello all-
I need to pass around the details of a db record a few times and was wondering about using structures. If I create a structure something like the one listed below in one of my XXX.vb files, can I use it like a variable?

**USERDB.VB File**
Public Structure UserDetails
puplic FirstName as string
public LastName as string
End Structure

Public Function GetUserDetails(byval UID as Integer) as UserDetails
**Database crap here**
GetUserDetails.FirstName = objDR("FirstName").tostring
GetUserDetails.LastName = objDR("LastName").tostring
End Function

**WEBFORM1.ASPX.VB**
Private Sub ShowUser(byval UID as integer)
Dim objUserDetails as UserDetails
objUserDetails = GetUserDetails(UID)
lblFirstName.text = objUserDetails.FirstName
lblLastName.text = objUserDetails.LastName
End Sub

Sorry so long. Do I need to destroy the objects when done with them?

Thanks,
DougMaybe use a class instead? Any help would be great!