I have the following code
public DataSet GetProject(string projectID)
{
DataSet dataTable = new DataSet();
DataAccess dataAccess = new DataAccess();
OracleCommand commandOb = new OracleCommand();
strQuery.Append("select projectName, managerName");
strQuery.Append("from project ");
strQuery.Append("where projectID = '" + projectID + "'");
cmd.CommandText = strQuery.ToString();
dataTable = dataAccess.ExecuteDataAdapter(commandOb);
return dataTable;
}
Is this an okay way to build a query and execute it? Would this be vulunerable to SQL injection attacks?
Is there a recommended approach when it comes to building queries dynamically. Any help would be appreciated.