Can't seem to get all the results from my reader to add into my ArrayList
Here is the database info
With the following code my ArrayList count "should" equal 4 but I get 2 and the results stored are as followedCode:Table: Servers Field1: ID *Auto Gen ID field* Field2: CleintID Field3: SName Field4: SIP Data Stored within table 1 | 1234 | TestServer1 | 172.17.0.10 2 | 1234 | TestServer2 | 172.17.0.20
DeHolder[0] contains TestServer1
DeHolder[1] contains 172.17.0.20
Why am I not getting entry 1's SIP and entry 2's SName ?
The contents of EncHolder matches so its nothing to do with my Decrypt method.
Here is the code Field1 = SName | Field2 = SIP | Table = Servers | AccountID = 1234
What am I missing?Code:int x = 0; ArrayList EncHolder = new ArrayList(); ArrayList DeHolder = new ArrayList(); Global.cmd.CommandText = "SELECT " + Field1 + ", " + Field2 + " FROM " + Table + " WHERE ClientID ='" + AccountID + "'"; OleDbDataReader reader = Global.cmd.ExecuteReader(); while (reader.Read()) { EncHolder.Add(reader.GetValue(x).ToString()); DeHolder.Add(Crypto.Decrypt(reader.GetValue(x).ToString(), true)); x = x + 1; } reader.Close();
Thanks in advance




Reply With Quote