Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var conn = new SqlConnection("serverinfo");
- SqlCommand query = new SqlCommand("SELECT Store.StoreID, Store.Name,
- Product.Name, " +
- " StockRequest.Quantity, StoreInventory.StockLevel from Store" +
- " LEFT JOIN StoreInventory ON StoreInventory.StoreID = Store.StoreID"
- + " LEFT JOIN Product ON StoreInventory.ProductID =
- Product.ProductID" + " LEFT JOIN StockRequest ON StockRequest.StoreID
- = Store.StoreID", conn);
- SqlDataReader read;
- try {
- conn.Open();
- read = query.ExecuteReader();
- while (read.Read()) {
- Console.WriteLine("{0} {1} {2} {3} {4}",
- read["StoreID"],
- read["Name"],
- read["Name"],
- read["Quantity"],
- read["StockLevel"]);
- }
Add Comment
Please, Sign In to add comment