Hi I am trying to use replace function in c# but it doesnt seems to work.Am i doing anything wrong.Thanks
private void btnSpanish_Click(object sender, EventArgs e)
{
SimpleSpanishDict.SimpleSpanishEnglishDictionary ins = new SimpleSpanishEnglishDictionary();
Hashtable aaa = ins.AllWords();
StringBuilder insertCommand = new StringBuilder();
IDictionaryEnumerator en = aaa.GetEnumerator();
if (aaa.Count > 0)
{
while (en.MoveNext())
{
string al = en.Value.ToString();
string al2 = "";
al2 = al.Replace("'", "''");
myString = @"INSERT INTO TblSpanish (word,definition) Values('" + en.Key + "','" + al2 + "')";
SqlCommand myCmd = new SqlCommand(myString, cn);
myCmd.ExecuteNonQuery();
}
}
cn.Close();
}