Hi guys, quick question, my objective is to make class somehow hold all values that i'm using in the program. I'd like the class to act as a database, if that's possible. My only problem is that, i'm passing an array from the main form to the class, and that array contains random numbers that has it's respective meaning in the database. Each number has 3 properties that i want to get/select. It's form my thesis. Any answer will be much appreciated. Here's an example:
in Form1:
myClass callClass = new myClass() // class instantiation
string[] rndNum = new string[47] //array for random numbers
for (int i = 0; i < 47; i++)
{
while (true)
{
int index = rnd.Next(0, 47);
if (!ifSame[index])
{
ifSame[index] = true;
rndNum = index.ToString();
break;
}
}
}
callClass.database(rndNum);
myClass:
public void database (string [] numbers)
{
int prop1 = 0;
int prop2 = 0;
int prop3 = 0;
for (int i = 0; i < numbers.Length; i++)
{
//this part will read the array passed from Form1
//also in this part, as the numbers from the array are being read, there
//respective properties are given to them.
//Somewhat like this,
// if (numbers == "0")
// {
// prop1 = 1;
// prop2 = 2;
// prop3 = 3;
// }
//also i'd like the 3 properties(prop1, prop2, prop3) to be passed to
//Form1 along with it's respective value from the numbers array (#0-47)
}
}