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 8483393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:05:27+00:00 2026-06-10T20:05:27+00:00

Is it possible to build a DataTable object from scratch using F# I have

  • 0

Is it possible to build a DataTable object from scratch using F#

I have written this code

module DataHelper
open System
open System.Data
open System.Data.SqlClient

let addDataRow (dt : DataTable) kerberos =
    let dr = dt.NewRow()
    dr["Kerberos"] = kerberos
    dt.Rows.Add(dr)

let Func userList : string seq = 
    let dt : DataTable = new DataTable("UserNameListType")
    let dc : DataColumn = new DataColumn("Kerberos")
    dt.Columns.Add(dc)
    Seq.iter (fun user -> addDataRow dt user) userList
    dt

But this has too many errors

  1. VS.NET does not seem to understand DataTable, DataRow classes and only shows me a “Note” as intellisense.
  2. Its hard to use the collection objects Rows, Columns in F# because none of the methods really work (which work easily in C#).
  • 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-10T20:05:29+00:00Added an answer on June 10, 2026 at 8:05 pm

    If you’re doing this in a new project, you need to add references to System.Data.dll and System.Xml.dll. After that, Visual Studio should recognize the types. You can do that by right clicking on “References” in your project and choosing “Add Reference”.

    Aside from that, there are two minor mistakes in your code. The assignment should be written as (note that there is a dot before [ and the operator is <- instead of =):

    dr.["Kerberos"] <- kerberos 
    

    And your Func function should return DataTable:

    let Func userList : DataTable =  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to build a GUI using platform-native code, like Cocoa, in QT?
Is it possible to build msi file using installshield, so that I have one
Is it possible to build static (.a) library using ndk-build from several other static
Is it possible to build a custom version to code like this? <script type=text/javascript>
I have the following piece of code: if (SqlConnection.State == ConnectionState.Open) { using (SqlDataAdapter
Is it possible to build pivotviewer collection of data from database using ria services
Possible Duplicate: Build Tar file from directory in PHP without exec/passthru Does PHP have
Just wondering is it possible to build CLI app that can be run from
If I have 6 modules in my project is it possible to build only
Is it possible to build following SQL statement in Hibernate HQL? SELECT COUNT(*) FROM

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.