Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

A1C Stephen Collins vbrunner__ code monkey
  • looking for geeks in the tucson area

    hey guys!

    i haven't been on in about two years.  i'm a busy guy with the whole joining the air force, getting married, and becoming a dad thing.

    but now i'm finally settling down at my first duty station in tucson, az.  so if there's anyone out there from the area, drop me a line.  it will be great to finally get in touch with some real geeks for a change.

    looking forward to hearing from you!

    -sven

  • CLR Stored procs and INSERTs

    scott976 wrote:
    Okay vbrunner using a * as your delimeter is not any different than a comma.  I heard another way to do it is use ~ as your delimeter.


    how is that at all necessary?  i was only providing anecdotal evidence of that pattern in my company.  the relevant part of that comment was the "it's still a hack" part.

  • CLR Stored procs and INSERTs

    well that's hardly the ONLY way.  where i work one of thier methods is just a really long string split up into chunks the size of the field with a * at the end.  it works quite nicely, actually, but it's still a hack.

  • CLR Stored procs and INSERTs

    this thread provoked my question:
    also, i apologize if this is nothing but a demonstration of my newbie-ness in SQL...

    am i the only one that thinks a series of INSERT statements to submit many rows of data is a little insane?
    say i want to add 100 new authors to a table; i'd much rather call some sort of stored procedure to do this all in one fell swoop then to make 100 round trips to the DB.

    that's where CLR Stored Procs come in.  i've never tried them, but from what i know this will allow me to just pass a List<SomeObject> to the database to preform all the inserts right on the server, correct?

  • .NET 2.0 Win App Eror (EventType clr20r3)

    in that case my only suggestion is wrapping everything in Main(string[] args) with a try and see if anything is caught.  but if you're seeing the error i think you are it's occurring before Main is even called, so i'm sorry but beyond that i don't know.  where's littleguru when you need him?

  • is 'new ​object().​property' or 'new ​object().​method()' a good idea?

    ScanIAm wrote:
    Console.WriteLine(new String("Bob").Length);


    The part that concerns me is the accessing of the function 'Length' when you don't really know that the new String has actually been created.

    Of course you know that the new String has been created.  why would you not?  that's exactly what you are telling the compiler to do. consider:

    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                System.Console.WriteLine(new System.String('c', 10).Length);
            }
        }
    }



     here you are telling the runtime to create a new object of type String by calling the constructor with provided parameters, get the Length property, and pass a copy of it to the Console.WriteLine function.  from there it doesn't matter what happens to the String object because it is no longer needed; the WriteLine function has it's own copy (because it's a value type) of what we wanted, so no worries.

    am i right, guys?

  • .NET 2.0 Win App Eror (EventType clr20r3)

    my first suggestion is to make sure that .NET 2.0 is properly installed on the client machine.  many times stock XP machines are missing various dlls in the GAC if they have not touched the internet in a while.  Just run the setup.exe that is deployed with your ClickOnce deployment, then try it again.

    if that doesn't work, try one of the two following things:
    1. Create a Setup project that only installs all the detected dependencies of the project you are trying to deploy, but not the project output.  this will ensure that the GAC has all the neccessary assemblies for your application.
    2. Manually check the dependencies in both the GAC and the locations your application is loading them from.

    for all i know this could have nothing to do with missing assemblies, but that seems to be the  remedy when it happens to me.

  • Code to list dependancies of stored procs and/or tables?

    You may also want to try the Microsoft.SqlServer.Smo assembly/namespace.

  • Registry permissions troubles

    jasgrg wrote:
    Try

    RegistryKey key = Registry.LocalMachine.OpenSubKey(
        @"SOFTWARE\Microsoft\VSTAHostConfig", true);


    It opens the subkey as writeable.


    wow.  figures it would be something that simple.
    thanks.

  • C# array constructor & ​initializat​ion

    consider the following:

    namespace ConsoleApplication1
    {
        using System;
        class Program
        {
            static void Main(string[] args)
            {
                new MyClass();
                Console.ReadKey();
            }
        }
        class MyClass
        {
            public MyClass()
            {
                Console.WriteLine("Hello, World!");
            }
        }
    }


    it's completely insane to do such a thing, but as evildictator pointed out, the compiler has no idea at new MyClass(); what that side effects that constructor has.
    that's why new Object(); compiles and new Object[] { }; does not.
    MyClass[] { }; has to be put somewhere because the initialization of an array requires several steps and again, just does nothing.
    I suppose you could argue that new MyClass[] { new MyClass(), new MyClass() }; is valid because each constructor has a side effect, but before you can call those constructors you have to reserve some memory for the array, and since you did not specify where to store the pointer to that memory, it's just not allowed.