Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. You would have to change your calling code somewhat and provide two webmethods. The first call to the webmethod would start a process running on the webserver and return. You can use whatever you like for this. You might start a new thread and have it do the actual work, you might launch an EXE that runs asynchronously - your choice. That process (thread or EXE) would need to set some kind of flag on the webserver. If you use a separate thread, it could change some global variable in the website (an Application variable for instance). If you go with an EXE, maybe set a flag in a database or create a file at the end of the process. Again, your choice for whatever makes sense. The client code would do something like: 1. Call first webmethod to start a process 2. Loop for 3 and 4 below 3. Sleep for 1 second (or 1 minute or 10 minutes or whatever you want) 4. Call a second webmethod that checks a "flag" (see above for what that is). You're done when step 4 returns a "true" for the flag. Maybe the webmethod returns a DataSet (if that's what you need) and it's null/Nothing until the process completes. Maybe you just need a true/false returned. Who knows... Again, this is just one way to do it. I'm sure it will spark some ideas. Now, if this is internal only, then why force this to go through a webservice? Why not use remoting? Maybe use COM+? Maybe something else? Why a webservice I wonder? -ner
  2. I'd prefer a simple (one printable page) doc that explains how to install MSDE and configure it for the "simple" users. That way I can refer people to that page when they ask that question. How they actually USE MSDE would be another great 2 or 3 page doc. Meaning, how to create a DB, a table, etc. since MSDE comes with no UI. -ner
  3. I would only suggest increasing the timeout to such a large value if the website is ONLY used for this purpose (and not serving webpages). A session is 20 minutes, each page is usually limited to 1 minute (or something similarly small). I'm not sure what you're doing, but I don't think you need/want a webservice for this. If you're kicking off a long process, I would think it would be better to split this into two pieces. The first would start the process and the second would "poll" to see when it's done. While webservers were intended to be stateless (each call is separate from the others), using a "polling" type idea might work great here if you really need this long process exposed as a webservice. If it's just a webpage, then wow... that's a long time to wait :) -Nerseus
  4. GUIDs can be good, but they're hard to read which usually equates to harder to maintain for developers. Pros/Cons to both approaches. As for SQL Server, there are two ways to get the last ident: @@IDENTITY and SCOPE_IDENTITY(), which I've had to use quite often for various reasons (procs calling other procs which do inserts and the "outer" proc need or don't need the @@IDENTITY). SQL Server can pool connections but it still knows about each machine making the request (if the connection strings are exactly the same). Normally you shouldn't have to worry about using @@IDENTITY. I have yet to find a way in Access to do the INSERT and select the @@IDENTITY. I guess if you want performance, go with MSDE. -nerseus
  5. You might also try a DataReader and build your DataSet "by hand". The DataSet has no "paging" or "asynchronous" methods built in, so you get stuck downloading all 20,000 records at once. The BIG question should be, why download all 20,000 records? Maybe download the top 100 or 500 then alerting the user that they need to filter to get better results OR require a filter up front (and still only show the top 100 or 500). No one is really going to page through 20,000 records. The key is to figure out what they really want to do with that data and give them options to get to what they're after. For example, if they want to drill down, then give them a filtered list of "something" from which to drill down on. -ner
  6. I don't know about "automatically", but you could use: System.Diagnostics.Debug.WriteLine(t); That sends it to the Output window, not the immediate window - good enough for me most of the time. You could also add a Watch, which shows the value of variables or code at runtime. You can also set a breakpoint and, if you have Visual Studio, hover your mouse over variables to see their values. -ner
  7. As a note, a pre/post build event is just a batch file that VS creates and runs for you at the proper time. I've used them for such things as copying files to a shared resource (for simple Dev environment pushes) though the sky's the limit. A batch file could, for example, run another program - even the app you just compiled if you had the need (select Build off the menu and the program runs, go figure). -nerseus
  8. Maybe try ds.Tables[0].Rows.Add(datarow) instead of ImportRow? -nerse
  9. I'd try this first (haven't worked with Crystal in awhile): Run the report in the Crystal Designer (if you can). It should allow for entering the params manually. Try entering "good" values for FromDate and ToDate - values that SHOULD return a limited set of records. Let's assume that works... if it doesn't then something is wrong in the report. Next would be to verify that SQL Server is getting the right params, if Crystal passes those values on to SQL Server. If Crystal is only filtering locally then I'm not sure how to debug it. Assuming SQL Server is being filtered (in a WHERE clause somehow), then you can turn on tracing in SQL Profiler and check the SQL being sent to the DB to see what the WHERE clause shows. -ner
  10. You'll want a join between the tables with a GROUP BY on the date part you want (if you have no time portion you can just use the date field itself). The group by allows you to do the SUM(amount) per the group by (date). -ner
  11. What? I should be denied access to LAN party games at work because I use Windows 2003? No way! Denial for us "managers" is uncalled for. I think Windows 2003 is just as responsive as XP Pro for gaming. There were a few tweaks that had to be made as Windows 2003 IS made to be a server, not a game-enabled OS. But they were minor, mostly "undoing" the security features that keep servers "safe" from blue screens (such as enabling hardware acceleration). For those that have had a chance to use Windows 2003 I think you'll agree that you'd never go back. For a development machine it's fantastic (multiple local websites, Active Directory tools built in, etc. etc.). It would be a shame to NOT allow games (like NT) "just because". Now, back to the original topic... I wonder if NFS ever worked on your machine, or just not in Windows 2003? Also, I'd make sure you've enabled all the hardware acceleration features in Windows (System Display properties, advanced, hardware acceleration) and DirectX (Direct3D, DirectSound, etc.). I would assume you already did this or else you wouldn't have gotten it working by switching your zip drive. I'm surprised you even got your machine to boot without a "C" drive after you changed your zip drive's letter. I would have thought you'd be stuck reinstalling with your zip drive disabled until Windows came up (so that the zip could be D: or something higher). Great that it worked though!
  12. You can use the textbox's EnabledChanged event and do something like: private void textBox1_EnabledChanged(object sender, System.EventArgs e) { TextBox tb = (TextBox)sender; if(tb.Enabled) { tb.BackColor = Color.FromKnownColor(KnownColor.Window); } else { tb.BackColor = Color.Red; } }
  13. First, you don't want to use Application.Run(splash) - your app will close as soon as the splash form goes away. When you use Application.Run this way it means "run my app until the form specified is closed". Search the forums for "splash" and you'll get a couple of good hints. The basic idea is to use Application.Run(frmMain) and from within frmMain show frmSplash. There are other methods to do what you want, I'd search the forums and read the help on Application.Run. -ner
  14. Is there a delay when filling the dataset, or just when binding? If it's the binding, does it make a difference if you return only one record versus hundreds? -nerseus
  15. I do (at work)... things have worked great so far. And, I LOVE Windows 2003 - like XP Pro on steroids :) -nerseus
  16. Nerseus

    Bits

    Are you sure you mean one bit at a time and not one byte? If you did mean bit, try the suggestions above. If you meant byte, just create a byte array. Now if you want a specific chunk of memory that's a bit different. If you want a chunk in another process (not from your app, but someone else's) that's yet another story. -ner
  17. No idea how to do it "right", from within the IDE - not sure Visual Studio even supports any kind of event like what you want. Maybe, but it seems like a lot of work to write an "add-in" to do what you want. Can you just "fake" dependencies in your solution? So have Project C depend on Project B which depends on Project A, even though none actually have any references or other dependencies. In effect, force which project will be built last. Now, there might still be a problem. From what I've experienced, the Post Build command only runs when a project is Built. If VS determines everything is up to date, it won't run the Post Build command. So unless you're changing your "last" project, the one with the Post Build event, it won't be running that command. Two other suggestions, though neither may work for you: do ALL your compiling from a batch file (which would include your custom post build step) OR just run a batch file after you rebuild, which is all a Post Build command is. -ner
  18. Are you interested in learning about the graphics, or just game logic in general? If you say "both", then I'd pick one and start there... A "game" is like a bunch of apps rolled into one, in terms of what's needed to create one. If you want, check out some of the threads in the graphics forums to help with graphics. You'll have to decide if you want to learn DirectX (moderate to very difficult learning curve) or GDI+. You might also check out some "tutorials" that some users have posted, here and elsewhere: maybe search google for "C# game" or something close
  19. anand, I can't help you with the command line options - never done it that way myself (lucky enough to use Visual Studio). You'll have to do SOME investigation on your own - try reading the help that came with the framework or search Google. I think there have even been a few threads on this forum that talked about options though a Google for a tutorial/sample might be best. Or, try out the SharpDevelop IDE. If you're new to programming, I'd strongly suggest some kind of IDE so that you can "play" around without having to worry too much about all the details of setting up the compiler.
  20. There is no free IDE from Microsoft, only the Framework is provided for free. With the framework you get the compiler - command line only. If you install nothing else, you'd have to use Notepad (or something similar) to write your code and compile it on the command line. Visual Studio is Microsoft's IDE. The IDE is basically a text editor/compiler (a LOT more actually) that works with the framework. But you don't need Visual Studio to write, compile, or run .NET applications. If you want a free "IDE" that works with .NET, there are a couple that I'm aware of. There are separate ones for WinForms and WebForms. The one for WinForms that I've heard of is called SharpDevelop[/ur] and is for C# or VB.NET. I'm sure there are others, but I've heard decent things about that one. -Nerseus
  21. Try one of the following links. Essentially, use @@IDENTITY in Access to get the last AutoNumber field that was inserted. http://xtremedotnettalk.com/showthread.php?t=83166&highlight=%40%40IDENTITY+access http://xtremedotnettalk.com/showthread.php?t=82479&highlight=%40%40IDENTITY+access -Nerseus
  22. A delegate creates a new variable type and is used to define what a function looks like (it's params and return type) so that you can call a function dynamically, in a type-safe way. Similar to defining a class, a delegate just provides a definition of what it should look like. This is similar to an interface in that you're not providing code, only what it should look like. Unlike an interface, it's just for a function and you CAN instantiate a variable of that type. The most common use for delegates is for handling events. If you use WinForms, then every event you use is defined in the system as a delegate. When you double click on a control in Winforms to create an event, it creates code something like the following (in C#): // In InitializeComponent: this.Load += new System.EventHandler(this.Form1_Load); // Outside of InitializeComponent - just somewhere in the class: private void Form1_Load(object sender, System.EventArgs e) { } Somewhere in System MS has defined a delegate that looks like this: delegate void EventHandler(object sender, System.EventArgs e); Visual Studio takes care of adding the "this.Load += ..." code for you as well as defining a function that matches what the delegate wants. Delegates can be single or multicast as well. What does that mean? Simply, if you add more than one "handler" for the delegate, it becomes multicast. That means that when you call the delegate, which looks like a function call, it will actually call more than one function. This is ideal for events since more than one piece of code may want to handle an event. Here's a sample in C#: public class Form1 : System.Windows.Forms.Form { // The delegate, just the definition of what a function will look like delegate void Test(); // A function that matches the definition of the delegate above private void TestA() { System.Diagnostics.Debug.WriteLine("TestA"); } // A function that matches the definition of the delegate above private void TestB() { System.Diagnostics.Debug.WriteLine("TestB"); } // Constructor public Form1() { // Define an instance of the delegate Test t = new Test(TestA); // Add a second handler to the delegate t+= new Test(TestB); // Call the delegate - will call both functions, TestA and TestB. t(); } ... } -Nerseus
  23. lol, Camper Van Beethoven - still hear "matchstick men" every once in awhile (not very often though). I was more into Minor Thread, Fugazi, etc. until my sister got me hooked on Erasure (and eventually won me over to Pet Shop Boys and Depeche Mode). I didn't get to too many concerts, but I did see the Cure in '94, I think. It was disappointing though - very lackluster (in St. Lous, MO) except for one HUGE rainstorm that came in (in an open field where my seats were). Worst concert ever? Howard Jones about 2 years ago in Tucson, Arizona - VERY small theater. There were about 100 of us that showed up. In all honesty, I had a BLAST, but it was pretty lame :) -Nerseus
  24. I don't think there's anything built into .NET to do it, no. Do you have to use an Array? You can do some "nifty" stuff with a DataSet (it doesn't have to do database stuff) and its Compute and Select methods. Writing code to do what you want is pretty trivial though, if you need it. -nerseus
  25. Maybe you should show your code again. I'm confused if you're saying frmMain is or is not a form. I think frmMain is a form and ModMain is your module. Maybe start commenting out code as well, such as Audio and Video, and see if that helps - try narrowing down the problem until you can see what's causing the error. -nerseus
×
×
  • Create New...