Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Variable in the field name.

Reply
Thread Tools

Variable in the field name.

 
 
my
Guest
Posts: n/a
 
      07-21-2003
Hi All,

I have one question. Usually, we can get data from table
by using rst("userid") because we know the column name
userid. Now, I have a variable to hold the column name. I
want to get data value like this rst(var1). However, I got
an error message.

Thanks.
my
 
Reply With Quote
 
 
 
 
Manohar Kamath [MVP]
Guest
Posts: n/a
 
      07-21-2003
What was the error message? Make sure that the variable does not contain any
leading/trailing spaces. A better idea is to do:

rst(Trim(var1))

Also, print out the variable and see if that field exists in the resultset.

--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com


"my" <(E-Mail Removed)> wrote in message
news:03ed01c34fd0$60fc1170$(E-Mail Removed)...
> Hi All,
>
> I have one question. Usually, we can get data from table
> by using rst("userid") because we know the column name
> userid. Now, I have a variable to hold the column name. I
> want to get data value like this rst(var1). However, I got
> an error message.
>
> Thanks.
> my



 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      07-21-2003
What is the code? What is "var1"? What does the table structure look like?
What is the error message?

In case there's any doubt, some information is better than none.


"my" <(E-Mail Removed)> wrote in message
news:03ed01c34fd0$60fc1170$(E-Mail Removed)...
> Hi All,
>
> I have one question. Usually, we can get data from table
> by using rst("userid") because we know the column name
> userid. Now, I have a variable to hold the column name. I
> want to get data value like this rst(var1). However, I got
> an error message.
>
> Thanks.
> my



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
how to show an Image field from a SQL Server table field to a aspx page J Sahoo ASP .Net 3 04-30-2009 08:30 PM
"Variable variable name" or "variable lvalue" mfglinux Python 11 09-12-2007 03:08 AM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
How do I scope a variable if the variable name contains a variable? David Filmer Perl Misc 19 05-21-2004 03:55 PM



Advertisments