-1
votes
1answer
39 views

Combine 2 Arrays Into 1 Datatable

I currently have two arrays which are being populated with information parallel to one another (i.e. array1[0] is a property of the item in array0[0], etc.). Ideally I would really like to combine ...
2
votes
5answers
61 views

Check if string contains in array

When I use a hard coded "4" in the second if, it works. But I have a dynamic string[] ProfileArray and want to check, if the value of View08ListBox1Item contains/not contains with one of the strings ...
0
votes
1answer
18 views

Making roster program, having issues with creating the arrays, C#

In c# I am trying to make a simple program that will have a few functions such as adding and deleting members from a roster, search for a member, and display the current # of members. This will later ...
1
vote
1answer
50 views

Calculate all number in array exept Max value and Min value and zero values

I have some numbers that I get from text-boxes and I want to calculate average of these numbers : float t1 = float.Parse(textBox1.Text); float t2 = float.Parse(textBox2.Text); float t3 = ...
1
vote
1answer
24 views

How to store variable 2D array via Entity Framework?

I have a 2D array of values that can range in size (although, I can make a large, fixed size if needed) that I want to store in a database. Can anyone tell me the best way to do this?
1
vote
2answers
54 views

Sorting array by item type

I have an array of objects that I sort by type. Within that array is a set of objects of one type that are already in their preferred relative order. After the sort, these objects are grouped ...
0
votes
2answers
42 views

How can I change an 2D array to a 2D list and then back to a 2D array again?

I thought searching SO would show me a hit regarding 2D lists to 2D arrays but it seems it's not as common as I had thought. This is what I've got: // init array int[][] a = new int[10][10]; // ...
1
vote
2answers
32 views

C# Sort Array by property based on key array

Say I have the following 2 arrays string[] keys = new string[]{"Annalee Call","Bishop","Ash"}; MyClass[] vals = new MyClass[]{ new MyClass(){name = "Ash"}, new MyClass(){name = "Annalee ...
0
votes
3answers
86 views

What is the simple way to extend the use of array to prevent out of memory exception?

float[][, , ,] tempData = new float[30][, , ,]; private void InitTempData() { const int FocusSize = 400; try { for (int i = 0; i < 30; i++) { tempData[i] = ...
2
votes
1answer
70 views

Most efficient way of using multidimensional array indexers

Say you have a 2D grid of tiles (This is for a 2D tile based game), most tiles occupy 1 spot, however some larger "objects" can fill in multiple spots. I use an indexer on my array to automatically ...
0
votes
3answers
70 views

getters setters array

Probably a really simple problem i can't fix - I'm starting out with C# and need to add values to an array with a getter/setter method for example: public partial class Form1 : Form { string[] ...
2
votes
2answers
33 views

Read-only array field in unsafe struct

This is the original declaration: [StructLayout(LayoutKind.Explicit, Size = 16)] public unsafe struct X { [FieldOffset(0)] public ushort a; [FieldOffset(2)] public fixed byte b[14]; }; I would ...
0
votes
0answers
23 views

error generating nested object and retrieve nested object value in c#

SaveSalePurchaseType = function () { var testTableData = new Object(); testTableData.todo = "SaveSalePurchaseType"; testTableData.testId = testTableData.testId; testTableData.Name = ...
1
vote
1answer
72 views

Creating array of List storing class object?

May i ask if the following code i wrote is correct? Basically, i want to create an 2D array, and within each array, i want to have a list of vertices. So if tCount and pCount is 10, i would have 100 ...
-6
votes
1answer
27 views

2 dimensional matrix array [on hold]

I want to create an 2 dimensional 5x8 array of type int, and this is what ive done: int[,] matrix = new int[5, 8] { { 1, 2, 3, 4, 5,6,7,8 }, { 9,10,11,12,13,14,15,16 }, ...
0
votes
2answers
20 views

dispose global object array to reuse object

I have a global object array in my form. I wanna change the array length in several times. so I need to dispose it and new it with different length. as below code from Do you need to dispose of ...
-1
votes
3answers
78 views

Why are 1-dimensional arrays faster than Jagged arrays in C#?

I was curious if a 1-Dimensional array is faster than a jagged array, and I measured the performance of the following blocks of code: Test 1: Jagged Arrays double[][][][] jagged = ...
1
vote
2answers
39 views

How to add multiple email address receipients retrieved from MySQL?

I'm getting an error on this line below :- email = myDataReader.GetValue(i).ToString(); What I'm trying to do is just retrieve multiple email addresses from MySQL and send email. Based on the ...
1
vote
2answers
57 views

Pass the label that was clicked to its clicked method. C#

So I have a 2D array of labels: Label[][] _mainAreaLabels = new Label [MAX_COLUMNS_OF_CARDS][]; And I can add assign a method to be called when they are clicked: for (int i = 0; i <= ...
0
votes
1answer
41 views

How to get data from SqlDataReader to Array of arrays or Array of strings

I'm trying to populate an array of arrays from a SqlDataReader, but in the end all rows of the array are filled with the same array of numbers. Here's my T-SQL code: SELECT ...
-1
votes
3answers
65 views

C# Treat an enum as an array

In my project i have an enum in which i store Music genres values that looks like this : enum Genres { Rock,Pop,Disco,Sport,Talk,Metal,Hard_Rock,Electro,Classic_Rock} Now in my code i want a ...
0
votes
3answers
53 views

Return a constant string array

I created a string[] getter to get some information on a class. I want it to always return the same value, and not create a new object on each call. I have it implemented now like this: string[] ...
0
votes
2answers
68 views

How To Marshal Int Arrays Or Pointers To Int Arrays

(I understand this might be duplicate but I don't understand the other threads) I'm working with C# an I have a third party dll that needs int arrays (or pointers to int array) as parameters. How do ...
0
votes
1answer
29 views

Trying to make a class that lets me push and pop values like a stack from an array (in a windows forms application), but I'm getting stuck

I have a windows forms application with a numpad on one side for inputting a value into Label1. When the user presses the Enter button, the application should then 'push' the value onto the stack and ...
0
votes
0answers
38 views

Automapper After Map is not working,

I have a mapping similar to this one: Mapper.CreateMap<NewVideoPlayList, Content>() .AfterMap((source, dest) => dest.Handling.PublishTo.Fronts = new Front[] {source.FrontsAssignment} ...
0
votes
1answer
42 views

wpf nested foreach index array out of bounds

i created 2 foreach loop and i am getting error ( index outside of bounds of array ) , because i use 2 arrays . This is what i do : using (StreamReader reader = ...
0
votes
5answers
91 views

How can we get range of number

I want to make a range number(for example: 1-10), according to user input in C#. I have a asp text-box, button. User can enter a number in text-box which is less than 10,000. I want, when user click ...
1
vote
2answers
52 views

How to insert images into image array in visual studio?

The problem is I'm creating an image array inside the class. Inside the constructor of the class I'm inserting image elements into the array: public sealed partial class MainPage : Page { ...
1
vote
2answers
79 views

Determine which method to call based on array size and number of arguments

I have a heavy computational algorithm which I must complete. In order to make it as efficient as possible, I've broken it into five methods based on the number of arguments. This allows me to ...
0
votes
2answers
66 views

Subtract number from array

I have a program that uses an array that looks like this: 1,2,3,4,5 I have a number '10' and what I want to do is to subtract that number from the array. It's difficult to explain, but I am using ...

1 2 3 4 5 122
15 30 50 per page