Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. Do you have a Dataset filled with changes or just some data from textboxes? What have you tried so far? -Nerseus
  2. Using "SELECT *" isn't any slower than listing out each individual field (as far as I know). But Selecting all fields when you only need half of them WILL be slower. But how slow is too slow? I don't usually use timers to test speed of code until farther into a project. In general, you can guestimate how much is "too much". For some applications, returning 1000 rows is no big deal. For others, that may be WAY too much (over a modem, for instance). If you want some really simple timing code, try something like the following: int lastTime = Environment.TickCount; // do something here... int totalTime = Environment.TickCount - lastTime; System.Diagnostics.Debug.WriteLine(String.Format("That took {0} milliseconds", totalTime)); Dim lastTime As Integer = Environment.TickCount ' do something here... Dim totalTime As Integer = Environment.TickCount - lastTime System.Diagnostics.Debug.WriteLine(String.Format("That took {0} milliseconds", totalTime)) (Not sure if the VB code is right... ah well) -Nerseus
  3. You should also have a shortcut in your Start programs labeled "Visual Studio .NET Command Prompt". If you use that instead of typing "cmd" (or however you currently get to a command prompt), it should automatically register them for you. Very handy! -Nerseus
  4. When going to the chat window, I get "Couldn't resolve address irc.visualbasicforum.net" or something close to that. -Ner
  5. An update... I had forgotten I'd done this, but a friend of mine just had Win2003 troubles and we figured it out: In your Display properties (right click desktop, Properties then Settings), click the Advanced button. Then on the Troubleshoot Tab, make sure the slider (Hardware Acceleration) is all the way to the right. Seems Win2003 keeps it set lower as a default, to prevent problems. Hope that helps, mutant (or anyone else)! -Nerseus
  6. Hmm... as far as Win2003 goes, I haven't found anything that *doesn't* run on it. My Direct3D apps work fine (written in c# and DX9) as well as all installed games, even older ones. The oldest one I had (that I tried) had to use the compatability to imitate Win98, but even it worked fine. I'm using a Radeon 9500 Pro (a nice card) - I wonder if that's the difference? I also used an nVideo GeForce 2 GTS and everything worked fine on that, too. I run the DX9 SDK in Debug Mode as well. I have not installed the 9.0a update. -Nerseus
  7. You can use GetDC for any surface (if I remember right). Then you can use the API to easily blt the contents to a Bitmap object. Haven't tried it, but it seems easy (in theory). :) -Nerseus
  8. It seems work fine assuming you will always have an account type and account status per Account record. If not, you may need outer joins. Also, you may or may not need all the fields returned by the SELECT - I'd pick and choose only those fields you need as having extra fields means more network traffic (and temp DB space, etc.). The big test, as JABE pointed out, is does it work when you run it? -Nerseus
  9. You can also use the PropertyGrid control (the same grid used to change design time properties) if you just want to view the properties (and make changes). This won't help you enumerate the properties yourself (use divil's code for that). I've used it in a production app for some simple classes. Here's an article about it as well. -Nerseus
  10. You want to us Month/Day/Year syntax. So change the SQL to: Dim mySelect As String = "SELECT name, age FROM MyTable WHERE birthdate >'12/31/1980'" -Nerseus
  11. Have you tried the same code and image, but change the Magenta to black (and change the sprite to use black as transparency)? I test with black since I know it works (no misinterpreting what 0 means :)) If that doesn't work, check out the texture stage states: textureState0.AlphaOperation = TextureOperation.Modulate; textureState0.AlphaArgument1 = TextureArgument.TextureColor; textureState0.AlphaArgument2 = TextureArgument.Diffuse; Also I noticed you're passing in 0 for the vertext size (3rd param) in the call to SetStreamSource. I think you want the size of your vertex, maybe CustomVertex.TransformedColoredTextured.StrideSize? If you're using Direct3D to do sprites, don't forget to subtract 0.5 from your screen locations-to-x/y values. If you don't know what I'm talking about, let me know :) -Nerseus
  12. Your code will keep hitting the same pixels over and over. You could try passing something like a "direction" to your function so that you know which way you were coming from. Using that direction you would NO check the IF for pixels in that direction. For example, say you had a 3x3 grid. The first pixel is in the upper left. Say your second pixel is to the right, so you call your function again. When checking the pixels around this second pixel (top middle pixel in the 3x3) you don't want to go back and do anything with the top left pixel since you've already visited it. By using a direction you can avoid that. That's the easiest change, using your existing code. A better solution involves more work as you would create a structure to know which pixels you'd already hit. With my solution (just using a direction), you'll still revisit pixels but not indefinately. Isn't there some kind of FloodFill function built into GDI or GDI+? I don't know... -Nerseus
  13. With the bult in combobox, you can only show one column. You can put an expression column in your DataTable that merges 3 fields into one and show that in the drop down. Or, you can use another control (many 3rd party controls can have multiple columns). -Nerseus
  14. AcceptChanges only sets an internal flag that clears any status on the row. So when you add a new row it's marked "Added". Calling AcceptChanges resets it to "Original". If you then try to save the data, the DataAdapter won't do anything since it will see all rows as "original". If you look at the DataSet after the loop, you should definitely see all 99 rows. If you *don't* call AcceptChanges for each row, they should all be marked "Added". Using a DataAdapter to insert the rows should work, assuming the InsertCommand is setup correctly. -Nerseus
  15. I've never had it completely hang (I've never seen *anything* completely hang my WinXP, Win2000 or Win2003 builds except the very rare graphical blue screen when a new video driver is installed). I have seen the app start up (when I press F5) but "hang" while loading some DLLs. It happens every 20 or 30 runs, but not predictable at all. I simply stop execution and start again and it goes through. It's annoying, but I can live with it. -Ner
  16. Check out the following, similar threads: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69296 http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69304 -nerseus
  17. For SQL Server you can use SQLDMO (a COM object) or you can query the system tables if the user has admin priveledges. I'm not that familiar with the SQLDMO anymore, but I remember it being quite easy (connect to the server, find a database and table, then get the primary keys). -Nerseus
  18. There are some objects called DirectSetup. I've only seen help for them in C++, but I think there might be a COM version that you could use as well. The user shouldn't need anything more than your appilcation files plus the end-user runtime, I would think. The end-user runtime is 9meg (I think), so that's not too bad. Plus it's now included in the Windows Update (IE's Tools->Windows Update) so your testers can easily download/install it. -Ner
  19. Yes, that's way too much unless you want your game to run at the resolution 1920x1200 (or 1600x1280 or similar large res's). I can't imagine you would... Using a tiled approach, most tiled games are limited to either 800x600 or 1024x768 (that I've seen). Maybe you can buck the trend, but usually a 2D game is made for smaller hardware and that may mean a 32meg card max. Kep in mind that you're going to need twice as much memory for the display with Double Buffering (pretty much a must) plus all the actual textures used for things that *aren't* the map (the player, objects, etc.). Not to mention you may want to increase your map size one day (who knows?), and having an architecture that relies on a single bitmap/texture for the whole map would mess everything up. Also, if you ever want to move up to Direct3D there is a limit on the size of a single texture. Many cards, even those that have 32, 64, or even 128 meg RAM will have a texture limit. Sometimes it's 2048x2048, but it's generally smaller, 512x512 is common. -nerseus
  20. What are you using to see that the records show up? The code looks good in that it should be putting 99 rows in the DataTable. You don't need the variable anyRow, or that whole line. It's not doing anything since you never add the row to the table (creating a NewRow doesn't add it, just creates an instance of a DataRow object). Also, you only need to call AcceptChanges once, after the loop. And only if that's what you really want. -Nerseus
  21. Do you mean find out the Primary field in SQL Server itself, or in a DataTable based on a SELECT from a SQL Server table? -Nerseus
  22. Although I love the forums (great sources of info), I gotta recommend staying off of them for the next week or so, wyrd. Everything you're saying you want screams that you either get the petition through or pass this test. Now is not the time to be reading the forums if you really need to study. Are you going to remember these messages a year from now? I'll bet you'll remember the test/petition. -Ner
  23. Unless you have a lot of time to spend on this, I'd suggest using a 3rd party control. There are many graphing controls, most costing under $500 (small cost if buying for use in professional projects, very expensive if for personal use :)). If you really want to do it yourself, be prepared to do a lot of planning on what features you want (exploding pie is a big feature, but a lot more code) and design it out first. You did say you wanted it to be brilliant, right? -Nerseus
  24. Could you post the project so we can take a look? -Nerseus
  25. You need to call NewRow for every row you want to add. Try this instead: Private Sub btnCreateButtonRecords_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateButtonRecords.Click ' Dim x As Integer Dim NewButtonRecord As DataRow ' assign 99 button records to the template For x = 1 To 99 NewButtonRecord = objdstButtonManagement.Button_Assignment_Table.NewRow NewButtonRecord(0) = x objdstButtonManagement.Button_Assignment_Table.Rows.Add(NewButtonRecord) Next End Sub Add just adds a reference to an existing row (usually created with NewRow). When you try and call Add a second time on the same DataRow, you'll get the error you received - it's saying you can't have two rows in the datatable that are essentially the same objects in memory. It has nothing to do with the Key (column 0, assigned to the index "x"), which would be a different error (if you defined column 0 to be unique, for instance). -Nerseus
×
×
  • Create New...