Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dears I have a gridview that should appear on click of a button
C#
protected void btnGetTerminals_Click(object sender, EventArgs e)
       {

           ObjectDataSource2.SelectParameters.Add("branchIDs",strBranchValues);

           ObjectDataSource2.DataBind();

           GridView1.Visible = true;
       }
In code i have the following
      <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="WGetTerminalList" TypeName="WebApplication1.ServiceReference1.RptServiceSoapClient">
           <SelectParameters>
                <asp:Parameter Name="branchIDs"  Type="String" />
            </SelectParameters>
        

Its just not working that is i am not able to access WGetTerminalList
any suggestions of how i can do it
Regards,
Posted
Comments
Sergey Alexandrovich Kryukov 6-Jul-12 3:40am    
"Not working" is not descriptive. Can you see "Improve question" above? Details, please.
--SA
Sandra Ha 6-Jul-12 4:33am    
in my case it's not passing the parameters using
ObjectDataSource2.SelectParameters.Add("branchIDs",strBranchValues);
it worked with me using
ObjectDataSource2.SelectParameters["branchIDs"].DefaultValue = strBranchValues;
Member 10525491 20-Jul-14 21:26pm    
Thank you so much its working :)

1 solution

Seems you have already mentioned parameter in the source/html,

try adding below to solve your issue
ObjectDataSource2.SelectParameters.Clear();//add this line
ObjectDataSource2.SelectParameters.Add("branchIDs",strBranchValues);


Thanks
 
Share this answer
 
Comments
Sandra Ha 6-Jul-12 8:53am    
Thanks it worked :)
Shemeer NS 6-Jul-12 9:19am    
wc

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900