Type.GetType of Byte-Array

  • Thread starter Thread starter Steffi
  • Start date Start date
S

Steffi

Hello,

I want to set the schema of a DataTable. It should have the same structure
than my Datatable in SQL Server. The last column is a Timestamp called
Stempel. Timestamp is treaten an a Byte-Array. What can I do to set the Type
for this column?

Dim myDataTable As DataTable = New DataTable("Adressen")

myDataTable.Columns.Add("ID", Type.GetType("System.Int32"))

myDataTable.Columns.Add("Vorname", Type.GetType("System.String"))

myDataTable.Columns.Add("Nachname", Type.GetType("System.String"))

myDataTable.Columns.Add("Stempel", Type.GetType("???"))



Thank you

Steffi
 
Hello
myDataTable.Columns.Add("Ort", Type.GetType("System.Byte()"))

myDataTable.Columns.Add("Stempel", System.Byte())

both do not work. Any other idea?

Thanks Steffi



Miha Markic said:
Hi Steffi,

Try with System.Byte[].

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Steffi said:
Hello,

I want to set the schema of a DataTable. It should have the same structure
than my Datatable in SQL Server. The last column is a Timestamp called
Stempel. Timestamp is treaten an a Byte-Array. What can I do to set the Type
for this column?

Dim myDataTable As DataTable = New DataTable("Adressen")

myDataTable.Columns.Add("ID", Type.GetType("System.Int32"))

myDataTable.Columns.Add("Vorname", Type.GetType("System.String"))

myDataTable.Columns.Add("Nachname", Type.GetType("System.String"))

myDataTable.Columns.Add("Stempel", Type.GetType("???"))



Thank you

Steffi
 
Use square brackets :)
System.Byte[]

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Steffi said:
Hello
myDataTable.Columns.Add("Ort", Type.GetType("System.Byte()"))

myDataTable.Columns.Add("Stempel", System.Byte())

both do not work. Any other idea?

Thanks Steffi



Miha Markic said:
Hi Steffi,

Try with System.Byte[].

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Steffi said:
Hello,

I want to set the schema of a DataTable. It should have the same structure
than my Datatable in SQL Server. The last column is a Timestamp called
Stempel. Timestamp is treaten an a Byte-Array. What can I do to set
the
Type
for this column?

Dim myDataTable As DataTable = New DataTable("Adressen")

myDataTable.Columns.Add("ID", Type.GetType("System.Int32"))

myDataTable.Columns.Add("Vorname", Type.GetType("System.String"))

myDataTable.Columns.Add("Nachname", Type.GetType("System.String"))

myDataTable.Columns.Add("Stempel", Type.GetType("???"))



Thank you

Steffi
 
Hello Miha,
think i got it with
myDataTable.Columns.Add("Ort", Type.GetType("System.Array"))

Thanks for your help

Stephanie


Miha Markic said:
Use square brackets :)
System.Byte[]

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Steffi said:
Hello
myDataTable.Columns.Add("Ort", Type.GetType("System.Byte()"))

myDataTable.Columns.Add("Stempel", System.Byte())

both do not work. Any other idea?

Thanks Steffi



Miha Markic said:
Hi Steffi,

Try with System.Byte[].

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Hello,

I want to set the schema of a DataTable. It should have the same structure
than my Datatable in SQL Server. The last column is a Timestamp called
Stempel. Timestamp is treaten an a Byte-Array. What can I do to set the
Type
for this column?

Dim myDataTable As DataTable = New DataTable("Adressen")

myDataTable.Columns.Add("ID", Type.GetType("System.Int32"))

myDataTable.Columns.Add("Vorname", Type.GetType("System.String"))

myDataTable.Columns.Add("Nachname", Type.GetType("System.String"))

myDataTable.Columns.Add("Stempel", Type.GetType("???"))



Thank you

Steffi
 
Back
Top