Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USING System;
- USING System.Collections.Generic;
- USING System.DATA.SqlClient;
- USING System.Linq;
- USING System.Text;
- USING System.Threading.Tasks;
- namespace Selection
- {
- class Program
- {
- static void Main(string[] args)
- {
- string connectionString = "Server=ACER-5253G\\SQLEXPRESS; Database=SoftUni; Trusted_Connection=True";
- SqlConnection connection = NEW SqlConnection(connectionString);
- connection.OPEN();
- USING (connection)
- {
- string selectionCommandString = "SELECT * FROM JudgeFails";
- SqlCommand command = NEW SqlCommand(selectionCommandString, connection);
- SqlDataReader reader = command.ExecuteReader();
- while (reader.READ())
- {
- FOR (INT i = 0; i < reader.FieldCount; i++)
- {
- Console.WriteLine($"{reader[i]} ");
- }
- Console.WriteLine();
- }
- reader.Close();
- SqlDataReader reader2 = command.ExecuteReader();
- while (reader2.READ())
- {
- FOR (INT i = 0; i < reader2.FieldCount; i++)
- {
- Console.WriteLine($"{reader2[i]} ");
- }
- Console.WriteLine();
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment