Hashtable problem c#

I have a hashtable with A lot of words , when i introduce the words manually into the hashtable**[hashtable.add(id,“name”)]**it works perfectly with [hashtable.ContainsValue(InputField)], but somehow, when I introduce data in the hastable via automation, like

    int i = 0;
    foreach (string s in LinesDiccionaryD)
    {
        Tabla.Add(i, s.ToLower());
        i++;
    }
    foreach (string s in LinesDiccionaryS)
    {
        Tabla.Add(i, s.ToLower());
        i++;
    }

it just stop working with [hashtable.ContainsValue(InputField)], how can i solve that, sorry for my english , and thx btw, I hope someone can help me

using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;


public class DiccionaryReader : MonoBehaviour
{
    private string LastLine;
    private string line;
    public int currentLine = 0;
    public int CurrentLine3;
    public int CurrentLine4;

    Hashtable Tabla;

    private string[] lines;
    private string[] LinesDiccionaryS;
    public string[] LinesDiccionaryD;
    private string content;
    private string contentDiccionaryS;
    private string contentDiccionaryD;
    private string[] tokens;
    public Text Palabra;
    public Text Conjugacion;
    public Text Tipo;
    public Text Traduccion;

    public bool SearchingForWord;

    public bool UpdatingDiccionaries;
    public bool UpdatingDiccionaryD;
    public bool UpdatingDiccionaryS;

    public InputField SearchWord;

    public TextAsset file;
    public TextAsset FileDiccionaryS;
    public TextAsset FileDiccionaryD;

    public void Start()
    {
        FileDiccionaryD = Resources.Load("Info/DiccionaryD") as TextAsset;
        FileDiccionaryS = Resources.Load("Info/DiccionaryS") as TextAsset;
        file = Resources.Load("Info/Diccionary") as TextAsset;

        content = file.text;
        contentDiccionaryD = FileDiccionaryD.text;
        contentDiccionaryS = FileDiccionaryS.text;

        lines = content.Split('

‘);
LinesDiccionaryD = contentDiccionaryD.Split(’
‘);
LinesDiccionaryS = contentDiccionaryS.Split(’
');

        Tabla = new Hashtable();
        NewWord();

        int i = 0;
        foreach (string s in LinesDiccionaryD)
        {
            Tabla.Add(i, s.ToLower());
            i++;
        }
        foreach (string s in LinesDiccionaryS)
        {
            Tabla.Add(i, s.ToLower());
            i++;
        }
        foreach (var key in Tabla.Keys)
        {
            Debug.LogWarningFormat("{0}: {1}", key, Tabla[key]);
        }
    }

    public void NewWord()
    {
        {
            var r = new System.Random();
            int randomNumber = r.Next(0, lines.Length);

            // Read the random line
            line = lines.Skip(randomNumber - 1).Take(1).First();

            string Output = line;
            LastLine = line;

            string MainString = Output;
            tokens = MainString.Split('&');

            Palabra.text = tokens[0];
            Tipo.text = tokens[1];
            Conjugacion.text = tokens[2];
            Traduccion.text = tokens[3];
        }
    }

    public void Update()
    {
        if (Tipo.text == "V")
        {
            Tipo.text = "Verbo";
        }
        else if (Tipo.text == "S")
        {
            Tipo.text = "Sustantivo";
        }
        else if (Tipo.text == "O")
        {
            Tipo.text = "Oracion";
        }
        else if (Tipo.text == "A")
        {
            Tipo.text = "Otro";
        }
    }

    public void SearchForWord()
    {
        Debug.Log(Tabla.Count);
        Debug.Log(SearchWord.text);

        if (Tabla.ContainsValue("ab"))
        {
            Debug.Log("la encontre");
        }
        else if (Tabla.ContainsKey(SearchWord.text))
        {
            var key = Tabla[SearchWord.text];
            Debug.Log(key);
        }
        else
        {
            Debug.Log("Ni Fruta idea que estas buscando");
        }
    }
}

Your code makes no sense. Your hashtable has integer values as keys. So you can not possibly find a string key in that hashtable. It’s not really clear what that hashtable should be used for. A hashtable maps a key to another value. You just used an integer index as key and the actual string as value. If you want to be able to actually find the string values, you should have the string as key. However it’s not clear to which value you want to map each word to.

If you just want a hash table to see if a word exists or not you should use a HashSet. The Hashtable class shouldn’t really be used anyways. It’s generally better to use the generic classes like the HashSet i just mentioned or if you actually need a mapping use a generic Dictionary. If you would have used a generic dictionary your code wouldn’t even compile since you have to specify your key and value type. So adding integers but testing for strings can never work.