yo hice esta función, pero me da un error:
Código:
el error me sale dentro del for, me dice que no puedo volver a declarar la variable MyArray, pero por lo que estuve viendo en C# asi es como se asignan los valores al array, quizas me estoy equivocando.public Array ConsultaArray(string StrSql, int numColumnas) { this.DT = this.Consulta(StrSql); string[] MyArray = new string[numColumnas]; for (int c = 0; c <= numColumnas - 1; c++) { string[] MyArray = { this.DT.Rows[c][0].ToString }; } return MyArray; }
Espero que puedan ayudarme.