title: How to get Sharepoint List using c#
body: <p>How to get fields values from a particular list item.In my case i want to get all form fileds of Workplan list.Actually i want to get Workplan all list item and insert to sharepoint 2013 associated database.   </p>
  
  <p><img src="https://i.stack.imgur.com/0bgar.png" alt="example"> </p>
  
  <p>I try the following code.</p>
  
  <pre><code>string strUrl = "http://example.com/default.aspx";
  using (SPSite site = new SPSite(strUrl))
  {
      using (SPWeb web = site.OpenWeb())
      {                 
  
          SPList list = web.Lists[52];
          SPQuery myquery = new SPQuery();
          myquery.Query = "";        
          SPListItemCollection items = list.GetItems(myquery);                
  
          foreach (SPListItem item in items)
          {
              if (item != null)
              {
                  var Name = item.ListItems.Fields.List;
                  Console.WriteLine("Name is :" + Name);
              }
          }  
      }
  }
  </code></pre>