日期:2014-05-19  浏览次数:20520 次

datasource綁定數據源後,為什麼點擊點擊第一次正常,第二次就出錯了
datasource綁定數據源後,為什麼點擊點擊第一次正常,第二次就出錯了。出錯提示:

程序或函數   usp_EB_Function_Select   指定了太多的參數。  
這樣的問題該如何解決?


SqlDataSource2.ConnectionString   =   WebConfigurationManager.ConnectionStrings[ "E-BiddingConnectionString "].ConnectionString;      
2                   SqlDataSource2.SelectCommand   =   "usp_EB_Function_Select ";      
3                   SqlDataSource2.SelectCommandType   =   SqlDataSourceCommandType.StoredProcedure;                   ControlParameter   cpname   =   new   ControlParameter( "parm_FunctionName ",   "TextBox1 ",   "Text ");      
4                   SqlDataSource2.SelectParameters.Add(cpname);                 GridView2.DataSourceID   =   SqlDataSource2.ID   ;      
5                 //   GridView2.s      
6                   SqlDataSource2.Select(DataSourceSelectArguments.Empty);      


------解决方案--------------------
放在page__load 里数据绑定面的要加一句ispostback判定