Bizkaitarra
Member
- Joined
- Feb 8, 2007
- Messages
- 6
- Programming Experience
- 1-3
Hi
I am trying to inset into a table a new row. This table has an autonumeric access primary key.
The problem is that when I trie to make an insertion into it I don´t know how to make that the autonumeric key generate automatic. I can only insert new rows by writing the number I want in this field....
Here is some code if you want to see it:
Me.GAPIDataSource.InsertCommand = "INSERT INTO [Especialidad] ([idEspecialidad], [nombre], [totalCreditos]) VALUES (@idEspecialidad, @nombre, @totalcreditos)"
Me.GAPIDataSource.InsertParameters(0).DefaultValue = Me.idTemporalLV.Text 'I want to make this autonumeric, not have to write manually
Me.GAPIDataSource.InsertParameters(1).DefaultValue = Me.NombreTB.Text
Me.GAPIDataSource.InsertParameters(2).DefaultValue = Me.TotalCreditosTB.Text
Me.GAPIDataSource.Insert()
I am trying to inset into a table a new row. This table has an autonumeric access primary key.
The problem is that when I trie to make an insertion into it I don´t know how to make that the autonumeric key generate automatic. I can only insert new rows by writing the number I want in this field....
Here is some code if you want to see it:
Me.GAPIDataSource.InsertCommand = "INSERT INTO [Especialidad] ([idEspecialidad], [nombre], [totalCreditos]) VALUES (@idEspecialidad, @nombre, @totalcreditos)"
Me.GAPIDataSource.InsertParameters(0).DefaultValue = Me.idTemporalLV.Text 'I want to make this autonumeric, not have to write manually
Me.GAPIDataSource.InsertParameters(1).DefaultValue = Me.NombreTB.Text
Me.GAPIDataSource.InsertParameters(2).DefaultValue = Me.TotalCreditosTB.Text
Me.GAPIDataSource.Insert()