Click here to Skip to main content
15,913,854 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: how to display files that are not in directory? Pin
Luc Pattyn11-Jan-09 16:45
sitebuilderLuc Pattyn11-Jan-09 16:45 
GeneralRe: how to display files that are not in directory? Pin
zaimah11-Jan-09 17:26
zaimah11-Jan-09 17:26 
GeneralRe: how to display files that are not in directory? Pin
Luc Pattyn11-Jan-09 18:32
sitebuilderLuc Pattyn11-Jan-09 18:32 
GeneralRe: how to display files that are not in directory? Pin
zaimah11-Jan-09 21:14
zaimah11-Jan-09 21:14 
GeneralRe: how to display files that are not in directory? Pin
Luc Pattyn12-Jan-09 2:24
sitebuilderLuc Pattyn12-Jan-09 2:24 
QuestionRetrieve last ID from SQl server Pin
Jodd2-Jan-09 13:15
Jodd2-Jan-09 13:15 
AnswerRe: Retrieve last ID from SQl server Pin
Mycroft Holmes2-Jan-09 15:35
professionalMycroft Holmes2-Jan-09 15:35 
AnswerRe: Retrieve last ID from SQl server Pin
N a v a n e e t h2-Jan-09 15:51
N a v a n e e t h2-Jan-09 15:51 
Read the documentation[^] to know how @@IDENTITY works. It retruns the last identity value inserted for a specific session or NULL if nothing is available. In your code, you are opening a new connection to execute @@IDENTITY which will always return NULL.

As a workaround, you should execute this query before closing the connection which inserted the record. You will get the value then. It will be like,
Open connection
Execute insert statement
Execute the @@IDENTITY selection
Close the connection
If you use stored procedures for insertion, the most obvious method is to add an output parameter to the SP and write the identity value to this parameter. You can read the value from parameter without querying database again.

Also be careful with @@IDENTITY as it may not return the identity value inserted into a specific table which you are expecting. This will behave differently when there are triggers written on the table. Check out @@SCOPE_IDENTITY also which is limited to a scope.


AnswerRe: Retrieve last ID from SQl server Pin
TheComputerMan3-Jan-09 4:44
TheComputerMan3-Jan-09 4:44 
AnswerRe: Retrieve last ID from SQl server Pin
TheComputerMan3-Jan-09 4:49
TheComputerMan3-Jan-09 4:49 
QuestionLost Feature in VB Pin
udatl2-Jan-09 10:57
udatl2-Jan-09 10:57 
AnswerRe: Lost Feature in VB Pin
Fabio V Silva2-Jan-09 12:04
Fabio V Silva2-Jan-09 12:04 
GeneralRe: Lost Feature in VB Pin
udatl2-Jan-09 16:25
udatl2-Jan-09 16:25 
GeneralRe: Lost Feature in VB Pin
TheComputerMan3-Jan-09 4:28
TheComputerMan3-Jan-09 4:28 
QuestionWant to add a comboboxcolumn runtime and pass value to the comboboxcolumn runtime Pin
Nattumakkan2-Jan-09 5:37
Nattumakkan2-Jan-09 5:37 
AnswerRe: Want to add a comboboxcolumn runtime and pass value to the comboboxcolumn runtime Pin
TheComputerMan2-Jan-09 6:46
TheComputerMan2-Jan-09 6:46 
AnswerRe: Want to add a comboboxcolumn runtime and pass value to the comboboxcolumn runtime Pin
dan!sh 2-Jan-09 8:26
professional dan!sh 2-Jan-09 8:26 
QuestionFile in use error Pin
TheComputerMan2-Jan-09 5:04
TheComputerMan2-Jan-09 5:04 
AnswerRe: File in use error Pin
Jon_Boy2-Jan-09 5:11
Jon_Boy2-Jan-09 5:11 
GeneralRe: File in use error Pin
TheComputerMan2-Jan-09 5:21
TheComputerMan2-Jan-09 5:21 
GeneralRe: File in use error Pin
Jon_Boy2-Jan-09 5:30
Jon_Boy2-Jan-09 5:30 
GeneralRe: File in use error Pin
TheComputerMan2-Jan-09 6:24
TheComputerMan2-Jan-09 6:24 
GeneralRe: File in use error Pin
Jon_Boy2-Jan-09 7:04
Jon_Boy2-Jan-09 7:04 
GeneralRe: File in use error Pin
Christian Graus2-Jan-09 5:45
protectorChristian Graus2-Jan-09 5:45 
GeneralRe: File in use error Pin
TheComputerMan2-Jan-09 6:22
TheComputerMan2-Jan-09 6:22 

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.