Adding data source in code and designer

Hello everyone. I am trying to pass complex sql query from my .net code.
I am registering datasource from code like this

report2.RegisterData(ds.Tables["Test"], "Test");
report2.GetDataSource("Test").Enabled = true;

//I am creating data source like this
TableDataSource table = new TableDataSource();
table = report2.GetDataSource("Test") as TableDataSource;
TableDataSource table = report2.FindObject("Table") as TableDataSource;
table.SelectCommand = "Here will be my complex query with procedures and so on. Resultant will be a table.";

//Creating a textbox in fastreport
TextObject text1 = report2.FindObject("Text1") as TextObject;
text1.Text = "[Test.docid]";
report2.Show();

My resultant table will return columns docid,etc.....
My problem is my report doesnt recognise [Test.docid]. My report is empty. It has only one Textobject i.e Text1 which is empty. I am not able to present data into the report. How should be the designer fast report file?
Thanks in Advance

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.