c# - How can i add text field listdictionary elements -
How can I write a text field through "," I try to write a rewrite script with ListDictionary:
LD parameters: a, b, c, di is required: text = a, b, c, d
< Code> Zero InsertDataToSql (ListDictionary LD, String TableName) {string Text = "Enter in ENG_" + TableName + "VALUES ("; String AddText = String.Join (ld, ',');
By ignoring the threats of manually becoming a SQL statement, you should be able to create the desired string as follows:
string addText = string Select .Join (",", ld.Cast & lt; Dictionary entry & gt; (). Select (D => Escape (DKA) + "=" + Escape (D.Vell)) .Oire ( } "{3", "value 3"}, {"key3", "value1"}, {"key2", "value2"}, }
then select
in the code above
string [] temp = new string [] {" Key1 = Value1 "," Key2 = Value2 "," Key3 = Value3 ",};
and these strings together will be included in the
string addText = "Key1 = Value1, Key2 = Value2, Key3 = Value3";
But you should actually use a library that uses the database for you manually Managing the SQL statement is error-prone and even Could.
Comments
Post a Comment