Search Results

Search found 6 results on 1 pages for 'jimdaniel'.

Page 1/1 | 1 

  • Using SMO to call Database.ExecuteNonQuery() concurrently?

    - by JimDaniel
    I have been banging my head against the wall trying to figure out how I can run update scripts concurrently against multiple databases in a single SQL Server instance using SMO. Our environments have an ever-increasing number of databases which need updating, and iterating through one at a time is becoming a problem (too slow). From what I understand SMO does not support concurrent operations, and my tests have bore that out. There seems to be shared memory at the Server object level, for things like DataReader context, keeps throwing exceptions such as "reader is already open." I apologize for not having the exact exceptions I am getting. I will try to get them and update this post. I am no expert on SMO and just feeling my way through to be honest. Not really sure I am approaching it the right way, but it's something that has to be done, or our productivity will slow to a crawl. So how would you guys do something like this? Am I using the wrong technology with SMO? All I am wanting to do is execute sql scripts against databases in a single sql server instance in parallel. Thanks for any help you can give, Daniel

    Read the article

  • Help with porting thread functionality: Win32 --> .Net

    - by JimDaniel
    Hi, I am responsible for porting a class from legacy Win32 code to .Net and I have come across a threading model that I'm not sure how best to implement in .Net. Basically the Win32 has one worker thread, which calls WaitForMultipleObjects() and executes the particular piece of code when a particular object has been triggered. This has a sort of first-come-first-serve effect that I need to emulate in my own code. But I'm not sure how best to do this in .Net. Does anyone have any idea? I see that there is no equivalent of WaitForMultipleObjects() in .Net, only the ThreadPool class, which seems to provide most of what I need, but I'm not sure if it's the best, since I only have four objects total to wait and execute code for. Thanks, Daniel

    Read the article

  • Best practices about creating a generic object dictionary in C#? Is this bad?

    - by JimDaniel
    For clarity I am using C# 3.5/Asp.Net MVC 2 Here is what I have done: I wanted the ability to add/remove functionality to an object at run-time. So I simply added a generic object dictionary to my class like this: public Dictionary<int, object> Components { get; set; } Then I can add/remove any kind of .Net object into this dictionary at run-time. To insert an object I do something like this: var tag = new Tag(); myObject.Components.Add((int)Types.Components.Tag, tag); Then to retrieve I just do this: if(myObject.Components.ContainsKey((int)Types.Components.Tag)) { var tag = myObject.Components[(int)Types.Components.Tag] as Tag; if(tag != null) { //do stuff } } Somehow I feel sneaky doing this. It works okay, but I am wondering what you guys think about it as a best practice. Thanks for your input, Daniel

    Read the article

1