タイプの値をいくつか挿入し たい。4つのループがあり、 vardictvar dict = new Dictionary<string, int>();
の変数の横に別の値を挿入したい。これ
が私のコードです。
var dict = new Dictionary<string, int>();
foreach (string word in wordsbeforesoundex)
{
if (word == null)
{
continue;
}
if (word.Trim() != "")
{
if (dict.ContainsKey(word))
{
dict[word]++;
}
else
{
dict[word] = 1;
}
}
}
for (int l = 0; l < words.Length; l++)
{
con.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO TableFFF (Frequency) VALUES (@dict_idx)", con);
cmd.Parameters.Add(new SqlParameter("@dict_idx", dict[wordsbeforesoundex[l]]));
cmd.ExecuteNonQuery();
con.Close();
}
私の問題は、辞書のデータをフェッチしてデータベースに挿入する方法です