コード例 #1
0
        public MusicApplication.Data.Single GetById(int id)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("spGetSingleById", connection))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@SingleId", id);

                    connection.Open();

                    using (var reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            var single = new MusicApplication.Data.Single(reader);
                            return(single);
                        }
                    }

                    return(null);
                }
            }
        }
コード例 #2
0
 public MusicApplication.Data.Single CreateSingle(MusicApplication.Data.Single single)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
 public MusicApplication.Data.Single UpdateSingle(int id, MusicApplication.Data.Single single)
 {
     throw new NotImplementedException();
 }