Results 1 to 3 of 3

Thread: [Resolved]Cannot show data to textbox

  1. #1

    Thread Starter
    Hyperactive Member naruponk's Avatar
    Join Date
    Feb 2004
    Location
    Some where in the world
    Posts
    423

    Resolved [Resolved]Cannot show data to textbox

    Hello all,

    DataSet ds = new DataSet();
    myAdaptor.Fill(ds, "Member");
    TextBox1.Text=ds.Tables["Member"].Rows[0]["FirstName"];

    When run this page the complier would alert that "Cannot implicitly convert
    type object to string".

    What's wrong of the code?
    Last edited by naruponk; Mar 9th, 2005 at 01:11 AM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Cannot show data to textbox

    TextBox1.Text=ds.Tables["Member"].Rows[0]["FirstName"].ToString();

    or

    TextBox1.Text=Convert.ToString(ds.Tables["Member"].Rows[0]["FirstName"]);

  3. #3

    Thread Starter
    Hyperactive Member naruponk's Avatar
    Join Date
    Feb 2004
    Location
    Some where in the world
    Posts
    423

    Re: Cannot show data to textbox

    Yes! work fine.
    Thanks a lot mendhak.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width