D
Dianna K
I am constantly receiving the "Object reference not set to
an instance of an object" Exception when I try to set the
autoincrement to true. I found the Knowledge Base Article
819346 which seems to address the error message, but how
do I know that this is what is causing the problem..? If
this is the route I must take, is the only fix for this is
to upgrade to .Net 2003???
Here is the line of code I am receiving error on:
Dim IdCol As String = "type_id"
Dim ParentTable As String = "PgmTypes"
Ds1.Tables(ParentTable).Columns(IdCol).AutoIncrement = True
'Error occurs here
Ds1.Tables(ParentTable).Columns(IdCol).AutoIncrementSeed
= -1
Ds1.Tables(ParentTable).Columns(IdCol).AutoIncrementStep
= -1
Ds1.Tables(ParentTable).PrimaryKey = New Object()
{Ds1.Tables(ParentTable).Columns(0)}
sqlDataAdp.Fill(Ds1, ParentTable)
uwGrid.DataSource = Ds1
uwGrid.DataMember = ParentTable
'Set the datakeyfield for the row.datakey property
population
uwGrid.Bands(0).DataKeyField = IdCol
uwGrid.DataBind()
an instance of an object" Exception when I try to set the
autoincrement to true. I found the Knowledge Base Article
819346 which seems to address the error message, but how
do I know that this is what is causing the problem..? If
this is the route I must take, is the only fix for this is
to upgrade to .Net 2003???
Here is the line of code I am receiving error on:
Dim IdCol As String = "type_id"
Dim ParentTable As String = "PgmTypes"
Ds1.Tables(ParentTable).Columns(IdCol).AutoIncrement = True
'Error occurs here
Ds1.Tables(ParentTable).Columns(IdCol).AutoIncrementSeed
= -1
Ds1.Tables(ParentTable).Columns(IdCol).AutoIncrementStep
= -1
Ds1.Tables(ParentTable).PrimaryKey = New Object()
{Ds1.Tables(ParentTable).Columns(0)}
sqlDataAdp.Fill(Ds1, ParentTable)
uwGrid.DataSource = Ds1
uwGrid.DataMember = ParentTable
'Set the datakeyfield for the row.datakey property
population
uwGrid.Bands(0).DataKeyField = IdCol
uwGrid.DataBind()