Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 7th, 2008, 10:57 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default GridView Function error

I'm getting the following error
Server Error Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1502: The best overloaded method match for '_Default.NoOfCustomers(string)' has some invalid arguments

Source Error:



Line 130: <asp:TemplateField HeaderText="No. of Customers to be approved">
Line 131: <ItemTemplate>
Line 132: <asp:HyperLink ID="hlNoOfCustomers" runat="server" Text='<%# NoOfCustomers(Eval("Reseller"))%>' />



below is the gridview code

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                                          DataSourceID="SqlDataSource2">
                                          <Columns>

                                              <asp:BoundField DataField="Reseller" HeaderText="Reseller" SortExpression="Reseller" />
                                                                                            <asp:TemplateField HeaderText="No. of Customers to be approved">
                                                  <ItemTemplate>
                                                   <asp:HyperLink ID="hlNoOfCustomers" runat="server" Text='<%# NoOfCustomers(Eval("Reseller"))%>' />

                                                </ItemTemplate>
                                              </asp:TemplateField>

                                          </Columns>
                                      </asp:GridView>
                                      <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:GoyamSEOConnectionString %>"
                                          SelectCommand="SELECT distinct Reseller FROM [ResellersCustomer] WHERE ([Approved] = @Approved)">
                                          <SelectParameters>
                                              <asp:Parameter DefaultValue="false" Name="Approved" Type="Boolean" />
                                          </SelectParameters>
                                      </asp:SqlDataSource>

below is the function
public int NoOfCustomers(string ResellerName)
    {
        string dsn = ConfigurationManager.ConnectionStrings["MySqlConnection"].ConnectionString.ToString();
        using (sqlCon = new SqlConnection(dsn))
        {
            string sqlSelect = "select count(*) from resellerscustomer where reseller='" + ResellerName + "' and approved =0";
            sqlComm = new SqlCommand(sqlSelect, sqlCon);
            sqlCon.Open();
            int NoOfCustomers = (int)sqlComm.ExecuteScalar();
            return NoOfCustomers;
        }
    }

any soln?

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView sorting error snufse ASP.NET 2.0 Basics 0 February 12th, 2008 06:00 PM
GridView Error potato ASP.NET 2.0 Basics 0 April 8th, 2007 10:27 AM
Undefined Function Error arimakidd Beginning PHP 2 November 10th, 2005 02:54 AM
error in upload function blur_ivy .NET Web Services 0 February 26th, 2005 11:37 AM
nz function error bml Excel VBA 1 February 14th, 2005 12:52 PM



All times are GMT -4. The time now is 07:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.