Well, the GetDouble can't return 0, as I said, it works just perfect when I let the j where it is ^^
1 2 3 4 5 6 7
|
while(myReader->Read()) {
for ( int j = 0; j < myReader->FieldCount; j++ ) {
iASpeed[j] = 2;
//iASpeed[j] = myReader->GetDouble(j);
String ^Mesaj = "iASpeed = " + iASpeed[2];
MessageBox::Show(Mesaj);
}
|
This is the same, every messagebox I get says "iASpeed = 0" ^^
This is how I defined iASpeed
|
static array <double>^ iASpeed = gcnew array<double>(92);
|
However, this way, it tells me the exact valor:
1 2 3 4 5 6 7 8
|
while(myReader->Read()) {
for ( int j = 0; j < myReader->FieldCount; j++ ) {
iASpeed[2] = 2;
//iASpeed[j] = myReader->GetDouble(j);
String ^Mesaj = "iASpeed = " + iASpeed[2];
MessageBox::Show(Mesaj);
}
}
|
Also, after some testing, I found out that it basically tries to write all the values in 0...
1 2 3 4 5 6 7
|
while(myReader->Read()) {
for ( int j = 0; j < myReader->FieldCount; j++ ) {
iASpeed[j] = myReader->GetDouble(0);
String ^Mesaj = "iASpeed = " + iASpeed[0];
MessageBox::Show(Mesaj);
}
}
|
It seems that the FOR loop isn't working properly, even though it rolls 20 times, the j seems to stay the same, as it keeps updating the value in iASpeed[0]
Again, this does the same thing, it stores all values in iASpeed[1]
1 2 3 4 5 6 7 8 9
|
while(myReader->Read()) {
//for ( int j = 0; j < myReader->FieldCount; j++ ) {
int j = 0;
iASpeed[j+1] = myReader->GetDouble(0);
String ^Mesaj = "iASpeed = " + iASpeed[1];
MessageBox::Show(Mesaj);
j++;
//}
}
|