概要
数年ぶりのQiitaだけど、超しょーもない糞メモです。
自分でDataTableからSQLiteのテーブルに置き換えるコードを作る際のSQL側のテーブル定義を作るときに、
カラムの型をどう判定するかで使うために調べたメモです。
結果
Windows10 64bit PC
コンパイルは32bit
Module Module1
Sub Main()
Dim dt As New DataTable("dt")
dt.Columns.Add("String", Type.GetType("System.String"))
dt.Columns.Add("Double", Type.GetType("System.Double"))
dt.Columns.Add("Int32", Type.GetType("System.Int32"))
dt.Columns.Add("Int64", GetType(Int64))
dt.Columns.Add("Integer", GetType(Integer))
Console.WriteLine($"
String:{dt.Columns("String").DataType.FullName}
Double:{dt.Columns("Double").DataType.FullName}
Int32:{dt.Columns("Int32").DataType.FullName}
Int64:{dt.Columns("Int64").DataType.FullName}
Integer:{dt.Columns("Integer").DataType.FullName}
")
End Sub
End Module
String:System.String
Double:System.Double
Int32:System.Int32
Int64:System.Int64
Integer:System.Int32
続行するには何かキーを押してください . . .