I followed a tutorial by Jose to pass parameters to a BAQ using a Dynamic Query and got it succesfully working based on the Part Number field.
For the sake of cleaning it up and making the form look better, I would like to set the Result to a text field instead of an UltraGrid (each part should only have one row returned)
I wasn’t having much luck passing it as a string (which makes sense, I’m just not sure how to convert the first row to string and set a textbox value to it.
Edit: All the BAQ does is get the get the vendor number based from the PartXRefVend table
if(dqa.QueryResults.Tables["Results"].Rows.Count == 0){
MessageBox.Show("Unable to find Contact");
txtPerConID_c.Text = "0";
txtName_c.Text = "";
}
foreach(DataRow row in dqa.QueryResults.Tables["Results"].Rows){
if(txtName_c.Text != row["PerCon_Name"].ToString()){
MessageBox.Show("ContactID does no fit to the Contact name. Updating Contact name now! ");
EpiDataView edvSerialNo = ((EpiDataView)(this.oTrans.EpiDataViews["SerialNo"]));
System.Data.DataRow edvSerialNoRow = edvSerialNo.CurrentDataRow;
if ((edvSerialNoRow != null)){
edvSerialNoRow.BeginEdit();
edvSerialNoRow["Name_c"] = row["PerCon_Name"];
edvSerialNoRow.EndEdit();
}
}
}
I the last few lines you can see that i am not setting the txt Field. But you might be able to do it anyway by replacing the whole epidataview thing with:
I need to look at your code a bit more in depth, as I have not yet used an EpiDataView. The code we ended up using looked like this, and it seemed to work.