What does it mean??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Przemek F±fara

    What does it mean??

    DataTableCollec tion dta = myDataSet.Table s;

    DataRowCollecti on dra = myDataSet.Table s["Plyty"].Rows;

    DataRow dr = dra[0];

    textTytul.Text = dr[0].ToString; !!!!!!!!!!!!!! ( ERROR : Method
    'int.ToString(s tring)' referenced without parentheses )

    What shuld I do?? What is wrong...



  • Przemek F±fara

    #2
    Re: What does it mean??

    Sorry ... this is the good question :)

    DataTableCollec tion dta = myDataSet.Table s;

    DataRowCollecti on dra = myDataSet.Table s["Plyty"].Rows;

    DataRow dr = dra[0];

    textTytul.Text = dr[0].ToString; ( ERROR : Method 'object.ToStrin g()'
    referenced without parentheses )



    What shuld I do ??




    Comment

    • Leon Jollans

      #3
      Re: What does it mean??

      textTytul.Text = dr[0].ToString();

      ToString is a method, not a property, so you need to provide parentheses
      (brackets). unlike VB, C-syntax languages require this.

      Leon



      "Przemek F±fara" <pfafara@konto. pl> wrote in message
      news:bkn4k0$lnh $1@atlantis.new s.tpi.pl...[color=blue]
      > Sorry ... this is the good question :)
      >
      > DataTableCollec tion dta = myDataSet.Table s;
      >
      > DataRowCollecti on dra = myDataSet.Table s["Plyty"].Rows;
      >
      > DataRow dr = dra[0];
      >
      > textTytul.Text = dr[0].ToString; ( ERROR : Method 'object.ToStrin g()'
      > referenced without parentheses )
      >
      >
      >
      > What shuld I do ??
      >
      >
      >
      >[/color]


      Comment

      • Nicholas Paldino [.NET/C# MVP]

        #4
        Re: What does it mean??

        Przemek,

        ToString is a method, so you have to access it like this:

        textTytul.Text = dr[0].ToString();

        Hope this helps.


        --
        - Nicholas Paldino [.NET/C# MVP]
        - nick(dot)paldin o=at=exisconsul ting<dot>com

        "Przemek F±fara" <pfafara@konto. pl> wrote in message
        news:bkn4bk$kdp $1@atlantis.new s.tpi.pl...[color=blue]
        > DataTableCollec tion dta = myDataSet.Table s;
        >
        > DataRowCollecti on dra = myDataSet.Table s["Plyty"].Rows;
        >
        > DataRow dr = dra[0];
        >
        > textTytul.Text = dr[0].ToString; !!!!!!!!!!!!!! ( ERROR : Method
        > 'int.ToString(s tring)' referenced without parentheses )
        >
        > What shuld I do?? What is wrong...
        >
        >
        >[/color]


        Comment

        • Jon Skeet

          #5
          Re: What does it mean??

          Przemek F±fara <pfafara@konto. pl> wrote:[color=blue]
          > DataTableCollec tion dta = myDataSet.Table s;
          >
          > DataRowCollecti on dra = myDataSet.Table s["Plyty"].Rows;
          >
          > DataRow dr = dra[0];
          >
          > textTytul.Text = dr[0].ToString; !!!!!!!!!!!!!! ( ERROR : Method
          > 'int.ToString(s tring)' referenced without parentheses )
          >
          > What shuld I do?? What is wrong...[/color]

          You should put the parentheses in, as the error message suggests.

          textTytul.Text = dr[0].ToString();

          --
          Jon Skeet - <skeet@pobox.co m>
          Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

          If replying to the group, please do not mail me too

          Comment

          • Przemek F±fara

            #6
            Re: What does it mean??


            thx !! it's work :)


            Comment

            Working...