How to save a file in the client machine
The browser will not allow you to save a file directly to a client machine. You could however do a Response.Redirect(‘http://server/filename’); which would send the file back to the browser, at which point the user would be prompted to save / open the file.
I get the error message ‘Cast from type DBNull to type String is not valid.’ when I try to display DataReader values on form
Try VB.NET txtCountry.Text = dr(‘FieldName’).ToString() C# txtCountry.Text = dr[‘FieldName’].ToString(); or Try VB.NET If dbReader(‘fieldname’).ToString= DBnull.Value.ToString() ’Empty field value Else ’Display value End if C# if (dbReader[‘fieldname’).ToString() == DBNull.Value.ToString() ) { //Empty field value } else { //display Value }
How to store SortedList in Session or Cache
VB.NET Dim x As New SortedList() x.Add(‘Key1’, ‘ValueA’) x.Add(‘Key2’, ‘ValueB’) To store in Session: Session(‘SortedList1’) = x and to retrieve Dim y As SortedList = CType(Session(‘SortedList1’), SortedList) C# SortedList x = new SortedList(); x.Add(‘Key1’, ‘ValueA’); x.Add(‘Key2’, ‘ValueB’); To store in Session: Session[‘SortedList1’] = x; and to retrieve SortedList y = (SortedList) Session[‘SortedList1’];
What is xxx(src As Object, e As EventArgs)
xxx is an event handler src is the object that fires the event e is an event argument object that contains more information about the event An event handler is used when one object wants to be notified when an event happens in another object
Is the session timeout attribute in minutes or seconds
The Timeout setting is in minutes, not in seconds. i.e The timeout attribute specifies the number of minutes a session can be idle before it is abandoned. The default is 20