SQLDatasource parameters

前端 未结 2 1492
遇见更好的自我
遇见更好的自我 2021-01-20 20:07

How can i set sql parameters for an sqlDatasource in the code behind? I am trying like this:

int id=1;
SqlDataSource1.SelectCommand = \"SELECT * FROM categ W         


        
2条回答
  •  囚心锁ツ
    2021-01-20 20:35

    You can update the value by:

    SqlDataSourceArticole.SelectParameters["id"].DefaultValue = id.ToString();
    

    Using the default value can work in this case.

    HTH.

提交回复
热议问题