hello ...........i have question that where to use tostring() function......

like
when we write..........

Textbox1.Text=dr["ename"].ToString();

here dr is the object of data reader and ename is the column name my question is why ToString() was used here..

In Asp.Net controls which takes only string(text) input like TextBox, ListBox, Label so whenever we need to assign input to these controls we have to first conevrt the object value to string using ToString() function.
or if we assigning value to a string variable we use ToString() function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.