-
March 28th, 2003, 08:27 AM
#1
How can i add a boolean column to a datatable
Hi!
I'm creating a dataTable using a sql query. I would like to add a boolean column to that dataTAble, but that doesn't works.
here's what i'm doing
_strSQL = "SELECT role, descr " & _
"FROM code_role "
_odpcmdSelect = New Oracle.DataAccess.Client.OracleCommand
_odpcmdSelect.Connection = global.oracleConnection
_odpcmdSelect.CommandText = _strSQL
_odpdaUtilRole = New Oracle.DataAccess.Client.OracleDataAdapter
_odpdaUtilRole.SelectCommand = _odpcmdSelect
_adoDTRole = New DataTable
_odpdaUtilRole.Fill(_adoDTRole)
_adoDTRole.Columns.Add("Accorder", Type.GetType("System.boolean"))
_adoDTRole.AcceptChanges()
I always have an error message saying that my dataType argument cannot be null
Why ?
Thanks for your help
Alex
Alexandre
-
March 29th, 2003, 12:47 PM
#2
_adoDTRole.Columns.Add("Accorder", Type.GetType("System.boolean"))
This line is correct.
I thinkthe problem is that in your db null is not allowed
-
April 4th, 2003, 10:13 AM
#3
I had the same problem recently and just used this:
Code:
_adoDTRole.Columns.Add("Accorder", GetType(System.Boolean))
without the Type. and the quotes. I got the same error using Type.GetType....
HTH,
Greg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|