Link to home
Start Free TrialLog in
Avatar of Chris Jones
Chris JonesFlag for United States of America

asked on

Create a dynamic varable in VB

Hello,

i need help dynamicly creating varables based on database  entry and use the varables throught my program. These varables will have values assosiated with them in the database


FOR EXAMPLE

test1 , string,, "helo world"
Avatar of BuggyCoder
BuggyCoder
Flag of India image

Define a static type with static fields as your variables and modify the variables where and when required:-

public static class MyData
{
public static string variable1;
public static string variable2;
}

MyData.variable1="test";
MyData.variable2="Hello";

Open in new window

Avatar of Mike Tomlinson
Use a Dictionary with the variable name as the key:
http://msdn.microsoft.com/en-us/library/xfhwa508.aspx
ASKER CERTIFIED SOLUTION
Avatar of ExpertLogin_890
ExpertLogin_890
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Chris Jones

ASKER

Thanks the generic worked for me