What Class For Serializable Multidimensional Arrays

Feb 19, 2009

EDIT: SI have a web service which uses a class of functions in order to return data used in various business processes (via InfoPath). One of the functions takes a given SQLCommand object and executes it into a SQLDataReader. Now depending on the SQL command text used this may return one or many rows of one or many columns. So what is the best class for this function to return bearing in mind it needs to be serialized by the web service.

My existing code is:
Dim array As New ArrayList
Try

[code].....

View 1 Replies


ADVERTISEMENT

Limits For Multidimensional Arrays?

Sep 24, 2011

I just made a multidimensional array that was 1024 x 1024 x 1024. I get an OutOfMemory exception. What is the largest size multidimensional array that is safe to use? I'm doing this in VB.net so all .net answers are acceptable.

EDIT

When I said safe, I mean, a good size for just about any computer. What size would run smoothly on a 32bit operating system. I didn't realize that the 1024 size was 4G. I'm hoping for something a 16th of that.

View 3 Replies

Multidimensional Associative Arrays In .NET?

Dec 15, 2009

is there in VB.NET something like this in php?:

$var["a1"]['name']="Mike";
$var["a1"]['nick']="MMM";

I tried hashtables, dictionary, lists and arrays in .net, all I could get is a simple key=>value array Is there a simple solution if not, is there a class or something for this?

View 1 Replies

Extracting Data From Multidimensional Arrays?

May 24, 2012

Currently, I am working on a personal project of mine to create a Pokemon Battle Simulator, mainly because I wanted to see if I could. I have created a multidimensional array used to hold all the information needed for each Pokemon I add (Currently it is only two Pokemon) The code for this is as follows:

Public AllPOKEMON(,) As Pokemon = { _
{New Pokemon("Charizard", 6, 2, 10, 360, 293, 348, 280, 295, 328)}, _
{New Pokemon("Venusaur", 3, 5, 8, 364, 289, 328, 291, 328, 284)} _

[code].....

View 3 Replies

Multidimensional Arrays / Vectors And Pointers?

Oct 15, 2011

I'm looking for something similar to using vectors and pointers that I've used before in C++; unfortunately, it doesn't seem like there's an equivalent function in VB.net.What I have is a copy of the array behind a multi-line Rich Text Box, and I need to separate the words from each line (or element of the array) so I can analyze each one separately.In C++ I would do something like this, so I could continuously expand as needed:

[Code]...

View 6 Replies

Variable Length Multidimensional Arrays?

Mar 2, 2009

Is it possible to have a 2 dimensional array of a type struct such that the size of the last dimension can vary by element of the first?eg:-structure mydatadim param1 as integerdim param2 as byteend structuredim main_array(100,10) as mydataThen at anytime change the size of the last dimension like...redim main_array(10, 5)redim main_array(15,7)leaving all other array entrys' last dimension unchanged and independent??VB2005 starter

View 3 Replies

VS 2008 For Each Loop And Multidimensional Arrays

Jun 15, 2010

I've got a multidimensional array set up like this:

[Code]...

What I want to do, is use a for each loop to add the strings of the array into a ComboBox.

View 25 Replies

VS 2008 Join Multidimensional Arrays?

Aug 21, 2010

I have been trying to join multiple multidimensional arrays but with no luck. I basically have three two-dimensional arrays as following:

[Code]...

View 5 Replies

Create A Multidimensional Array That Contains Arrays Of Different Lengths?

Jan 1, 2011

Is there any way to create a multidinensional array that contains arrays of different lengths (similar to nesting arrays of different lengths in python).

Because if I were to declare a variable Dim accounts(2,2) As Integer all 1D arrays at each dimension have the same length. Is there any way to create an array so that this is not the case?

e.g The above code would create an array like this:
[[0,0],[0,0]]
but would it be possible to create this:
[[0,0],[0,0,0]]

View 3 Replies

Get MD5 Of Serializable Class

Feb 27, 2011

I have a class that is serializable. I would like to compute the MD5 of it. I already had a function in the project to get a MD5 from a Stream, so I reused it, and created a function to convert an object to a memorystream. The code is as follows. Does anyone see any problems, but more to the point, is there an easier way to do this that I'm simply missing?

[Code]...

View 2 Replies

Dynamic Variable Size Multidimensional Multitype Arrays?

Oct 11, 2010

i am in the process of learning myself VB.net (2010 dotnet 4 )And am a litte confused in whats the best way to program what can be called an array.i want to have an array that looks like this,

{{"aap", 1}, {"noot", 2}, {"mies", 3, "boom"}, {"vuur", 4, 7}}
now i tried to declare

[code].....

View 9 Replies

Serializable Class Collections?

Apr 11, 2009

I have a class that contains a list of properties which serializes just fine. However I need one of those properties to contain a collection of another class to give me sub classes

Example XML
<VideoOptions>
<property1>value1</property1>

[code].....

View 2 Replies

Cannot Get Values From A Serializable Class And Structure

Feb 17, 2010

I have a serializable class and structure I created for an ArrayList to be access within a Web Application. The problem I am having is the count comes back as zero after calling New. I debugged the code and the Arrylist is being populated

View 3 Replies

Instead Of Marking A Class With The <Serializable()> Attribute?

Jul 10, 2011

ToSerializable is it possible instead of marking a Class with the <Serializable()> attribute?

as in the following Class.So you could maybe do:>>myObject.ToSerializable

<Serializable()> _Public Class ExampleClass
End Class

View 11 Replies

Serializable()> Attribute For A BO Class Which Is On App Server?

Dec 5, 2011

I have the following architecture for my project:UI -> Web Server -> App Server -> Database

I am using SOA architecture for my project. My Web Service is residing on AppServer having BL (Business Layer) / BO (Business Object) / DAL (Data Access Layer). I am exposing the BL using Web Service. I am getting the service reference to this Web Service at WebServer by creating the proxy using WSDL.exe. Now my question is:

[Code]...

View 2 Replies

VS 2008 How To Have A Serializable Class Ignore A Property

Sep 11, 2009

How can i make one item in my class not serialize?

I have tried adding:

<System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)> with no avail

View 2 Replies

.net - Can't Call Serialize() On Instance Of Serializable Singleton Class?

Nov 28, 2011

I have a VB.NET singleton class which implements Serializable:

Imports System.IO
Imports System.Runtime.Serialization

<Serializable()> Public Class CoordinateHistory[code].....

My problem is that I can't actually call .Serialize() on the instance of this class, like all of the examples online show. What am I doing wrong?

View 2 Replies

C# - Serialize A Class Containing An Object (of Any Serializable Type) To XML (Conditon: .NET 1.1)?

Sep 21, 2011

Question: I must get the content of all sessions in a HttpModule, under .NET 1.1. (don't ask my why certain people still use it) I can write the module, I can get the sessions. But... sessions are stored as

[Code]...

View 2 Replies

File I/O And Registry :: Multidimensional Arrays - Save File/Load File?

May 13, 2012

I'm currently developing an editor for an AFL management sim.I want to be able to load three or four multidimensional arrays to the program, then save them to the same file. I tried the tutorial on here but got completely muddled up. Why can't it be easy like in VB6 When it was like 10 lines of code tops!

View 5 Replies

Class With Dynamic Arrays Inside Another Class Which Also Has Dynamic Arrays?

Nov 15, 2011

Below you will find a code sample that I have dummied up to try and demonstrate the issue I am having. However, this is just a dummied up piece of code. The actual program has noting to do with STUDENTS or TEACHERS. Basically, the problem I'm having is trying to have a CLASS within another CLASS each of which contain ARRAYS that need to be dynamic in size. The sample has a CLASS called STUDENTS that can have in theory many students, the number of which are unknown to the CLASS. I need to be able to add STUDENTS to the ARRAY programmatically.

The CLASSROOM Class should also be an Array since each TEACHER will have MANY Students. There will be only 1 Teacher for a given classroom but the SCHOOL will have MANY CLASSROOMS. Again, I need to programmatically add Teachers and Students without having predefined Array sizes. The code I have listed below will NOT work but it demonstrates what I am trying to achieve. I want to be able to reference the CLASS by using something like this ...

School(iTeacherIndex).Student(iStudentIndex) = "Rick Smith"

I feel like I should be able to use ARRAYLIST in both classes but haven't been able to get it to work. I've tried DIM'ing as ARRAY and can't get that to work either.If I can get ARRAYLIST to work then I shouldn't need to worry about expanding the array via UBOUND (if it's even possible).The REAL question is "How do I have a CLASS within a CLASS, each of which has ARRAYS that need to be dynamic in nature so they can be expanded as needed? The size of the array cannot be determined ahead of time".

REMEMBER . . . the actual program has nothing to do with Students and Teachers. This was just my way of demonstrating the issue using an analogy that I thought everyone could understand. The actual Class is much more involved.I have purposely hardcoded some values just to make the sample easier to work with. This is NOT how I normally program but is just here to hopefully make things a little more clear.

Here is the sample code . . .
'***********************************************************************************
'***********************************************************************************
'***********************************************************************************

'Here is the code that is in the form - This obviously doesn't work

Private Sub TeacherTestDemo()
Dim iTeacherIndex As Byte
Dim iStudentIndex As Byte

[code]....

View 2 Replies

Set / Get For Class Arrays?

Apr 30, 2009

What should the set/get function look like for the following class?[code]...

View 7 Replies

Using Arrays In A Class

May 22, 2010

This section of code is part of a much larger program.However, I can't seem to find the problem with this error.Error: Object reference not set to an instance of an object.[code]I'm using this array inside of a class form to maintain the memory of a computer player in a rock, paper, scissors game. There are two computer players involved; thus, the need for a unique instance of each array for each player.I'm struggling with this program and all of my errors are gone until I try to run the main form.I can link more code if needed.

View 3 Replies

Arrays In A Custom Class?

Feb 14, 2009

I can't figure out why this does not work.

Public arrs(32) As ARR
Public Class ARR
Public nr As Integer

[Code].....

View 2 Replies

Accessing Arrays In A Class Via Properties?

Apr 8, 2010

Is it possible for one class to access an array of values within another class as a readonly property of the second class? All of the examples and references on class properties imply that one can only retrieve one value by calling a class' property.

View 2 Replies

Accessing Two Dimensional Arrays Within A Class?

Aug 30, 2011

Ive currently got this:

Public Class World
Dim StringA() As String
Property SetString() As String()
Get

[code]....

I need StringA to be a Two-Dimensional Array. I've played around with it and was unable to figure it out..

View 6 Replies

Class Property Arrays Not Holding/ Updating Values

Oct 1, 2011

I am trying to use several Class arrays to hold values that I will cycle through at a later point to perform some calculations. I need to change the array sizes to fit the data as it is entered. I am using one procedure to set the first element of each array and then a separate procedure to pass the additional values as they are entered.

Until my last attempt at changing my code, my StartBalance sub seemed to work, I could step through and see the values assigned to the class arrays in the code block. However, when it moved on to the Transaction sub, it did not recognize that the first set of values were set, the array shows zero values for index 1.

I have gone through several changes trying different ideas from reading blogs and articles, but I guess I am not understanding how these work. I even used the class arrays directly instead of the Property procedures to see if I would get a different result, but I do not.

I believe I must be approaching this incorrectly and though I can find dozens of examples of setting class variables and even a couple on using arrays as class variable, I can not find any that show how to then pass values to those arrays.

Public Class Statement
Private _tranDate(1) As Date
Private _amount(1) As Double

[Code]....

View 8 Replies

Making Sprite Class And Cycling Through Image Arrays

Feb 2, 2012

I am using vb.net by the way. From what I understand, Xna is not usable in visual Basic. Therefore, in order to create my characters, I defined a sprite class. Now my question is.... (I am drawing everything using a timer on the form btw by the process of invalidation.)... how do I use time to cycle through the images in an image array while the instance has no focus, and whilst the class inherits the "Control" class? Basically, how do i get these instances to act without user input? I want a character to eventually respond to user input, but I also need npcs that do not need any input in order to move themselves. Also, I need this in such a way that each instance's processes do NOT interfere with the processes of others. So that whatever timing I use does not also stall the whole window/form.

View 2 Replies

Serializable Dictionary, How To Set Key Name

Jul 16, 2010

Question: I use a serializable dictionary class, found at , to serialize a dictionary.

View 6 Replies

Why Isn't .Net Object Serializable

Jun 2, 2010

I've got a 'MyDataTable' class that inherits from System.Data.DataTable I've implemented ISerializable in my class and have a 'Public Overrides Sub GetObjectData...' But when I try to serialize the an object of 'MyDataTable' I get an error saying that 'MyDataTable' is not marked as serializable.

[Code]...

View 2 Replies

C# - Serializable Partial Classes?

May 29, 2009

I have the follow VB.NET class definition:<Serializable()> Partial Public Class Customers End Class

Inside another file I have the same thing (with different methods and variables of course). When I compile, I get the following error:Attribute 'SerializableAttribute' cannot be applied multiple times.The error is pretty self explanatory. My question is though, if I just mark the one class as Serializable(), can I assume the entire class with be marked as serializable()? In other words, Do I only need the serializable() tag in 1 spot in the class?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved