How to create these variables?

S

Shapper

Hello,

I have an ASP.NET/VB web page where I created a DataReader.

With the SQL Query String I use I always get 0 to 4 records.
The records have the following fields (I also include the MSSQL types):

[id] - int :: [name] - char :: [content] - varchar

I need to create N (DataReader Dimension) variables as follows:

For i = 1 to N
If [content(i)] Is Empty
var_[name(i)] = " "
If [content(i)] Is NOT Empty
var_[name(i)] = [content(i)]
EndFor

Consider the following records returned by the DataReader:

Id name content
1 hello hello world
2 goodbye goodbye world
3 nothing

I would need to create 3 variables:
var_hello = "hello world"
var_goodbye = "goodbye world"
var_nothing = " "

The [name] field is used to create the variable name and the [content]
field is used as the variable value.

Can someone tell me how to do this?

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top