Why do I get the error message ‘A generic error occurred in GDI+.’
Give the proper path of the file. Check your permissions on the server where you are trying to write/read the files
How to remove the Cache starting with ‘cachedata_’
VB.NET Dim enumerator As IDictionaryEnumerator = Cache.GetEnumerator() While enumerator.MoveNext() Dim key As String = CType(CType(enumerator.Current, DictionaryEntry).Key, String) If key.StartsWith(‘cachedata_’) Then ’ Print it: Response.Write((‘Deleting key ‘ + key + ‘ ‘)) ’ Remove it: Cache.Remove(key) End If End While C# IDictionaryEnumerator enumerator = Cache.GetEnumerator(); while(enumerator.MoveNext()) { String key = (String) ((DictionaryEntry) enumerator.Current).Key; if(key.StartsWith(‘cachedata_’)) { // Print it: Response.Write(‘Deleting key ‘ + key + ‘ ‘); // Remove it: Cache.Remove(key); } }
Is there a Cache.RemoveAll()? How can I clear / remove the total cache
VB.NET Dim objItem As DictionaryEntry For Each objItem In Cache ’Response.Write (objItem.Key.ToString ()); Cache.Remove(objItem.Key.ToString()) Next C# foreach(DictionaryEntry objItem in Cache) { //Response.Write (objItem.Key.ToString ()); Cache.Remove(objItem.Key.ToString () ) ; }
Why do I get the error message ‘The SelectCommand property has not been initialized before calling ‘Fill’. ‘
You have to supply the Sql Statement or Stored Procedure for the DataAdapter as VB.NET da.SelectCommand.CommandText = ‘Select * from ‘ or da = new SqlDataAdapter (‘Select * from ‘, cn) C# da.SelectCommand.CommandText =’Select * from ‘; or da = new SqlDataAdapter (‘Select * from ‘, cn);
How to display items stored in a local application Cache
VB.NET Dim objItem As DictionaryEntry For Each objItem In Cache Response.Write((‘Key :’ + objItem.Key.ToString() + ‘ ‘)) Response.Write((‘ Value :’ + objItem.Value.ToString() + ‘ ‘)) Next C# foreach(DictionaryEntry objItem in Cache) { Response.Write (‘Key :’ + objItem.Key.ToString () + ‘ ‘); Response.Write(‘ Value :’ + objItem.Value.ToString ()+ ‘ ‘ ) ; }