paynebangkok
New Member
I have used hash tables once and it worked for filling a drop down box. But in this example, I just want to show the string for the report. Right now it just shows nothing. The 0,1,2,3 etc values are being stored in sql server and i want to show the Names not the values. Here is some of the code:<BR><BR>Public levelofcollege As Hashtable<BR>Public YearsExp As Hashtable<BR><BR>Sub Page_Load(sender As Object, e As EventArgs)<BR> <BR> levelofcollege = New Hashtable()<BR> levelofcollege("Pick One") = 0<BR> levelofcollege("High School Diploma or Equivalent") = 1<BR> levelofcollege("2 Year College") = 2<BR> levelofcollege("4 Year College") = 3<BR> <BR> YearsExp = New Hashtable()<BR> YearsExp("No Prior Experience Required") = 0<BR> YearsExp("1 year experience") = 1<BR> YearsExp("2 years experience") = 2<BR> YearsExp("3 years experience") = 3<BR> YearsExp("4 years experience") = 4<BR> YearsExp("5+ years experience") = 5<BR><BR> 'db code to grab data left out that part. it works.<BR><BR> MyConnection.Open()<BR> <BR> Dim DR As SqlDataReader<BR> <BR> DR = MyCommand.ExecuteReader(CommandBehavior.CloseConne ction)<BR> <BR>While DR.Read()<BR> <BR> title.text=Ucase(DR.Item(1))<BR> desc.text=DR.Item(2)<BR> education.text = levelofcollege(DR.Item(3).toString())<BR> experience.text = DR.Item(4)<BR> benifits.text=DR.Item(5)<BR> <BR>End While<BR> <BR>DR.Close()<BR>MyConnection.Close()<BR><BR>MattI figured it out. I did the hashtalbe half *** backwords. I swaped the values and it worked.<BR><BR>Matt