Sunday, February 19, 2012

GridView via SQLDataSource and Stored Procedure

Help!

I am trying to fill my datagrid using the SQLDataSource, using a stored procedure.

The stored procedure expects a parameter which I can collect via the querystring, or a string. How can I pass the parameter through the SQLDatasSource?

My SQLDataSource is SQLData1. I already have:

SQLData1.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
SQLData1.SelectCommand = "dbo.get_players"

Thanks in advance,

Karls

I think you need SQLData1.SelectParameters property, take a look at this article:

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.selectparameters(VS.80).aspx

|||Thanks,

I found it after I posted the question.

Cheers

No comments:

Post a Comment