public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length) { if (SDR != null) { return(SDR.GetChars(i, fieldoffset, buffer, bufferoffset, length)); } else { return(ODR.GetChars(i, fieldoffset, buffer, bufferoffset, length)); } }
public void run() { Exception exp = null; long rdrResults = 0; OleDbCommand cmd = new OleDbCommand("Select LastName From Employees Where EmployeeID = 100", con); OleDbDataReader rdr = cmd.ExecuteReader(); rdr.Read(); //LastName should be "Last100" try { BeginCase("check result length"); rdrResults = rdr.GetChars(0, 0, Result, 0, Result.Length); Compare(rdrResults, (long)"Last100".Length); } catch (Exception ex) { exp = ex; } finally{ EndCase(exp); exp = null; } try { BeginCase("check result - char[0]"); Compare(Result[0], 'L'); } catch (Exception ex) { exp = ex; } finally{ EndCase(exp); exp = null; } try { BeginCase("check result - char[last char index]"); Compare(Result["Last100".Length - 1], '0'); } catch (Exception ex) { exp = ex; } finally{ EndCase(exp); exp = null; } }