I’ve done some research online and I don’t think what I want to do is possible but I wanted to double check with you guys before I wrote it off.
I’ve currently got a very simple BAQ running in a Customization that returns a SELECT statement and apply’s it to an ultragrid.
This is the code I’ve used:
DynamicQueryAdapter dynamicQueryAdapter = new DynamicQueryAdapter(oTrans);
QueryExecutionDataSet queryExecutionDataSet = dynamicQueryAdapter.GetQueryExecutionParametersByID(“selectBAQ”);
queryExecutionDataSet.ExecutionParameter.AddExecutionParameterRow(“CompanyID”, companyTextBox.Text, “nvarchar”, false, Guid.Empty, “A”);
baqUltraGrid.DataSource = dynamicQueryAdapter.QueryResults.Tables[“Results”];
What I’m wondering is, is there a way to run an UPDATE BAQ statement using the DynamicQueryAdapter object (or anything else in the customisations code)?
I’ve got an updateable BAQ set up and when I run the Update in the analyse tab it does work, however when I look at the query phrase in the General tab it’s still a SELECT statement so I’m not sure how I would go about using it in a customisation.
Is it possible to run an UPDATE statement from a BAQ in a similar manner to the one above (so what would happen is I would click a button and then the BAQ would run the UPDATE statement for now, later on I’d add parameters and a textbox for the updated value) or is that not possible?
The reason I’m using a BAQ and not a SqlCommand with the SQL passed in as a string (where I could just write the UPDATE query myself) is because I’m testing the runtime of BAQ’s, so the UPDATE has to be ran through a BAQ.