Guest User

Untitled

a guest
Mar 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. var conn = new SqlConnection("serverinfo");
  2. SqlCommand query = new SqlCommand("SELECT Store.StoreID, Store.Name,
  3. Product.Name, " +
  4. " StockRequest.Quantity, StoreInventory.StockLevel from Store" +
  5. " LEFT JOIN StoreInventory ON StoreInventory.StoreID = Store.StoreID"
  6. + " LEFT JOIN Product ON StoreInventory.ProductID =
  7. Product.ProductID" + " LEFT JOIN StockRequest ON StockRequest.StoreID
  8. = Store.StoreID", conn);
  9.  
  10. SqlDataReader read;
  11.  
  12. try {
  13. conn.Open();
  14. read = query.ExecuteReader();
  15. while (read.Read()) {
  16. Console.WriteLine("{0} {1} {2} {3} {4}",
  17. read["StoreID"],
  18. read["Name"],
  19. read["Name"],
  20. read["Quantity"],
  21. read["StockLevel"]);
  22.  
  23. }
Add Comment
Please, Sign In to add comment