Click here to Skip to main content
15,900,378 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Big/Little Endian Pin
Brent Lamborn25-Jan-06 3:36
Brent Lamborn25-Jan-06 3:36 
QuestionIdle System Pin
militiaware24-Jan-06 11:43
militiaware24-Jan-06 11:43 
AnswerRe: Idle System Pin
Christian Graus24-Jan-06 12:49
protectorChristian Graus24-Jan-06 12:49 
QuestionRelease Custom Control (Hide Source Code) Pin
AlexeiXX324-Jan-06 10:19
AlexeiXX324-Jan-06 10:19 
AnswerRe: Release Custom Control (Hide Source Code) Pin
militiaware24-Jan-06 12:00
militiaware24-Jan-06 12:00 
AnswerRe: Release Custom Control (Hide Source Code) Pin
Dave Kreskowiak24-Jan-06 12:34
mveDave Kreskowiak24-Jan-06 12:34 
QuestionPulling XML data into a data grid Pin
George Julien24-Jan-06 8:38
George Julien24-Jan-06 8:38 
QuestionReturning primary key value when inserting records Pin
dptalt24-Jan-06 5:16
dptalt24-Jan-06 5:16 
I'm using the following code to add a record to a SQL database.
When the record is inserted how can I get the primary key value the database assigns to a field in that record when it is inserted.

Thanks


Dim DBCommand1 As SqlCommand
NonQueryText = "insert into mytable(field1)values(@field1)

DBCommand1 = New SqlCommand(NonQueryText, Connection1)
DBCommand1.Parameters.Add("@field1", SqlDbType.Char,10, "field1").Value = "abc"

Connection1.Open()
DBCommand1.ExecuteNonQuery()
AnswerRe: Returning primary key value when inserting records Pin
Guffa24-Jan-06 6:58
Guffa24-Jan-06 6:58 
GeneralRe: Returning primary key value when inserting records Pin
AlexeiXX324-Jan-06 10:23
AlexeiXX324-Jan-06 10:23 
AnswerRe: Returning primary key value when inserting records Pin
Guffa24-Jan-06 21:56
Guffa24-Jan-06 21:56 
GeneralRe: Returning primary key value when inserting records Pin
dptalt25-Jan-06 4:48
dptalt25-Jan-06 4:48 
AnswerRe: Returning primary key value when inserting records Pin
Guffa27-Jan-06 7:19
Guffa27-Jan-06 7:19 
GeneralRe: Returning primary key value when inserting records Pin
dptalt30-Jan-06 10:27
dptalt30-Jan-06 10:27 
AnswerRe: Returning primary key value when inserting records Pin
Guffa30-Jan-06 20:53
Guffa30-Jan-06 20:53 
Questionmessage alert system sending to cell phone.. Pin
JustmeNick24-Jan-06 5:12
JustmeNick24-Jan-06 5:12 
AnswerRe: message alert system sending to cell phone.. Pin
Matthew Hazlett24-Jan-06 21:42
Matthew Hazlett24-Jan-06 21:42 
AnswerRe: message alert system sending to cell phone.. Pin
Member 374890325-Nov-09 23:13
Member 374890325-Nov-09 23:13 
Questioninsert string with apostrophes Pin
Marc Soleda24-Jan-06 4:09
Marc Soleda24-Jan-06 4:09 
AnswerRe: insert string with apostrophes Pin
Dave Kreskowiak24-Jan-06 5:35
mveDave Kreskowiak24-Jan-06 5:35 
GeneralRe: insert string with apostrophes Pin
Marc Soleda24-Jan-06 20:54
Marc Soleda24-Jan-06 20:54 
GeneralRe: insert string with apostrophes Pin
Dave Kreskowiak25-Jan-06 1:47
mveDave Kreskowiak25-Jan-06 1:47 
AnswerRe: insert string with apostrophes Pin
Joshua Quick24-Jan-06 7:01
Joshua Quick24-Jan-06 7:01 
GeneralRe: insert string with apostrophes Pin
Marc Soleda24-Jan-06 7:04
Marc Soleda24-Jan-06 7:04 
GeneralRe: insert string with apostrophes Pin
Joshua Quick24-Jan-06 7:17
Joshua Quick24-Jan-06 7:17 

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.