Click here to Skip to main content
15,896,444 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Problem filling a dataset from SQL Server view Pin
Steven J Jowett25-Aug-10 23:23
Steven J Jowett25-Aug-10 23:23 
AnswerRe: Problem filling a dataset from SQL Server view Pin
Sam Martini26-Aug-10 3:06
Sam Martini26-Aug-10 3:06 
AnswerTry returning 1 column at a time Pin
David Mujica26-Aug-10 3:15
David Mujica26-Aug-10 3:15 
QuestionHow to call a function after unordered input? Pin
sanyexian25-Aug-10 21:23
sanyexian25-Aug-10 21:23 
AnswerRe: How to call a function after unordered input? PinPopular
Steven J Jowett25-Aug-10 22:21
Steven J Jowett25-Aug-10 22:21 
QuestionGet the Variable name which passed the value to the Parameter Pin
Sam Martini25-Aug-10 12:06
Sam Martini25-Aug-10 12:06 
AnswerRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 12:25
sitebuilderLuc Pattyn25-Aug-10 12:25 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini25-Aug-10 13:21
Sam Martini25-Aug-10 13:21 
Hi Luc

Thanks for your explanation.

This sentence of yours get my attention

Luc Pattyn wrote:
You can pass a value (ByVal) or a reference (ByRef, it boils down to the address of a value)


So, If I used Byref, (I am guessing here) The parameter inside the function header should have pointer/link to the calling variable, so later on, the parameter declared by "ByRef" will send the value back to the calling variable.

How the parameter knows which variable?

The real requirement for my question is this:
I am creating a generic function that able to update single field in a table, the function look like this
Update(TableName,FieldName,FieldValue,pkName,pkValue)

calling the function is like this
Update("customers","Address","USA","id",4)

that will update the address field in customer table where id = 4.
What I am trying to do is reducing the number of the parameter in this function to be
Update(TableName,FieldValue,pkValue)

and call it by
Dim address as string = "USA"
Dim id as integer = 4
Update("Customers",address,id)

where address is acting as 2 things
1- the field name inside the table as "address"
2- the field value which need to be updated as "USA"

That was my idea, it seem it will not see the light Smile | :)
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 13:32
sitebuilderLuc Pattyn25-Aug-10 13:32 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini25-Aug-10 13:54
Sam Martini25-Aug-10 13:54 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 13:59
sitebuilderLuc Pattyn25-Aug-10 13:59 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini25-Aug-10 14:20
Sam Martini25-Aug-10 14:20 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 14:22
sitebuilderLuc Pattyn25-Aug-10 14:22 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
johannesnestler26-Aug-10 2:55
johannesnestler26-Aug-10 2:55 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini26-Aug-10 4:21
Sam Martini26-Aug-10 4:21 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
johannesnestler3-Sep-10 23:05
johannesnestler3-Sep-10 23:05 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini5-Sep-10 6:55
Sam Martini5-Sep-10 6:55 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
johannesnestler5-Sep-10 12:17
johannesnestler5-Sep-10 12:17 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini5-Sep-10 23:49
Sam Martini5-Sep-10 23:49 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Dave Kreskowiak26-Aug-10 3:37
mveDave Kreskowiak26-Aug-10 3:37 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini26-Aug-10 4:46
Sam Martini26-Aug-10 4:46 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
johannesnestler3-Sep-10 23:18
johannesnestler3-Sep-10 23:18 
JokeRe: Get the Variable name which passed the value to the Parameter Pin
Peter_in_278025-Aug-10 13:48
professionalPeter_in_278025-Aug-10 13:48 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 13:56
sitebuilderLuc Pattyn25-Aug-10 13:56 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Peter_in_278025-Aug-10 14:33
professionalPeter_in_278025-Aug-10 14:33 

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.