Click here to Skip to main content
16,006,768 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalfind dotnet FrameWork Pin
Senthil S10-Jan-08 23:13
Senthil S10-Jan-08 23:13 
GeneralRe: find dotnet FrameWork Pin
Thomas Stockwell11-Jan-08 1:35
professionalThomas Stockwell11-Jan-08 1:35 
GeneralRe: find dotnet FrameWork Pin
Vimalsoft(Pty) Ltd11-Jan-08 3:09
professionalVimalsoft(Pty) Ltd11-Jan-08 3:09 
GeneralRe: find dotnet FrameWork Pin
Dave Doknjas11-Jan-08 12:42
Dave Doknjas11-Jan-08 12:42 
QuestionTime and date Pin
pshilpar10-Jan-08 22:32
pshilpar10-Jan-08 22:32 
GeneralRe: Time and date Pin
Dave Kreskowiak11-Jan-08 3:17
mveDave Kreskowiak11-Jan-08 3:17 
GeneralI would like to Understand this Generated SQL by the Adapter(Dave) Pin
Vimalsoft(Pty) Ltd10-Jan-08 20:55
professionalVimalsoft(Pty) Ltd10-Jan-08 20:55 
GeneralRe: I would like to Understand this Generated SQL by the Adapter(Dave) Pin
Dave Kreskowiak11-Jan-08 3:14
mveDave Kreskowiak11-Jan-08 3:14 
First, when you post something in <pre> tags, make sure the text doesn't extend beyond the right edge of the screen. Go through and put in CR's at the points where text should wrap to the next line. It makes read your posts, an answering them much easier. Hit the Preview button to see what you're post is going to look like to us before you hit the Post Message button.


Vuyiswa wrote:
for example the variable @Client_Name needs to be declared like this

cmd.Parameters.Add("@Client_Name", SqlDbType.VarChar, 50)

Am I right?


Partially. The length and type of the field you specify is determined by the length and type of the field in the table definition.


Vuyiswa wrote:
WHERE (Client_ID = @Original_Client_ID)

... I want to understand the @Original_Client_ID, it’s the Original value before update happens ?


<blockquote class="FQ"><div class="FQA">Vuyiswa wrote:</div>The Following line after the where “And” was used.

AND (Client_Address = @Original_Client_Address OR @Original_Client_Address IS NULL AND Client_Address IS NULL)

Please Explain for me the above statement, exclude the one I asked for @original</blockquote>


Yep. All of these "Original value" parameters is to make sure that someone else didn't change the record while you were looking at it. If someone else changed the record between the time you fetched it, made changes to it, and the tried to write it back, a Concurrency Violation will occur. The SQL statement will return something like "0 rows affected" when your code was expecting 1 row. If it doesn't get back "1 row affected", then code knows that something in the record changed and you should give the user some kind of option to tell it what to do with the new changes since the changes someone else just made would normall be overwritten if you just specified the record ID alone in the WHERE clause.


Vuyiswa wrote:
Why a “;” and a new select statement here, I suppose it separate the update statement and this only verifies the update?


It is seperate the UPDATE from the SELECT statement. The SELECT statement is there to return the new record back to the caller, not only to give the code the chance to verify the change was made, but to update the callers DataSet or DataTable.



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007




GeneralRe: I would like to Understand this Generated SQL by the Adapter(Dave) Pin
Vimalsoft(Pty) Ltd11-Jan-08 3:25
professionalVimalsoft(Pty) Ltd11-Jan-08 3:25 
GeneralHelp for file creation Pin
Senthil S10-Jan-08 20:08
Senthil S10-Jan-08 20:08 
GeneralRe: Help for file creation Pin
Nilesh Hapse10-Jan-08 21:37
Nilesh Hapse10-Jan-08 21:37 
GeneralRe: Help for file creation Pin
Dave Kreskowiak11-Jan-08 1:36
mveDave Kreskowiak11-Jan-08 1:36 
GeneralDesigner Created Collections Pin
AAGTHosting10-Jan-08 10:34
AAGTHosting10-Jan-08 10:34 
GeneralRe: Designer Created Collections Pin
Dave Kreskowiak10-Jan-08 10:42
mveDave Kreskowiak10-Jan-08 10:42 
GeneralRe: Designer Created Collections Pin
AAGTHosting10-Jan-08 10:50
AAGTHosting10-Jan-08 10:50 
GeneralRe: Designer Created Collections Pin
Dave Kreskowiak10-Jan-08 11:16
mveDave Kreskowiak10-Jan-08 11:16 
Questionneed some help securing an application Pin
Shimmy Weitzhandler10-Jan-08 8:37
Shimmy Weitzhandler10-Jan-08 8:37 
GeneralRe: need some help securing an application Pin
Dave Kreskowiak10-Jan-08 8:56
mveDave Kreskowiak10-Jan-08 8:56 
GeneralRe: need some help securing an application Pin
Shimmy Weitzhandler10-Jan-08 12:56
Shimmy Weitzhandler10-Jan-08 12:56 
GeneralRe: need some help securing an application Pin
Dave Kreskowiak10-Jan-08 13:33
mveDave Kreskowiak10-Jan-08 13:33 
GeneralRe: need some help securing an application Pin
Shimmy Weitzhandler10-Jan-08 17:55
Shimmy Weitzhandler10-Jan-08 17:55 
GeneralReloading a form Pin
manisghouri10-Jan-08 7:16
manisghouri10-Jan-08 7:16 
GeneralRe: Reloading a form Pin
Dave Kreskowiak10-Jan-08 7:26
mveDave Kreskowiak10-Jan-08 7:26 
GeneralRe: Reloading a form Pin
manisghouri10-Jan-08 15:57
manisghouri10-Jan-08 15:57 
GeneralRe: Reloading a form Pin
Mycroft Holmes10-Jan-08 16:22
professionalMycroft Holmes10-Jan-08 16: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.