Skip to main content
deleted 5 characters in body
Source Link
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();
    }

Lee

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();
    }

Lee

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();
    }
deleted 15 characters in body
Source Link

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();
    }

Best Regards, LeeLee

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();
    }

Best Regards, Lee

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();
    }

Lee

Source Link

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();
    }

Best Regards, Lee