読者です 読者をやめる 読者になる 読者になる

                                        using (SampleEntities context = new SampleEntities())
                                        {
                                            // EntityFrameworkに記載
                                            var items = context.Database.SqlQuery<myTable>("SELECT * FROM myTable;");

                                            foreach (var item in items)
                                            {
                                                xlRange = xlSheet.Range[string.Format("A{0}:D{0}", iLoppCount++)];

                                                xlRange.Value2 = new List<string> { 
                                                { Convert.ToString(item.id) },
                                                { Convert.ToString(item.name) },
                                                { Convert.ToString(item.country) },
                                                { Convert.ToString(item.date) },
                                                }.ToArray();
                                            }
                                        }