asp.net - Add parameter to dataAdapter.fill() -
i trying add parameter sqldataadapter. have tried use parameters.add() adapter not sqlcommand. here of code.
private sub converttocsv(byval sqlquery string) dim dt new datatable() dim sqlcon new sqlconnection("data source=db;initial catalog=productionservicereminder;user id=id;password=pass;") dim ada new sqldataadapter(sqlquery, sqlcon) ada.fill(dt) public sub excsp(byval reprtid integer, byval pgid integer) converttocsv(sql4) end sub
basically trying this:
ada.parameters.add(new sqlparameter("@pgid", pgid))
use selectcommand:
ada.selectcommand.parameters.add(new sqlparameter("@pgid", pgid))
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.selectcommand.aspx
Comments
Post a Comment