Skip to main content
3 of 3
deleted 5 characters in body
Robert Lindgren
  • 24.5k
  • 12
  • 53
  • 79

Here is my sample code for your reference.

static void Main(string[] args)
    {
        //make changes based on your site url
        string siteurl = "http://sp:12001/";
        using (SPSite site = new SPSite(siteurl))
        {
            using (SPWeb web = site.OpenWeb())
            {
                SPList Survey = web.Lists.TryGetList("Survey2");
                foreach(SPListItem item in Survey.Items){
                    //Question1 is your survey question, update/add based on your survey list questions.
                    Console.WriteLine(item["Question1"]);
                }
                
            }
        }
        Console.ReadKey();
    }