Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:28:48+00:00 2026-06-04T13:28:48+00:00

I am developing a project in SharePoint 2010. My requirement is to get an

  • 0

I am developing a project in SharePoint 2010.

My requirement is to get an empty DataTable but with column names in it from SharePoint List.

The .GetDataTable() method returns only if it has a value.

So basically I need a structure of the list in a DataTable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:28:50+00:00Added an answer on June 4, 2026 at 1:28 pm

    This should give you an empty datatable if the GetDataTable does not retrieve column information.

    DataTable _dt = new DataTable();
    
    foreach (SPField spf in _lst.Fields)
    {
       _dt.Columns.Add(spf.InternalName.ToString(), spf.Type.GetType());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing silverlight web part for sharepoint 2010. In my project I have
I am developing an app which reads data from SharePoint list into an array.
My current project for work involves developing a SharePoint 2007 WebPart which will be
I'm developing a project for windows phone 7. It's very simple I guess but
I am developing a project. I want to include a particular function from 7zip
I am developing sharepoint (MOSS) project in Virtual PC. Unfortunately virtual PC can utilize
I'm developing a webpart in Visual Studio 2010 for SharePoint 2010, and I would
Situation We are currently developing a Sharepoint 2010 site that uses Infopath 2010 forms.
I'm developing project on rails 2.3.8 and I need to get alert box on
I am developing project using Spring , Struts2 & Hibernate . Now I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.