Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (SqlConnection conn = new SqlConnection(this.connectionString))
- {
- using (SqlCommand cmd = conn.CreateCommand())
- {
- cmd.CommandText = "LoadFromRepository";
- cmd.CommandType = CommandType.StoredProcedure;
- cmd.Parameters.AddWithValue("@ID", fileID);
- conn.Open();
- using (SqlDataReader rdr =
- cmd.ExecuteReader(CommandBehavior.CloseConnection))
- {
- while (rdr.Read())
- {
- // do something with read data
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment