Click here to Skip to main content
16,005,467 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: requirements Pin
mr_lasseter23-Jan-07 3:46
mr_lasseter23-Jan-07 3:46 
GeneralRe: requirements Pin
Colin Angus Mackay23-Jan-07 3:47
Colin Angus Mackay23-Jan-07 3:47 
GeneralRe: requirements Pin
Dave Kreskowiak23-Jan-07 3:52
mveDave Kreskowiak23-Jan-07 3:52 
GeneralRe: requirements Pin
obarahmeh23-Jan-07 20:24
obarahmeh23-Jan-07 20:24 
GeneralRe: requirements Pin
Dave Kreskowiak24-Jan-07 2:32
mveDave Kreskowiak24-Jan-07 2:32 
Questioncoding for retriving and save data in vb6 Pin
Sissy1222-Jan-07 22:59
Sissy1222-Jan-07 22:59 
AnswerRe: coding for retriving and save data in vb6 Pin
Parwej Ahamad23-Jan-07 0:38
professionalParwej Ahamad23-Jan-07 0:38 
QuestionAdding a new record to a DataTable with Identity column Pin
MatthysDT22-Jan-07 20:58
MatthysDT22-Jan-07 20:58 
In my application I have a typical setup:

* Dataset with numerous DataTables, each with a TableAdapter
* Various BindingSources

I want to add a new record to a table of which I only fill one record at a time into my DataTable, meaning the DataTable in the DataSet will always only have 1 record.

The table in my database (SQL2000) has an Identity(1,1) column as the Primary Key.

When I add a new record to my DataTable, the first problem I get is that the Primary Key for the new record is wrong, probably because it doesn't know what the last identity insert value in the SQL table is. But even when I specify a value an Exception occurs at my BindingSource.EndEdit() section of the code. This exception reports that I cannot insert a NULL value into Column "ID"(or whatever my PK column is named)

Where can I find an example of adding a user entered record to a datatable with an Identity column. This must be done using the controls on the form that are bound to the datasource.
(WinForms VB.Net, Visual Studio 2005)

you can't forget something you never knew...

"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann

AnswerRe: Adding a new record to a DataTable with Identity column Pin
shreekar22-Jan-07 21:59
shreekar22-Jan-07 21:59 
GeneralRe: Adding a new record to a DataTable with Identity column Pin
MatthysDT22-Jan-07 22:17
MatthysDT22-Jan-07 22:17 
GeneralRe: Adding a new record to a DataTable with Identity column Pin
shreekar22-Jan-07 22:26
shreekar22-Jan-07 22:26 
GeneralRe: Adding a new record to a DataTable with Identity column Pin
MatthysDT22-Jan-07 22:56
MatthysDT22-Jan-07 22:56 
QuestionThreading issue Pin
Sandeep_S22-Jan-07 18:48
Sandeep_S22-Jan-07 18:48 
AnswerRe: Threading issue Pin
Christian Graus22-Jan-07 18:52
protectorChristian Graus22-Jan-07 18:52 
GeneralRe: Threading issue Pin
Sandeep_S22-Jan-07 19:07
Sandeep_S22-Jan-07 19:07 
GeneralRe: Threading issue Pin
Christian Graus22-Jan-07 19:54
protectorChristian Graus22-Jan-07 19:54 
GeneralRe: Threading issue Pin
Sandeep_S22-Jan-07 20:05
Sandeep_S22-Jan-07 20:05 
GeneralRe: Threading issue Pin
Christian Graus22-Jan-07 20:09
protectorChristian Graus22-Jan-07 20:09 
GeneralRe: Threading issue Pin
Sandeep_S22-Jan-07 20:28
Sandeep_S22-Jan-07 20:28 
GeneralRe: Threading issue Pin
Christian Graus22-Jan-07 20:35
protectorChristian Graus22-Jan-07 20:35 
GeneralRe: Threading issue Pin
Sandeep_S22-Jan-07 20:50
Sandeep_S22-Jan-07 20:50 
GeneralRe: Threading issue Pin
Christian Graus22-Jan-07 20:56
protectorChristian Graus22-Jan-07 20:56 
AnswerRe: Threading issue Pin
Guffa22-Jan-07 19:16
Guffa22-Jan-07 19:16 
GeneralRe: Threading issue Pin
Sandeep_S22-Jan-07 19:19
Sandeep_S22-Jan-07 19:19 
AnswerRe: Threading issue Pin
Guffa22-Jan-07 19:43
Guffa22-Jan-07 19:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.