For example, I have some sample code below.
updateData(Dictionary<string,string> data){
string strTemp = string.Empty;
foreach(KeyValuePair<string, string> values in data){
strTemp = values.Key + "='" values.Value + "',";
}
string query = "update tablename set " + strTemp + "modDate = sysdate"
//execute query against oracle db
}
Without knowing what is in the dictionary, data, and knowing very little about the rest of the application, what would be the best way to protect from SQL injections? Can I dynamically parameterize both the column names and the values?