Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Stored procedure parameters in SQL data source View modes: 
User avatar
Member
Member
nvpat - 8/10/2011 3:42:53 PM
   
Stored procedure parameters in SQL data source
Hi all.

How do I supply parameter values to a stored procedure in the SQL data source web part?

Thanks.

User avatar
Member
Member
kentico_michal - 8/11/2011 10:04:20 PM
   
RE:Stored procedure parameters in SQL data source
Hello,

The SQLDataSource web part does not provide any property that you can use to specify query parameters.
You will need to create a custom web part that will be based on SQLDataSource control and define query parameters from code:

You can use the QueryParameters property of the SQLDataSource:

object[,] parameters = new object[1, 3];

parameters[0, 0] = "@FieldName";
parameters[0, 1] = FieldName;

SQLDataSource.QueryParameters = parameters;


If you need more information about developing a web part, I would like to point you to the following article: Developing web parts.

Best regards,
Michal Legen