二维数组及其矩阵表示惯例

时间:2015-05-17 18:10:34

标签: javascript matrix multidimensional-array computer-science

我们说我有一个二维数组[[1,2,3],[4,5,6]](javascript语法)。当我把它写成纸上的矩阵时,它应该是:

  private void bLogIn(object sender, EventArgs e)
    {

        string logging = "select * from CLIENT where LOGIN='" + this.t_Login.Text + "' and PASSWORD='" + this.t_Password.Text + "' ;";

        OracleConnection conn = new OracleConnection("Data Source=XXX/orcl;User Id=XXX;Password=XXX;");
        OracleCommand cmd = new OracleCommand();

        cmd.CommandText = logging;
        cmd.Connection = conn;
        try
        {
            conn.Open();
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }



        int count = 0;

        OracleDataReader reader = cmd.ExecuteReader();  // At this line there is the error: Operation is not valid due to the current state of the object

        while (reader.Read())
        {
           count = count + 1;
        }
        if (count == 1)
        {
        MessageBox.Show("Welcome");
        }
        else
        {
            MessageBox.Show("Wrong Password");
        }
        conn.Dispose();
    }

OR

1   4
2   5
3   6

基本上,第一级是水平还是垂直表示? 这是否有约定?

1 个答案:

答案 0 :(得分:0)

从技术角度来看,无法将多个数组表示为列:

[[1,2,3],
 [4,5,6]] // two arrays, one containing 1-3, the other 4-6

[[1, [4,
  2,  5,
  3]  6]] // three arrays: [[1, [4, 2, 5, 3], 6]]