Compiler Error Message: CS1501: No overload for method 'ToString' - ASP.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itsvineeth209
    New Member
    • Mar 2008
    • 4

    #1

    Compiler Error Message: CS1501: No overload for method 'ToString' - ASP.NET

    Source Error:



    Line 248: //{
    Line 249:
    Line 250: int RollNo = Convert.ToInt32 (str.ToString(s tr.Append(GridV iew1.Rows[i].Cells[1].Text)));
    Line 251:
    Line 252: DeleteStudent(R ollNo);


    Source File: h:\Office Works\Projects\ Sample Applications\Gr idViewVitCode.a spx.cs Line: 250


    Plz solve this problem.

    This is the actual full code

    for (int i = 0; i < GridView1.Rows. Count; i++)
    {
    StringBuilder str = new StringBuilder() ;
    GridViewRow row = GridView1.Rows[i];

    bool isChecked = ((CheckBox)row. FindControl("Ch eckBox1")).Chec ked;

    if (isChecked)
    {
    //str.Append(Grid View1.Rows[i].Cells[1].Text);


    // Column 2 is the name column


    int RollNo = Convert.ToInt32 (str.ToString(s tr.Append(GridV iew1.Rows[i].Cells[1].Text)));

    DeleteStudent(R ollNo);

    //Refresh Grid

    BindGrid();


    }
    Last edited by jhardman; Apr 7 '08, 07:39 PM. Reason: moved to .Net forum. ASP forum is for "classic" ASP
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    The syntax of the ToString method is as follows :
    e.g.

    str.ToString()

    So in order to remove the error you you can make change in your at the following line :

    str.Append(Grid View1.Rows[i].Cells[1].Text)
    int RollNo = Convert.ToInt32 (str.ToString() );








    Originally posted by itsvineeth209
    Source Error:



    Line 248: //{
    Line 249:
    Line 250: int RollNo = Convert.ToInt32 (str.ToString(s tr.Append(GridV iew1.Rows[i].Cells[1].Text)));
    Line 251:
    Line 252: DeleteStudent(R ollNo);


    Source File: h:\Office Works\Projects\ Sample Applications\Gr idViewVitCode.a spx.cs Line: 250


    Plz solve this problem.

    This is the actual full code

    for (int i = 0; i < GridView1.Rows. Count; i++)
    {
    StringBuilder str = new StringBuilder() ;
    GridViewRow row = GridView1.Rows[i];

    bool isChecked = ((CheckBox)row. FindControl("Ch eckBox1")).Chec ked;

    if (isChecked)
    {
    //str.Append(Grid View1.Rows[i].Cells[1].Text);


    // Column 2 is the name column


    int RollNo = Convert.ToInt32 (str.ToString(s tr.Append(GridV iew1.Rows[i].Cells[1].Text)));

    DeleteStudent(R ollNo);

    //Refresh Grid

    BindGrid();


    }

    Comment

    Working...