What is the significance of CommandBehavior.CloseConnection

To avoid having to explicitly close the connection associated with the command used to create either a SqlDataReader or and OleDbDataReader, pass the CommandBehavior.CloseConnection argument to the ExecuteReader method of the Connection. i.e VB.NET dr= cmd.ExecuteReader(CommandBehavior.CloseConnection) C# dr= cmd.ExecuteReader(CommandBehavior.CloseConnection); The associated connection will be closed automatically when the Close method of the Datareader is called. This makes it all the more important to always remember to call Close on your datareaders.

How can I display a Tool tip for a dropdownlist

The ToolTip property is inherited from the WebControl class and is not applicable to the DropDownList control. This implementation of the ToolTip property does not allow you to set a value and returns String. In a word, if we can make this (a dropdown with ToolTip) work with plain HTML and client side script, we should be able to emit the necessary code from ASP.NET. More Details at DropDownList.ToolTip Property

How to show TextBox web server control with TextMode Property Password as **** rather than blank

For security reason, TextBox with TextMode=’Password’ setting cannot be assigned or populated via the Text property on Page_Load or PostBack event. It’s not recommend for to prefill a ‘Password’ type TextBox with the(‘***’) characters, though below is the solution to achieve this. VB.NET ViewState('Pwd')=TextBox1.Text ; TextBox1.Attributes.Add('value', ViewState('Pwd').ToString ()) ; C# ViewState['Pwd']=TextBox1.Text ; TextBox1.Attributes.Add('value', ViewState['Pwd'].ToString ()) ;