This is a migrated thread and some comments may be shown as answers.

Table NeedDataSource Access Texbox value

1 Answer 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave Lehoux
Top achievements
Rank 1
Dave Lehoux asked on 16 Nov 2009, 08:59 PM
Hi,

I have a table in wich the datasource is loaded in the NeedDataSource event.  It's using a Stored Procedure wich requires as parameter a value that is available in the main report.  How do I access this value ?

I want to either get the value of textbox txtIndividualId or the field IndividualId from the Reports datasource...

Thanks

private void MyTable_NeedDataSource(object sender, EventArgs e)  
{  
    SqlCommand sqlSelectCommand = new SqlCommand  
                                      {  
                                            CommandText = "SP_MyStoredProc",  
                                            Connection = new SqlConnection {ConnectionString = ConnectionString},  
                                            CommandType = CommandType.StoredProcedure  
                                      };  
    sqlSelectCommand.Parameters.Add("@individualId", SqlDbType.Int);  
    sqlSelectCommand.Parameters["@individualId"].Value = txtIndividualId.Value; //This is incorrect  
      
    Telerik.Reporting.Processing.Table tbl = (Telerik.Reporting.Processing.Table)sender;  
    tbl.DataSource = new SqlDataAdapter { SelectCommand = sqlSelectCommand };  
}  
 

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 17 Nov 2009, 08:35 AM
Hi Dave Lehoux,

Take a look at the following forum thread that shows you how to achieve this.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Dave Lehoux
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or