すいません、VB4しかやってないんです、VBAはやったけど(ぼそ) チラシの裏だって立派な書き込み空間なんだからねっ!資源の有効活用なんだからねっ!とか偉そうに言ってるけど、実は色々と書き残したいだけ

だからなに? どうしろと? くるみサイズの脳みそしかないあやしいジャンガリアンベムスターがさすらう贖罪蹂躙(ゴシックペナルティ)

ホーム 連絡をする 同期する ( RSS 2.0 ) Login
投稿数  632  : 記事  35  : コメント  11686  : トラックバック  143

ニュース


片桐 継 は
こんなやつ

かたぎり つぐ ってよむの

大阪生まれ河内育ちなんだけど
関東に住みついちゃったの
和装着付師だったりするの
エセモノカキやってたりするの
VBが得意だったりするの
SQL文が大好きだったりするの
囲碁修行中だったりするの
ボトゲ好きだったりするの
F#かわいいよF#

正体は会った人だけ知ってるの

空気読まなくてごめんなさいなの


わんくまリンク

C#, VB.NET 掲示板
C# VB.NET掲示板

わんくま同盟
わんくま同盟Blog


WindowsでGo言語
WindowsでGo言語


ネット活動


SNSは疲れました

記事カテゴリ

書庫

日記カテゴリ

ギャラリ

イベント活動

プログラムの活動

まじめにLINQはじめました、は、おいといてですね(笑)

悩んだことのメモ。

Array型からArrayList型にする

どっちもデータ配列じゃね?と思う。

Dim oldArray() As String
Dim newArrayList As New ArrayList(oldArray)

というわけで、コンストラクタで渡せる。逆は、ArrayList.ToArray でよさげ。

LINQtoSQLで取ってきたIQueryable型からDataTable型にする

どっちも表題が付けられたデータ要素の集まりじゃね?と思う。

IEnumerlableの場合には、CopyToDatatable をゴリゴリするとできるわけだけれども。

いや、そもそも、根本として、こういうコンバートがいるのかと問われると大人の事情だ、必要な時だってあるさw

で、結論からすると、プログラミングしようぜ、ってことになった。

Public Function ToDataTable(ByVal inQparam As IQueryable) As DataTable

    Dim retDT As New DataTable
    Dim iQpros = inQparam.ElementType.GetProperties

    '受取先カラムの作成
    For Each prop In iQpros
        retDT.Columns.Add(prop.Name)
    Next

    '一行ずつINSERT
    For Each obj In inQparam
        Dim oRow = retDT.NewRow
        For Each qItem In iQpros
            If Not (qItem.GetValue(obj, Nothing) Is Nothing) Then
                oRow(qItem.Name) = qItem.GetValue(obj, Nothing)
            End If
        Next
        retDT.Rows.Add(oRow)
    Next

    Return retDT

End Function

修行しますw

投稿日時 : 2009年8月21日 10:17

コメント

# [C#]IQueriable<T>からDataTableへの変換 2009/08/21 13:02 かずきのBlog
[C#]IQueriable<T>からDataTableへの変換

# Longchamp uk bags 2012/12/21 10:11 http://longchampukbags.webeden.co.uk
The stars in this pool would be the comments and then the pictures are usually secondary.

# Jordan Retro 3 2013/03/06 21:41 http://www.jordanretro3air.com/
Appreciate would be the sole rational and so fine answer to the problem concerning human being your life. Jordan Retro 3 http://www.jordanretro3air.com/

# casquette supreme 2013/03/15 5:32 http://www.b44.fr/
Friendships last while any colleague is convinced bigger hook fineness covering the different. casquette supreme http://www.b44.fr/

# pari street 2013/03/15 9:19 http://www.a88.fr/
In order one management with the worthy of, consider your folks. pari street http://www.a88.fr/

# casquette obey 2013/03/16 9:04 http://www.b77.fr/
It's the best you do not thanks your identiity, but nonetheless , thanks what individuals Quite possibly presents 'm away with you. casquette obey http://www.b77.fr/

# casquette new era 2013/03/16 10:20 http://www.a44.fr/
At any time you might you may even mystery away from an opponent, express to the situation because of this partner. casquette new era http://www.a44.fr/

# destockchine 2013/03/24 0:50 http://d77.fr/
Be careful not to consult your own laughter to 1 reduced fortunate as you and your family. destockchine http://d77.fr/

# usine23 2013/03/25 5:23 http://e55.fr/
Bona fide camaraderie foresees the requirements of any other and not say it's always personal. usine23 http://e55.fr/

# Laredoute 2013/04/07 5:15 http://ruezee.com/
The entire saddest solution to miss out on a professional is intended to be perched directly next to the whole bunch seeing you can actually‘testosterone levels you can keep them. Laredoute http://ruezee.com/

# footcenterfr.com 2013/04/07 14:51 http://www.footcenterfr.com/
Will be final when ever each individual one great friend is sure she has hook brilliance in the several other. footcenterfr.com http://www.footcenterfr.com/

# official coach outlet online 2013/04/07 17:22 http://www.coachfactoryoutlet888.com/
Put on‘tonne take a crack at overtime, the very best elements are produced for those who least can expect these people to. official coach outlet online http://www.coachfactoryoutlet888.com/

# ruemee.com 2013/04/08 4:36 http://ruemee.com/
When you need a substantial sales of the worthwhile, score everyone. ruemee.com http://ruemee.com/

Post Feedback

タイトル
名前
Url:
コメント