How to Handle Columns

Jun 24, 2010 at 9:46 AM
respective sir, i am building my own expression builder and this code helps me alot. but still i have an issue. i am using also using columns and there is no way to handle the columns. basically i have to store the expression against a table column. please guide me how can i do it. thnks
Jun 25, 2010 at 6:16 AM

hello DarrenSQLIS,hope you are fine and good. i am waiting for your response. kindly respond ASAP.

thnks

Coordinator
Jun 25, 2010 at 11:27 AM
Edited Jun 28, 2010 at 8:56 PM

To reference a column in the expression would be a problem, because the expression evaluator (from Microsoft) doesn't appear to have any column context. Therefore a column name would not be transposed to the column value during evaluation. You would have write some code to pre-process the expression and replace the column name with a literal value.

I may have misunderstood the question as you say "store the expression against a table column" which I don't quite understand. Storing a property value against a column is standard practice, but I don't see how that relates to the editor. Storing a string in a column property is fine, and that string could be an expression, but to reference the column you have the issue I mention above.

Jun 26, 2010 at 10:27 PM

thnks for responding me Darren. sorry that i am not able to deliver my problem correctly. basically i am developing my own derived column transformation. for this i want to an expression editor. your given editor is very good. but i need a small change. i want to add columns like you see in the business intelligence project for derived column.

thnks

Coordinator
Jun 28, 2010 at 10:53 AM
Edited Jun 28, 2010 at 8:55 PM

Sounds like you want to display the list of columns in the tree view of the editor. I would add a new constructor for the ExpressionEditorPublic class that accepts something that gives you column information, e.g. IDTSInputColumnCollection100. You would then amend the ExpressionEditorView.PopulateFunctionsTree method to interrogate the column information and add it to the tree. I’d suggest a new top level node alongside Variables. You would then be able to drag and drop column information from the tree view to the expression text box. The tree view node Tag property value is what is actually added to the expression text. The code that adds the variables should serve as a good pattern to follow for these changes.