public static int AddComment(Hashtable ht, string sTableName)
{
try
{
string sValue = String.Empty;
int i = 0;
SqlParameter[] objPar = new SqlParameter[ht.Count];
foreach (DictionaryEntry key in ht)
{
string sValueName = "@" + key.Key.ToString();
objPar[i] = new SqlParameter(sValueName, key.Value);
i++;
sValue += sValueName + ",";
}
if (sValue != String.Empty) sValue = sValue.Substring(0, sValue.Length - 1);
string sql = string.Format("insert into {0} ({1}) values ({2})", sTableName, sValue.Replace("@", ""), sValue);
MySql.Execute(sql, objPar);
return 1;
}
catch
{
return 0;
}
}
