Set AutoIncrement, AutoIncrementSeed, AutoIncrementStep properties for the
primary key column

With Primary_Key_Columns
  .DataType = System.Type.GetType("System.Int32")
  .ColumnName = "PKPlanning"
  .AutoIncrement = True
  .AutoIncrementSeed = -1
  .AutoIncrementStep = -1
End With

On Mon, Nov 9, 2009 at 6:29 PM, trouffiondesiles <[email protected]>wrote:

>
> HI,
>
> I have a problem when i add a row to my slq Server Database.
>
> There is how i add this row :
>
>
>                    DB.getSqlDataSet(RequeteAll, DataSetAll,
> TableName)
>                    Dim Primary_Key_Columns(0) As DataColumn
>                    Primary_Key_Columns(0) = DataSetAll.Tables
> (TableName).Columns("PKPlanning")
>                    DataSetAll.Tables(TableName).PrimaryKey =
> Primary_Key_Columns
>
>                    ObjDataRow = DataSetAll.Tables(TableName).NewRow
>                    'PrimaryKey = DB.GetNewPrimaryKey(DataSetAll,
> "PKPlanning", TableName)
>                    'ObjDataRow("PKPlanning") = 50
>                    ObjDataRow("PKUser") = Item.PKUser
>                    ObjDataRow("PKMonth") = Item.PKMonth
>                    ObjDataRow("PlanningDay") = Item.PlanningDay
>                    ObjDataRow("PKHoraire") = Item.PKHoraire
>
>                    DataSetAll.Tables(TableName).Rows.Add(ObjDataRow)
>
>
>  On the row.add i have an error that PKPlanning can't obtain a NULL
> result.
>
> The Colums PKPLanning is configured into PrimaryKey with
> autoincrement.
>
> Have somebody an answer for my problem??
>
> (Sorry for my english i'm french...)
>
>
> Bye, Nicolas.
>
>

Reply via email to