Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. I'd use the Date compare if you can. You'll probably have to format your string date into the proper format. In the US, that format is MM/DD/YYYY. So the SQL should look like: sql = "SELECT ... WHERE Wiedervorlage <= '" + WVDate.ToString("MM/dd/yyyy") + "'" That should convert your DateTime variable, WVDate to a string in the format specified. Use single quotes (as shown) for SQL Server, or use "#" for Access. I think Oracle uses # as well. The end SQL should look like: SELECT ... WHERE Wiedervorlage <= '09/29/2003' If you really want to use the formatted version, you'll want to convert to a number: sql = "SELECT ... WHERE CONVERT(int, FORMAT(Wiedervorlage, 'yyyymmdd')) <= " + WVDate.ToString("yyyyMMdd") Note that in the above, I didn't put single quotes (or #) around the WVDate value. This is because you'd like to compare two numbers. I've never seen "Format" before - I'm guessing that's Access, but not really sure. If it is Access, change the CONVERT to something like CLng(...) or similar. -Nerseus
  2. What's the error? As far as I can tell, you've never declared Label14. Otherwise it looks fine unless you're using an inherited form with Label14 as a Private variable. -Ner
  3. Egads! IndexOf does NOT skip over CR/LF characters! Twice in one day :) -Nerseus
  4. Sounds like a good, fast machine to me. Might be lacking in some important gaming essentials, if you ask me, but it's your preference. I'd think an upgrade to a 19" or even 21" monitor would be worth it. Also, if you can get the 9800 PRO (or even a 9700 Pro) it would be worth it. Also, do you already have a DVD drive? Might want to look into an upgrade on that as well. Probably looking at a few hundred more for everything though. -Ner
  5. I don't think the uniqueidentifier type is available in all databases (might be SQL Server only). Your idea sounds good though one usually uses a transaction to increment the NextID field and use it for the insert. If you're sure no one will be using the database while you're performing the inserts, your idea of figuring out the number of IDs should work fine. I don't think I'd use the ID value (-67 means 66 new IDs needed) though. If you delete a row from your DataSet and add another one, you'll be off by one. Not a big deal, you just might use up more IDs than necessary. Why not just get your table's rowcount, through: ds.Tables[0].Rows.Count. -Nerseus
  6. You're exactly right - for some reason, VB5 and VB6 (haven't checked other version) always show the underscores regardless of the OS setting. -Ner
  7. Actually, you're not getting CR/LF, just CR (or LF, I can't remember my ASCII codes). Remember that IndexOf is 0 based. h=0 e=1 l=2 l=3 o=4 CR=5 CR=6 m=7 -Nerseus
  8. If you press alt-x does it fire the click event? In some newer versions of windows, you won't see the underscore until you press Alt. If you go to Display Properties (where you go to change resolution) and select the Appearance tab then press the Effects button there should be an option. At least that's where it's at in WinXP and Win2003. I can't remember where it's at in Win2000 if it even exists. -ner
  9. Why in the world would you want your relational database to hold flat-file information? I would think you'd want all that data in the Access database in separate columns. Or if you already have it in Access, then create a separate table to hold the "split" data - then you could delete the original pipe-delimited data if you don't need it for archival purposes. Once in a relational format, you can easily get each column separately and do the search you want. If for some crazy reason you don't want to do it that way, you could run a search like: SELECT SubString(field, CharAt(field, '|')) ... That's SQL Server syntax (the SubString and CharAt functions) - I'm sure Access has equivalents (probably Right or Mid and IndexOf) if you need them. -Ner
  10. Normally you'd only do one sum through your SQL Code, like by Month as Cassio showed you. On the form (or report), you do the summing by year and/or a Grand Total. You can use the DataTable's compute method for this if you like: object oTotal = ds.Tables[0].Compute("SUM(value)"); // Might want to check if oTotal !=null int total = Convert.ToInt32(oTotal); If you want both the Monthly and Yearly totals, you're probably best off running two queries. -Ner
  11. No big deal, Alex :) As divil said, better safe than sorry for the most part. It won't hurt to call Dispose when you're done with a Form, or any object for that matter. When MUST you call Dispose? Never, really - but you might get exceptions later on. If you always call Dispose on a Form, you're probably Ok. If you happen to create any Graphics objects through a call to CreateGraphics, then you must call Dispose on that Graphics object. It mentions that in the help. For other objects, you'll have to look at the help to see if you MUST (or *should*) call Dispose. For the most part, the answer is No since most objects won't do anything with any system resources. If you have an object that opens a file, for instance, then you'd want to Close that file yourself rather than wait for the GC to do it (that may happen minutes or hours later). Normally that's done through a method named Close, but you could put that close logic in your Dispose method and remember to call Dispose. -Ner
  12. Do you really need the SQL Server running locally? I know it's useful for testing, but if you could offload that to another matchine that might help as well as SQL Server can be a beast sometimes. I can say that the VS IDE only had a marginal improvement going from a P3 700 to a P4 3ghz. When I went from 256 meg to the current 1gig (at work), I noticed a big improvement. Other than NOT using Visual Studio to do your development, I don't know of any other ideas to get your current setup running faster. VS is a beast - very nice to use, but a performance beast. -Ner
  13. What's wrong with what you have? Does it throw an exception, give you the wrong data, or something else? -Ner
  14. You can use the Command object's ExecuteScaler function. Or you could use a reader and just look at the first column of the first row. -Ner
  15. So you could use RDO from within .NET? I'm unclear as to why you'd have to use RDO then, if you're not forced to use an RDO Resultset from an outside source and you haven't mentioned passing the Resultset on to anything else. There are TONS of resources on using RDO, by the way. Search google for RDO Resultset for instance. The objects, methods, and such are the same. -Ner
  16. Badged meaning blue-ies, green-ies, red-ies, etc. The leaders, experts, admins and what-not. I think the concern is that badges would be the ones coming up with the idea, setting the rules, judging, etc. and there's not a lot of time for most of us. I, too, agree that challenges are fun and have the potential to bring in lots of users. I haven't seen those types of numbers in the past even when prizes are offered but I'd be up for a challenge if we can get a good idea hashed out. :) -Ner
  17. I started when I was 9 (I think - long time ago) on a Vic 20. Ok, earlier if you count the computers at K-Mart (a Timex Sinclair and others). My first "real" program was on a Vic 20. But, alas, there was no hard drive, no disk drive and no tape drive - when it was turned off (for Love Boat - Sunday night), the program went away. It was a Zork-like knockoff with two rooms and took 5 or 6 commands. It was coooool. Later I got a tape drive and thought it was the bomb! Random thoughts... ah... -Ner
  18. Did you download this in multiple parts? Some of the MS downloads are one big file, some are broken down into chunks - maybe it couldn't find a chunk? :) -ner
  19. (You probably saw this coming) Without knowing just how many graphics you have and how much custom drawing you're doing, ti's hard to answer. Plus a tablet PC is going to be foreign to most people since they're not very widespread as of yet. I can make a general statement that used to be true (not sure if it is in .NET). It used to be that PictureBox's were very handy things - exposing nice events and such. But when it came to graphics performance, you paid a price. While it may be a lot more code, you might try implementing your Min/Max buttons as pure graphics - handled through the Paint event. It means using the Form's MouseMove events to determine where you're at and if you're inside the area that looks like a Min/Max button and draw it accordingly. Depending on many graphics you have, you may want to convert none, some, or all of your PictureBox's to this type of custom drawn stuff. Definitely more code, but it may pay off in performance. -Ner
  20. Are you filling the DataSet somewhere else? I don't see any code that fills objMeter. -ner
  21. For JABE's suggestion to work, you'd have to load the whole XML file into memory. The SAX objects may work, though I've never used them. They are made to read in XML asynchronously, so that you only process a node at a time. Never tried it though... Are these app-specific error messages and you're just looking for a way to keep them extracted from the main project? Even a medium sized lookup shouldn't be more than a thousand or so messages. If each message is 100 characters that's only 100k or so (plus baggage for the XML object itself) - maybe a meg on the outside. Given the requirements for .NET itself, I wouldn't think keeping a few of these system type lookups in memory would hurt performance too much. -Ner
  22. Holy cow there's some bad info in this thread! That's only true for non-modal windows. For Modal windows, you should call Dispose. If you never care about getting a result from the modal window, you can call Dispose in the form's Closed event. Normally you will call Dispose in the calling form after you've gotten back any values from the modal window that you need. Not quite right. If your object holds onto any resources (window handles and such), you should call Dispose to have them released immediately. That means objects you create that hold onto resources should release them that way (or through an explicit method like Close). The GC will not collect it immediately though - it will still get collected whenever the GC runs and determines that there are no more references to the object. paulx3 is right - You should never call Dispose on a form to close it - you should always use the Close method and Dispose if needed. -Nerseus
  23. Not really the appropriate place when looking for drivers (this is a programming forum), but a quick search for "Winwriter 400 driver" on google gave this: http://www.printer-drivers.com/drivers/17/17028.htm -Ner
  24. You can even have .NET v1 and .NET v1.1 (also known as 2003) on the same machine at the same time, though you might run into issues if you use 3rd party controls that need different versions for each version of .NET (or a separate COM version for .NET and VB6). -Nerseus
  25. I'm still investigating what I've got :) It appears that the library I'm dealing with is made to run from an EXE. The EXE launches a specifically named DLL (standard, non-COM) and is expecting it to implement a specific class (?) or at least a specific function. The DLLMain function does nothing (returns 1), so it's not invoking anything through there. I'm not that familiar with unmanaged C++ (systems programming in college was probably the last real work I did), but it appears that the EXE must have been compiled with knowledge of this class (an interface actually), and it expects my DLL to implement it. Now how it knows which class (in case my DLL were to expose two?), I have no idea. I'm still playing around. I've been able to get the sample code to work and I can create my own from scratch. I'm petrified of trying to have my unmanaged C++ class call into a COM component (wrapping in the backwards sense). I'm not sure how else I'd get the unmanaged DLL to invoke or instantiate my C# DLL. It might be as simple (assuming I even knew how to instantiate a COM component in C++ to begin with - something about CoCreateInstance blah blah) as creating one global instance of my C# class (exposed as a COM object) and having my COM interface mostly match what the C++ class has. That way every call to my unmanaged DLL could call a similar method in the COM class. I'm not sure of all the types of parameters I'll be dealing with yet and that may throw in even more kinks (passing structure and class pointers through to a managed C# application wrapped by COM - egads). -nerseus
×
×
  • Create New...