Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Configuration;
- using System.Data.SqlClient;
- class PerdiemSQL
- {
- public void connectToDB(
- string commandString,
- string connectionStringKey = @"default")
- {
- string connectionString = ConfigurationManager.ConnectionStrings[connectionStringKey].ConnectionString;
- using(SqlConnection residentConnection = new SqlConnection(connectionString))
- {
- SqlCommand residentCommand = new SqlCommand(commandString, residentConnection);
- residentConnection.Open();
- using (SqlDataReader residentReader = residentCommand.ExecuteReader())
- {
- while (residentReader.Read())
- {
- // pump pipe
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement