How to hide or show Controls in server side code?
In any appropriate event write VB.NET TextBox1.Visible =not TextBox1.Visible C# TextBox1.Visible =!TextBox1.Visible ;
How to resolve the error message ‘Cannot implicitly convert type ‘string’ to ‘System.DateTime’ ‘ when using a DataReader
Try VB.NET dim dt as DateTime = ctype( dr('hiredate').ToString(), DateTime) C# DateTime dt= ((DateTime) dr['hiredate']).ToString();
How to use the Same DataReader to populate two different ListBoxes
You cannot use the same DataReader to populate 2 Listboxes.But can try out the below workaround VB.NET ... cn = New SqlConnection('Server=localhost;uid=sa;database=northwind;pwd=') cmd = New SqlCommand('select * from products;select * from products', cn) cn.Open() dr = cmd.ExecuteReader() ListBox1.DataSource = dr ListBox1.DataTextField = 'productname' ListBox1.DataBind() dr.NextResult() ListBox2.DataSource = dr ListBox2.DataTextField = 'productname' ListBox2.DataBind() C# ... cn = new SqlConnection('Server=localhost;uid=sa;database=northwind;pwd='); cmd= new SqlCommand ('select * from products;select * from products', cn); cn.Open(); dr = cmd.ExecuteReader(); ListBox1.DataSource = dr; ListBox1.DataTextField = 'productname'; ListBox1.DataBind(); dr.NextResult(); ListBox2.DataSource = dr; ListBox2.DataTextField = 'productname'; ListBox2.DataBind();
How to add an attribute to the Table generated by the DataGrid
VB.NET ’Bind DataGrid DataGrid1.Attributes.Add ('Description', 'This table displays Product Description' ) C# //Bind DataGrid DataGrid1.Attributes.Add ('Description', 'This table displays Product Description' ); Note : By doing a ViewSource you can find the Attribute Description for the Table that displays the DataGrid data
When the User is prompted a File Download dialogbox, if the user selects ‘Save’ then the ‘Save as’ dialog box is displayed. Is there any way for me to retrieve the filename and directory path specified by the user on the File Download dialog box
Clients do not report information back about where the user selects to save the content, so there isn’t an easy way to do this. Instead, you would need to ask the user before using the content-disposition for a file path, and then you could specify the filename parameter for the content-disposition header. Still, the user is free to change that path when actually downloading.