Reference Column and Row in Data View

customization

(Shannon Kearney) #1

Can you reference a Column in a BAQ DataView as a parameter in a Dynamic Query? I don’t know what I have wrong but it is throwing an error. I don’t think I’m calling the dataView correctly.

MessageBox.Show("Change Order Number Start");
		MessageBox.Show(edvMyCustomOrderDV.dataView[edvMyCustomOrderDV.Row]["OrderNum"].ToString());
		tbOrderCancelled.Visible = false;
		tbOrderEditCompleted.Visible = false;
		MessageBox.Show("Change Order Number Lines");
		//Order Lines
		DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
		dqa.BOConnect();
		QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Orders_Lines");
		qeds.ExecutionParameter.Clear();
		qeds.ExecutionParameter.AddExecutionParameterRow("OrderNum", edvMyCustomOrderDV.dataView[edvMyCustomOrderDV.Row]["OrderNum"].ToString() , "nvarchar", false, Guid.NewGuid(), "A");
		dqa.ExecuteByID("GS_Orders_Lines", qeds);
		gridLinesCopyChanges.DataSource = dqa.QueryResults.Tables["Results"];

(Jose C Gomez) #2

What’s the error?


(Shannon Kearney) #3

image


(Shannon Kearney) #4

It’s after the Message Box “Change Order Number Start”)


(Shannon Kearney) #5

I’m trying to change all my references to the controls to the actual BAQ DataView Columns


(Jose C Gomez) #6

That means that your

edvMyCustomOrderDV.dataView[edvMyCustomOrderDV.Row]["OrderNum"].ToString()

Either doesn’t exist or doesn’t have a value.


(Shannon Kearney) #7

Okay, so I am referencing it correctly?


(Jose C Gomez) #8

Seems fine but it is telling you that it doesn’t have a Row or a Value.


(Theodore Koch) #9

How is this dataview instantiated?