Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. Doing a quick google search, it looks like the Outlook Express format is custom - meaning there is no .NET provider for reading the file. I saw a few tools that would let you do it, but none offered any data providers to use. If you are so inclined, you could write your own dataprovider to read the file as some of the websites did list the format of the data. You'd have to have a lot of patience and time to parse through a file manually though... as a warning :) -Nerseus
  2. Hey, that's the company I was talking about - I just thought they read the transaction logs not the actual database files. Good to know for the future :) -Nerseus
  3. You'll need to use Windows hooks. They're not easy as you must use the API. I'd search google for SetWindowsHookEx (I think). -Nerseus
  4. You'll have to read Microsoft's site or the readme's that come with DirectX SDK on how to distribute DX9. As for making a CD autoplay, you need a file in the root directory of the cd named autorun.inf. It's a textfile. At the bare minimum, have it show the file to run and, optionally, an icon. Here's a sample: [autorun] open=myexe.exe icon=myexe.exe I can't remember if you can specify the EXE file for the icon or not - I think you can. As for making a setup program in the first place, Visual Studio offers setup templates with a wizard for creating a setup project. You can point it to a project to get started (it will pickup most of the dependencies). You then build this setup project, which creates a setup.exe (bootstrap) and setup.msi and the associated cab files. You can learn more about setup projects in the VS help. -Nerseus
  5. Actually, sorting on a string is more the norm than sorting on other data types (maybe date coming next). It sounds like the sort might be happening before the filter (which would seem odd since a filter shouldn't depend on a sort) when you specify both on your Select. I wonder if creating a DataView with a filter THEN applying a sort would work faster? Then you could avoid using a Sorted List. Maybe try something like: ds.Tables["Table1"].DefaultView.RowFilter = "..."; ds.Tables["Table1"].DefaultView.Sort = "Title"; // Now either loop or bind to DefaultView foreach(DataRowView row in ds.Tables["Table1"].DefaultView) { // do something } -Nerseus
  6. You need to set the 3 properties of the DataAdapter: UpdateCommand InsertCommand DeleteCommand and call the Update method. -Nerseus
  7. I've done this before by having the SQL that selects the ID's also select the lookup value. Suppose you have a combobox for AddressType. You main SQL query returns an AddressTypeID which you bind the combobox. You would normally then bind a lookup table of all AddressTypes to the combo. Instead, have the main query that returns AddressTypeID ALSO return AddressType (the description from the lookup table). When you go to setup your binding (or however you fill your combo), fill it with this one value. You'll now have to figure out when the combo is first dropped down and populate it with all of the real values. You can wait til the combo is dropped down and then retrieve the values or you can load all the lookups asyncronously. When the lookups are finished loading asyncronously, fill the combos behind the scene. Another solution that might work is to download all the lookups locally one time or include them as part of a setup. Assuming your lookups have some kind of date identifier to note when they've been added or updated, you can have the user download the new/changed lookup values when they first log into your app. This will still mean that you'll have all 50,000 records loaded into some combos, which might be slow even if reading from disk. In that case, you'll need to rethink how they select that value (maybe you don't use a combobox but some kind of search mechanism). -Nerseus
  8. It's not reserved that I know of. I wonder if you have an overload for that webmethod? You have to put a special attribute on it if you want an overloaded webmethod. -Nerseus
  9. PrintMon For The Blind (you have very large buttons - good for old men like me!) :) -Nerseus
  10. I've never heard of a tool that would read or parse an MDF or LDF file. I've seen tools that parse SQL Server transaction logs which might help if you have them and if they're turned on. Search google for reading transaction logs and you should find a few tools (though the only ones I've seen are not free). Is the restore just not working, working with errors, or working fine but no data? Keep in mind that you can specify a default size for database files in SQL Server. So even though the file may be 16meg/26meg, it may only contain 50k of data. The rest may or may not be real data - hard to tell... -Nerseus
  11. I understand your issue - but I've never encountered it. I have sorted by strings, dates, and ints but never saw anything that was so slow I'd worry about it. Meaning, all the selects were under 50ms which is fine by me. Glad you got it worked out, thought it's hard to believe that you could loop through and fill a Sorted List in faster time than having the Select do it... very strange. -Nerseus
  12. I would definitely use Jet to access Access - it's what Jet was made for. On the bright side, you only have to create a setup script once. :) -Nerseus
  13. I would first look at the help files for the DataReader. They contain the raw code you would want to pull out a few values. Then it's a matter of setting the label's Text property to the string you're retreiving. If you still can't get it, show us the code you tried (such as setting up a connection, filling a datareader and then pulling out the values) and we'll help you out. -Nerseus
  14. You can move out the last line of your For statement, where you set the DeleteCommand, to after the Next. There's no need to set it each time. Also, I've often deleted inside the loop. Just loop backwards, from Count-1 to 0 with a Step (if that's still the right keywork in .NET). The issue is that VB calculates the from and to values only once. So once it goes past the line "For intX..." it figures out 0 and your Count-1 and stores them in internal variables. It does NOT check them on each pass. Counting backwards works because you don't care if the count is changing. You can also use a While loop (as suggested), which WILL check the count each pass. -nerseus
  15. You can use IIF in Access (Jet maybe?). I'd use two subselects, if possible. Try something like: select v1.machid, sum(v1.pvalue), sum(v2.pvalue) from valuetable v1 INNER JOIN valuetable v2 ON v1.machid = v2.machid group by v1.machid If that doesn't work let me know. I can try to work it out for real. -Nerseus
  16. You shouldn't use the MaskEdit box that was from VB6 as it's not a .NET control. You can now validate using Regular Expressions, though it won't provide the hard-coded placement of characters like a mask edit box. If you truly need that type of support, you can find many sample controls (with source) by searching google. Or, you could always buy a 3rd party control with that support. I'm not sure why the mask edit doesn't work now as I'm not that familiar with it (haven't used it for many years). -Nerseus
  17. There's no built-in support for this. Can you handle it by using a single-line textbox that adds lines to a listbox? If you want to handle it in one textbox, I'd suggest using a regular expression. You can write an expression that finds matches on carriage return/line feed and limits the number of characters inbetween to 100. This won't prevent the user from typing more than 100 per line, but you could prevent them from saving (or leaving focus) until validated. -Nerseus
  18. I'd have to see all of the code to know what's really going wrong. Can you post the code from Main (to see what the startup form is), the code in your main form that shows the non-modal popup, the function that makes the ADO connection and the parts that show the modal error dialog. -Nerseus
  19. I don't know anything about CRectTracker. All the controls in .NET support the Anchor property which controls repositioning and resizing automatically. Have you looked at that and it doesn't work for you? -Nerseus
  20. There's a params overload for Split which means you can pass a comma-delimited list of chars (or just one). As in: string s1 = "Hello World This Is Dan"; string[] s2 = s1.Split(' '); // or string[] s3 = s1.Split(' ', '.', ';'); You could also create the array, as in: string s1 = "Hello World This Is Dan"; string[] s2 = s1.Split(new char[] {' '}); // or string[] s3 = s1.Split(new char[] {' ', '.', ';'}); -Ner
  21. Are you saying the Select(...) is slow? How do you get the "5 times" as slow part - is it the actual Select or part of some looping code? I've used Select in a lot of places and haven't noticed a slowdown, but my data is relatively small (maybe a few hundred rows). Can you show us some code used when filling the TreeView and anything you think might be related? -Nerseus
  22. A DataView is nothing by itself - it does not contain ANY data. It MUST be hooked to a DataTable to have any data. You can think of a DataView as an array of pointers into a DataTable. The array can be filtered and sorted as well (the primary use for a DataView). You can also set some properties such as AllowNew, AllowDelete, etc. This is how you control whether new rows can be added or deleted from a DataTable when binding to a DataGrid. -Nerseus
  23. As far as I know, it's not considered "standard" UI practice to put mnemonics on tabpages, maybe that's why? I have no idea how to get one on there... For the record, you can press Ctrl-Tab and Ctrl-Shift-Tab to switch tab pages - maybe it's a user-acceptance issue? :p -Ner
  24. I'd use "ComboBox1.SelectedIndex = 0" to select the first item. Setting the Text property may work, but it will cause an error if the style is set to dropdownlist (where you can't type in values in the ComboBox). -Nerseus
  25. I think you should poke around the Help files for awhile. There are some very basic concepts that the help covers very well that would take too long to cover here. You might also search google for "Visual Basic .NET Tutorial" or something similar to find some basic tutorials on the language, forms, inheritence, etc. or pick up a cheap book online, from your local bookstore or my favorite, a library (free!). If you have specific questions we're always glad to help :) -Nerseus
×
×
  • Create New...