Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Jeff Varszegi

@Jeff Varszegi
About
Posts
453
Topics
30
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • IQPOTD - IQ Problem Of The Day
    J Jeff Varszegi

    Right, I've a strong hunch that it would always take four tests then.

    The Lounge csharp css database tools json

  • IQPOTD - IQ Problem Of The Day
    J Jeff Varszegi

    Count me extremely lucky. I did it in less than ten seconds, no joke.

    The Lounge csharp css database tools json

  • SQL Problem
    J Jeff Varszegi

    I can't understand your layout. If you're saying that it's like this, [Table 1] --------- IDPerson IDRelation IDWorkPlace [Table 2] --------- IDPerson [Table 3] --------- IDWorkPlace then you can use

    SELECT t1.IDPerson
    FROM [Table 1] t1
    WHERE
       t1.IDPerson NOT IN (
          SELECT t2.IDPerson FROM [Table 2] t2
       )

    I'd recommend against naming tables using spaces. -Jeff

    Database database help question

  • alarmist or legitimate?
    J Jeff Varszegi

    I agree. It'll have the end result of making people afraid to write a single line of code, for fear of exposing themselves to litigation. - Jeff

    The Lounge question

  • hmmm, scary..
    J Jeff Varszegi

    Interesting, no? There are actually a few fish that can do it. I believe that African lungfish (which you can order shipped in a cardboard box, cocooned in a dry mud shell) can walk on land and actually breathe air; they're kept as pets in the States. Didn't Muddy the Mudskipper walk on land in Ren and Stimpy? And I believe that certain gobies can walk and crawl over obstacles; I remember reading about a goby native to Hawaii that climbs up sheer waterfalls by forming a suction cup with its pectoral fins. Strange and cool. Back when I was a kid in the seventies and eighties, textbooks always mentioned the coelacanth, a deep-sea fish with fleshy pectoral fins resembling legs. It'd been thought extinct, but then one was caught by a fisherman. Scientists eagerly proclaimed it the missing link between fish and amphibians even though it was strictly a deep-water fish. Nowadays the prevailing wisdom is that the coelacanth never uses its "legs" to walk over anything, even in the depths; they're strictly for navigation. - Jeff

    The Lounge com question announcement

  • Passing data between forms
    J Jeff Varszegi

    Google on "Mediator pattern" and "MVC" (or "Model-View-Controller"). If you learn how to use these patterns, you'll never get stuck like this again; your code won't need tricks like passing a form to another form. I recommend "Design Patterns" by the Gang of Four. I'm not saying maysam's advice is bad, but as you construct more and more complicated GUIs, you'll find that it's harder and harder to deal with the complexity you create by hard-wiring things together. Design patterns are over-applied and otherwise screwed up by morons who haven't taken the time to really learn how to use them, which has given them a bad rap. In my experience, though, Mediator and MVC are the most important things to know when programming client-side rich GUI applications. Everything else is a little bit of learning involving threads that's easy to accomplish, and rote memorization of properties of controls and the like.

    C#

  • database location
    J Jeff Varszegi

    Try creating an ODBC data source, and then use the data source name in your connection string.

    Database question database help tutorial

  • database location
    J Jeff Varszegi

    Okay, I didn't notice that it was an unhandled exception. The first thing you need to do is wrap that section of code in a try-catch block so you can catch the exception! When an exception is "unhandled", that means that it's bubbled up to the top, causing your program to crash. You will do something like this:

    try {
       // ... your code that's throwing the exception; following is a line that throws one on purpose
       throw new ApplicationException("I'm a little teapot");
    } catch (Exception e) {
       Console.WriteLine(e.StackTrace);
    }

    You should read up on exception handling right away-- you're already past the "Hello, world!" stage, and into database applications, where you really need to be able to clean up your resources in case of a problem. Good luck.

    Database question database help tutorial

  • database location
    J Jeff Varszegi

    Please post the full stack trace. (You should always do this when you post a question; it'll speed things up a bit.)

    Database question database help tutorial

  • database location
    J Jeff Varszegi

    Does this work? What exception is thrown, if not?

    oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Password=\"\";User ID=Admin;Data Source=" + Environment.CurrentDirectory + "\\Technomedia.mdb;Mode=ReadWrite|Share Deny None;"

    Database question database help tutorial

  • TextBox: erasing the old lines
    J Jeff Varszegi

    Thanks! I mostly mean that I didn't take the time to think about synchronization issues, and I didn't spend the normal half hour agonizing over every parameter name, etc. :) I also didn't test whether it'd be faster just getting the text as a string, and calling IndexOf repeatedly to skip past the indicated number of new-lines in the string; that might be faster, but I didn't have the time.

    C# question

  • Halo 2
    J Jeff Varszegi

    Pretty sweet! Thanks for the link, although I'm still reeling from the use of the phrase "without further adieu" (shudder).

    The Lounge com game-dev collaboration question

  • 'Comparing' two strings.
    J Jeff Varszegi

    You're welcome!

    C# help

  • Estimated Time Left
    J Jeff Varszegi

    This one.

    C# tutorial

  • Debugging
    J Jeff Varszegi

    Also, is your build configuration set to 'Release' or 'Debug'?

    C# csharp

  • System.Environment.MachineName exception
    J Jeff Varszegi

    I have to leave work in just a couple of minutes, but if I don't see an answer posted for you later, I'll try it from home. So is your assembly signed, and if so, how?

    C# workspace csharp asp-net security help

  • TextBox: erasing the old lines
    J Jeff Varszegi

    I'm still not all that familiar with Windows Forms, although I've studied it. Can't you do something like this? (Warning: poorly-designed code)

    public static void RemoveTopLines(TextBox textBox, int linesToRemove) {
            if (textBox == null) {
                throw new ArgumentNullException();
            }
            else if (linesToRemove < 0) {
                throw new ArgumentException("Invalid line count (" + linesToRemove + ")");
            }
            string[] lines = textBox.Lines;
            int currentLineCount = lines.Length;
            int newLineCount = lines.Length - linesToRemove;
            if (newLineCount < 0) {
                newLineCount = 0;
            }
            string[] newLines = new string[newLineCount];
            if (newLineCount > 0) {
                Array.Copy(lines, linesToRemove, newLines, 0, newLineCount);
            }
            textBox.Lines = newLines;
        }

    C# question

  • System.Environment.MachineName exception
    J Jeff Varszegi

    That's what I meant. So did you use the configuration utility to check the permissions of your program's DLL? That's probably the one that doesn't have rights, not mscorlib.

    C# workspace csharp asp-net security help

  • Debugging
    J Jeff Varszegi

    As a test, hit F10. Do you see a "Locals" window pop up anywhere? If not, hit "Debug - Windows - Locals". Now what do you see?

    C# csharp

  • System.Environment.MachineName exception
    J Jeff Varszegi

    What are the permissions of the person running the program (your tester) on the machine?

    C# workspace csharp asp-net security help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups