Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. List<int> list = new List<int>();
  2.  
  3. using (SqlDataReader reader = cmd.ExecuteReader())
  4. {
  5. while (reader.Read())
  6. {
  7. list.Add(reader.GetInt32(0));
  8. }
  9. }
  10. return list.ToArray();
  11.  
  12. List<double> xValuesList = (from IDataRecord r in dataReader
  13. select (double)r["xVal"]
  14. ).ToList();
  15.  
  16. List<double> yValuesList = (from IDataRecord r in dataReader
  17. select (double)r["yVal"]
  18. ).ToList();
  19. List<double> zValuesList = (from IDataRecord r in dataReader
  20. select (double)r["zVal"]
  21. ).ToList();
  22.  
  23. public class Point3D
  24. {
  25. public readonly double X;
  26. public readonly double Y;
  27. public readonly double Z;
  28.  
  29. public Point3D(double x, double y, double z)
  30. {
  31. X = x;
  32. Y = y;
  33. Z = z;
  34. }
  35. }
  36.  
  37. List<Point3D> list = new List<Point3D>();
  38.  
  39. using (SqlDataReader reader = cmd.ExecuteReader())
  40. {
  41. while (reader.Read())
  42. {
  43. list.Add(new Point3D(reader.GetDouble(0), reader.GetDouble(1), reader.GetDouble(2)));
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement