Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Javascript "=" operator
Old 05-26-2008, 12:51 PM Javascript "=" operator
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
It would seem that a statement such as:

TestVal = RecordSet.Fields("Data")

will bind the variable to the column rather than just assigning the current value. Is this correct and if so how do I assign a value from a database?
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-26-2008, 01:51 PM Re: Javascript "=" operator
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Found the solution for those who are interested,

variable=rs.Fields("data") binds the variable to the database column.
variable=rs.Fields("data").value assigns the current value to the variable.
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 05-26-2008, 06:32 PM Re: Javascript "=" operator
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Not sure what RecordSet is, but here's an explanation for any one else that stumbles along:

Simple scalar variables will be copied when using the assignment operator. Scalar values include numbers and boolean values.
Code:
var my_age = 19;
var john_age = my_age;
john_age++;

// john_age is 20, but my_age is still 19.
// The assignment on the second line COPIED the value from my_age to john_age
Complex variables like strings, functions and objects are always passed by reference (what the thread starter referred to as "binding"). When you use the assignment variable a "reference" to the variable is placed into the other variable, essentially creating two variables that "point" to the same value.

Code:
var my_info = { name: 'Christopher', age: 19 };
var john_info = my_info;
john_info.name = 'John';

// Now both my_info and john_info have the name of 'John'
// On the secnd line, john_info was made to "point" to the object stored in my_info
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Javascript "=" operator
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13472 seconds with 12 queries