Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. 14,000 entries is an awful lot for a listbox, is there any way this could be reduced? How is the listbox populated? If the data is in a data table you could bind to a data view instead and use it's filtering capabilities. Would it be possible to wait until a character or two have been typed and then bind to items that match rather than removing non-matches? If you are using VS 2005 or higher you could try using a text box and populate the auto complete list with your 14,000 strings.
  2. If it is the same .exe then it is probably down to the OS configuration - can you telnet into the mail server from the 64bit OS? If not I would check the firewall configuration to see if it is allowing access out on the correct port.
  3. I haven't checked but there is a chance that creating an image and then saving it could result in the image being compressed again - which in the case of a jpeg will reduce the quality, saving the raw bytes locally and then either creating an image from that or the original byte stream would prevent this. It could also be down to restrictions of the gif format - depending on the original image you could be attempting something that just isn't supported.
  4. Are you storing your session in either SQlServer or a StateServer rather than InProc? If so the session end event will never fire. Are you using exactly that code above or is the code in the session end slightly different?
  5. Not sure why the error is being thrown, however if you are just wanting to save a copy you could just save the raw bytes to disk - you don't need to create an image instance and then save that.
  6. Is the 64bit version configured to point at the correct mail server?
  7. The values are stored in a per user config - these are kept as part of the user profile.
  8. If the method is called Main and is also public and shared then it should work. If you are using VS 2005 or higher you will need to disable the application framework first though - it is on the same property page as the one for selecting the start up form / object.
  9. Generally if you need to coordinate multiple activities then the back ground worker becomes more difficult. It was really put there to simplify the common situation of executing a single task in the background.
  10. To get the list of files you can just do dim files() as string = System.io.directory.getfiles("c:\", "*.jpg") to delete a file you can use the system.io.file.delete() method.
  11. Web applications have a slightly different approach to data access and (IIRC) you do not get the data sources tab. If you have already created your datasets / object model / raw sql you can add a data source object to the page and point that to your underlying db / object model etc.
  12. The users would need a copy of your application (plus framework) and they would need the database connection string to point to the database on your computer (ideally this should be in a config file). You would also need to give the relevant users permission to the sql server (create a login) and then to the database (create a user for their login). Once that is done the users would need permissions assigned to allow them to access the stored procs, views, tables etc.
  13. Is this a windows or a web application? If a web application are you hosting it under IIS or using the built in web server?
  14. As a quick example int[] x = {1, 2, 2, 34, 234, 123, 3, 234, 12, 123, 45, 4, 14, 132, 123, 123, 23}; var res = x.Skip(4).Take(3); should result in res containing 234, 123, 3 you could then use something similar to var newList = (from Task t in FoundTasks where t.TaskStatus.Contains(sStatusFilter) && t.TaskType.Contains(sTaskFilter) select t).Skip(10).Take(10); to restrict the results to a certain range.
  15. As a quick point I would change your first sample to var newList = from Task t in FoundTasks where t.TaskStatus.Contains(sStatusFilter) && t.TaskType.Contains(sTaskFilter) select t; that way var should be based on the result of the Linq expression rather than object. Have you tried using a LinqDataSource and binding the grid to that rather than assigning the result directly to the grid? Failing that you might want to handle the paging events yourself and take advantake of Linq's .Skip and .Take methods to do the actual paging. Out of interest are you using Linq to Sql here or linq against some other object model / collection?
  16. MS have made a big deal about the Dataset / dataadapter approach and that is where they have concentrated their efforts (designers etc.) - plenty of tutorials etc. just take the simplest approach and go with whatever MS are pushing. Personally for anything other than a simple project I would rather use a O/R mapper to generate my data access layer and save myself the effort and boredom of doing it myself...
  17. Are the root folder and the sub-folder configured as different applications under IIS?
  18. Easiest way is to provide the ShortFunc class with a couple of functions that can do the actual comparison required by the sort routine. http://msdn.microsoft.com/en-us/library/tfakywbh.aspx gives the details. As a more solid example I've extended your ShortFuncClass... Private Class ShortFuncClass Public Name As String Public ActionNumb As Integer Public Sub New(ByVal par_Name As String, ByVal par_ActionNumb As Integer) Name = par_Name ActionNumb = par_ActionNumb End Sub Public Shared Function CompareName(ByVal a As ShortFuncClass, ByVal b As ShortFuncClass) As Integer Return a.Name.CompareTo(b.Name) End Function Public Shared Function CompareNumber(ByVal a As ShortFuncClass, ByVal b As ShortFuncClass) As Integer Return a.ActionNumb.CompareTo(b.ActionNumb) End Function End Class and the two sort methods simply pass the relevant delegate into the List.Sort method using one of it's overloads. Public Class ShortCutFuncListClass 'nested class snipped - posted above Private ShortFuncs As List(Of ShortFuncClass) Public Sub New() ShortFuncs = New List(Of ShortFuncClass) ShortFuncs.Add(New ShortFuncClass("Playback: Play/Pause", 0)) ShortFuncs.Add(New ShortFuncClass("Playback: Next", 1)) ShortFuncs.Add(New ShortFuncClass("Playback: Previous", 2)) ShortFuncs.Add(New ShortFuncClass("Playback: Exit", 3)) End Sub Public Sub SortByName() ShortFuncs.Sort(AddressOf ShortFuncClass.CompareName) End Sub Public Sub SortByActionNumb() ShortFuncs.Sort(AddressOf ShortFuncClass.CompareNumber) End Sub End Class These two functions do the required sorts - try the following snippet and notice the sort order changes if you step through. Dim x As New ShortCutFuncListClass x.SortByName() x.SortByActionNumb()
  19. If the class has such tight dependencies on the callers then (to me anyway) it suggests that it probably shouldn't be a public class or that the methods in question shouldn't be public. However without seeing any code it is difficult to say what may be the cleanest solution...
  20. Would it be possible to see an example of this functionality (or more detail about what these convenience functions do)? It seems an awful lot of effort involved for something labelled as a convenience ;)
  21. Once you have opened the file stream you could either use it's Write method or a possibly even easier way would be to open a StreamWriter over the FileStream and use it to write the string(s) directly.
  22. Description has been changed to include XNA.
  23. Is there any chance you could attach a sample of the xml file? Just to give me something to look at in a debugger... At first glance however I would be cautious about using class level variables and redefining them at the method level - this can introduce all sorts of odd errors. Equally you need to be careful if you are storing any state between method calls as under IIS web services are going to be be stateless unless you deliberately choose to use session variables or similar.
  24. http://www.lucamauri.com/snippet/snip.aspx?id=16 has already got the hard work done ;) If you are still curious about unsigned shifts I can certainly have a look and see what I can dig up...
×
×
  • Create New...