Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Are you doing anything else with the DropDownList like databinding?
  2. As an excellent example I quit my last job over working conditions (to go work for a competitor) for approx £2000 a year less than I was earning. When I was asked for my reasons for leaving I told them exactly what issues I had and how I had raised these with my manger in the past and nothing was ever sorted. To emphise just how poor the conditions were I made them aware of the pay cut I was taking. Their solution to tempt me to stay - no change in working conditions but a small pay rise, makes you wonder what thought process went into that decision...
  3. The built in Array.Sort routines only work with single dimension arrays, so if you want to keep the data as an array you will have to write your own sort routine :( You might be better off (if it is suitable in your case) to create a class / structure to hold the information and create a single dimension array (or Arraylist / List<>) of your class and also provide an implementation of the IComparable interface.
  4. I do like the way management often get the best hardware, dual-core boxes with 20+ inch screens and excellent video cards just to run a DOS accounts package or a web based reporting tool... If you spend a large part of your day writting code then a decent monitor is a must (size and quality). VS needs a minimum of 1280 resolution to be productive - anything less is a chore.
  5. Access can be a pain to work with, it might be easier to just ship an already created but empty database with the executable (possibly as an embedded resource) to save having to recreate it through code and therefore remove the dependancies on adox and adodb. Are you also having the same problem with SQL?
  6. If you use ildasm on the system.windows.forms.dll and look at the form class then you can see Close doesn't call dispose.
  7. If you create an array with code like DataGridViewCell[,] cells = new DataGridViewCell[15, 1]; The maximum element number in each dimension is one less than you specify (arrays are counted from 0 not 1), therefore the maximum element is at position [14,0] - which is really the same as creating a single dimension array.
  8. .Tab can be replaced with '\t' and .CrLf with "\r\n", or you could always reference the microsoft.visualbasic.dll and then use the vb constants.
  9. It looks as though you are deleting records from one table (groups_reference) based on the results of a query on another table (Managers) - is that right? If so you may want to look at the functionality provided by DELETE FROM FROM as cursors will often provide worse performance and are not an implicit transaction - your code above could cause problems if a system failure occured during the WHILE loop; you would need to wrap the function inside a BEGIN TRAN ... COMMIT block to ensure reliability. Somethng like the following should do it - it hasn't been tested, if it works try comparing both vesions with Query Analyzer's 'Show Execution Plan' function. DELETE FROM Groups_Reference FROM Managers AS M INNER JOIN Groups_Reference as GR on M.Manager_ID = GR.Manager_ID WHERE Org_ID = @OrgID
  10. public int Port { get { return this.Port; } set { this.port = value; } } should be public int Port { get { return this.port; } set { this.port = value; } } it's why I tend to prefix private variables with an underscore, makes it easier to spot when skimming over the code.
  11. lf, http://www.xtremedotnettalk.com/showthread.php?t=69043 is worth a look though.
  12. http://www.xtremedotnettalk.com/showthread.php?t=87690 may be worth a read.
  13. Personally I favour the ease of the XMLSerializer class for something like this as it does remove a lot of the complexities. If you are using 2005 then it takes care of this for you anyway.
  14. Which line(s) give the error?
  15. For the repeat function try lRet = mciSendString("play midi repeat", "", 0, 0); To stop a playing track you would send the stop command using the same deviceid (midi in this case) you used to open it.
  16. If you want to make sure each item is played once before duplicates then you could load the filenames into an array and then randomise the array, then just keep selecting the next item in the array. string[] items = ...loaded items...; Random r = new Random(); byte[] b = new byte[items.Length]; r.NextBytes(b); Array.Sort(b, items);
  17. http://www.xtremedotnettalk.com/showthread.php?t=87690 may be worth a look.
  18. If you have control over the base class then you can either provide a virtual method yourself that can be overrriden in a derived class, or make the base class abstract and provide an abstract method that must then be overrriden in the derived class.
  19. The "." or "," is down to localisation - some countries use , as the thousands sperator and . for decimals other countries use them reversed. You could change the lines similar to .Cash = CType(OrgArray(i, 1), Double) to be more explicit by using the .Parse method .Cash = Double.Parse(OrgArray(i,1), System.Globalization.NumberStyles.Currency) 'or to be more exacting still you can provide an explicit culture to use for parsing .Cash = Double.Parse(OrgArray(i,1), System.Globalization.NumberStyles.Currency, System.Globalization.CultureInfo.CurrentUICulture) You could simplify the code some more by using one of the classes from System.Collections such as ArrayList rather than just the Collection class. Collection seems to really be there for VB6 compatability and isn't as functional as the others, e.g. Arraylist provides an .IndexOf method to check for existing entries. Using a HashTable would allow you to store a person and reference it by the person's name directly...
  20. MDF files require the SQL server database engine to be installed. This means either the full blown SQL Server product or MSDE / SQLExpress needs to be installed.
  21. Remove the blank line between the attribute and the method it applies to.
  22. You will probably find the document is now either using a namespace when previously it wasn't or it is now no longer using it as a default namespace. To confirm this check higher up in the document and within an opening element tag you should see something like xmlns:pv= Could you also post the error you are getting and any other relevant code as it makes it a lot easier to diagnose problems if the actual errors are given.
  23. If you run the SQL Server configuratuon manager tool and expand the SQL Server 2005 Network Configuration node you should see a list of the installed protocols. If the only one enabled is shared memory you will need to enable at least one of the others (in most cases TCP/IP should do the trick).
  24. If you cut and paste the contents of the mySelectQuery into your MySQL query tool and run it do you get the correct results? Out of interest what data type is trans.stid in the database? As a final point you could try using a parameterised query rather than string concatenation as it will removed issues due to data type conversions as well as being a more robust / secure solution.
  25. Is the background thread updating the user interface directly? If so you will need to Invoke the update routine from the main UI thread. Also if you use a tool like Process Explorer is the high cpu usage from a single thread or is it fairly even over all threads? Also check how much time is spent in the GC and check if you are getting a high number of collections.
×
×
  • Create New...