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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
C

codemunch

@codemunch
About
Posts
21
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • I hate SQL Server
    C codemunch

    Everything is still fine though kuz you did this on the Dev database and you still have the SQL Scripts to generate the DB so you can just revert...right? ;) I'm curious - Was it SQL Server itself that did this or part of SQL Enterprise Mangler's script generation?

    The Lounge database csharp sql-server wpf wcf

  • Error handling in sql 2000 trigger
    C codemunch

    Hello All, I've been googling and based on many articles I belive what I'm asking of sql2000 triggers is not possible for the particular type of error i'm getting. I am trying to integrate with an existing application on sql 2000 without affecting it's behaviour. When it inserts/updates/deletes in a few tables I need to perform an I/U/D in a sql 2005 DB through a DB link. This is all set up fine, as well as the trigger to do the insert. I need to be able to put error handling in the trigger so that it does not affect I/U/D of the existing product. Right now, MSDTC is having a fit because I don't have it configured properly on purpose. I did configure it correctly and then reverted so it would raise errors so I could test error handling. Nothing I've tried so far will let me handle this error in an insert trigger on sql 2000:

    Server: Msg 7391, Level 16, State 1, Line 2
    The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction. OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator.

    Execution stops immediately so I can't even get to an "IF @@ERROR" statement and the transaction is rolled back. I know how to fix this error but I need to be able to handle this type of error so I can use xp_logevent or something similar to monitor. Is it possible - Any ideas? Does anyone know of a way in sql 2000 to handle this type of error in a trigger on sql 2000?

    Database database help com sysadmin tutorial

  • Seeking recomendations for a .net task scheduler/timer class
    C codemunch

    Hello All, I've been googling and searching codeproject for that "perfect" fit for my situation. I need to build a task scheduling service and I'm seeking a timer/scheduler class (to purchase or scavenge) which provides scheduling functionality such as SQL Agent (MSSQL Server) that will call a method in one of my classes (I would expect to implement an interface provided by the scheduler) or raise an event that I can subscribe to. This magical class needs to store/retrieve it's scheduling information from an XML/ini file (not DB). Ideally I'm looking for something I can just drop in and run with. Dealing with ticks & math (i.e. the .Net timers) is lower level than I want to go. I could build one myself out of those but would rather leave the math and "gotcha's" to something robust/hardened so I don't have to go there and work through the mistakes someone else has already fixed. There are several articles on codeproject I've gone through: A component for event scheduling inside an application[^] SQL Agent: A Job Scheduler Framework[^] Time scheduler in C#[^] .NET Scheduled Timer[^] Guadagno Task Scheduler[^] C# Scheduler[^] (and more) that i could use as examples and/or scavenge but this is one part I don't want to be troubleshooting/fixing issues. Several of these projects have posted bugfixes/etc... but seem like there are on or two (or more) oustanding items in each so I don't want to commit the time to scavenging something together to have issues there

    IT & Infrastructure

  • strange sum
    C codemunch

    I know it's not C++, but if it's any consolation, VS 2008 w/ C# and .net 3.5 says c == 21

    Clever Code c++ csharp visual-studio question

  • Crystal Reports and Images
    C codemunch

    If you embed the image in the report from a bmp on the file system, it gets embedded into the RPT file and is not referenced from the file system again. Storing files (images) in the DB sucks, but you can put the img in the database and have it show up on the report. When the db image changes, the report image changes and you would get the behaviour you want.

    Visual Basic question help

  • 1086 + 68 = 0? [modified]
    C codemunch

    'SINV, SCRN' vs 'SINV', 'SCRN'

    Clever Code question

  • Sirius satelite radio - any other converts?
    C codemunch

    Well, I bought this for me for my wife's birthday....which is in mid-April. :-D

    5yrs?? You are an extremely patient man but you may want to retire the hint and bring out the cluestick!

    The Lounge help question announcement learning

  • Sirius satelite radio - any other converts?
    C codemunch

    Not until I rented a vehicle earlier this week (Tuesday) due to my main vehicle having a malfunction and having to go into the shop (Dear GM: Your spare tire winch is the FAIL) did I experience Satelite Radio. The rental was a Grand Prix with XM Radio & i'm shocked but it was actually quite good and I've become hooked. For years, I've been a skeptic and pooh-poo'd the idea of paying for radio - that's just crazy talk! But sadly, I've really become bored with our local stations and my MP3 collection is stagnant. So, I broke down & got a Sirius receiver (based on a co-worker's recomendation) and I was instantly addicted. "They" have a huge selection of music (without commercials) & stuff I hadn't heard before (and never would have had the chance to collect) that I find refreshing (of course...kuz it's new) in addition to the comedy channels and BBC news & whatnot. The comedy channels do have some advertising unfortunately. I haven't heard any music repeats so far and it's all been pretty good and much better than our local (Calgary) free radio offerings (and I can still get CBC with it in addition to BBC). I did hear some comedy stuff on a Sirius channel that I had heard earlier on one of the XM channels. My main annoyance of satelite radio is the problem with signal. Indoor signal reception is impossible. You can get a signal near some windows although you're likely in for many breakups. However, in my employers building (a country hotel converted to office) I've managed to string enough cable out a door to get constant reception without providing too much of a hazard to my fellow peons. Anyway, So far I'm lovin' Sirius satelite radio and wish I would have experienced it sooner. Now that I've finally committed $$$ to it, I really hope they don't fold!

    The Lounge help question announcement learning

  • if I don't exist OR ....
    C codemunch

    Found this C# beauty in 3 places in a particular class i'm updating. if (this == null || ..... { // assigned values to self } I'm guessing the person that wrote that was going to be checking a field to see if it was null but none of the assignment code within the {} indicates what that might have been.

    The Weird and The Wonderful csharp

  • Challenging Crystal Reports / .NET Windows application question
    C codemunch

    Oh I see - yeah, that's too bad - that's our current situation too - forced to use the DSN way due to the reports being developed that way. I'm too lazy to look into it, but perhaps with the Developer edition of CR someone could modify the data source part on the fly and convert it to accept data through a typed set instead of DSN's.

    Visual Basic database question csharp sql-server

  • Challenging Crystal Reports / .NET Windows application question
    C codemunch

    You can create a typed dataset, get the data yourself via ADO.net and then supply the report with the loaded type dataset and then you don't need a DSN for Crystal. A developer I work with has used this technique in the past. I haven't tried it yet. http://support.microsoft.com/kb/320714 http://www.gridviewguy.com/ArticleDetails.aspx?articleID=201\_Creating\_Crystal\_Reports\_Using\_Typed\_DataSet

    Visual Basic database question csharp sql-server

  • All methods called when class instantiated?
    C codemunch

    Are you running in release mode through the IDE? i.e. debugging the release mode? Is the "AddParameter" in your watch window? If so, remove it. In fact, remove everything from your watch window and DON'T use the mouseover in the debugger to see the public property value either. It will cause the code in the property to run and breakpoints will be ignored.

    C# csharp help question

  • All methods called when class instantiated?
    C codemunch

    A former co-worker got stung with that one :) LOL...I had a good laugh. He was getting quite pissed off and swearing at these properties because they were getting called before running code that accessed them. I looked down at his watch window & had a big fat laugh. Anyway, To the poster: If you've added these properties to the watch window OR if you even mouse over them while debugging, the code inside will be executed by the debugger WITHOUT stopping at your breakpoints inside the get/set.

    C# csharp help question

  • Bool expression??
    C codemunch

    Well, the example wasn't too detailed but as-is it took OOP and bastardized it into a function library (PersonFacade) + simple data structures (Person). You do want your persistance layer (data) to be separate but working at the business layer (often from a different class) and calling data layer specific persistance methods is ugly not to mention a pain in the ass to manage. A much cleaner solution is to have a Save() method (and depending on your scheme, a Delete()method) which then passes itself to a data layer so in your business & UI logic you don't need to call data layer specific methods residing in a completely different class. The business object takes care of itself and your code is better organized. The data layer could look like the "facade" thing or could be a smarter all-encompasing gate keeper.

    The Weird and The Wonderful csharp linq functional question

  • Bool expression??
    C codemunch

    It IS that horrible when you join a project and the other "experienced" consultant is writing a pile of redundant crap like that: if(x == true) { control.Enabled = true; } else { control.Enabled = false; } The above adds an extra comparison operation in addition to being ugly. Besides, as someone already mentioned, How will the juniors ever progress? Forgiveable for the OP though :) The project i joined has a metric buttload of that garbage. Even worse is these guys "architected" classes without methods (can you say pre-OOP structures boys & girls?) and then created a function library (which they called a "fascade" and is NOTHING like the fascade design pattern) where you pass in an instance of this methodless "class" to the method of a fascade class to do work on it (i.e. persist it). The reasoning? They thought adding methods to the class would make it too slow. It has been a rollercoaster of emoticons. :omg: :wtf: :mad: :sigh: :(( :rolleyes: e.g. class Person { public string FirstName; public string LastName; } class PersonFascade { public void InsertPerson(Person p) { /* do stuff */ } public void UpdatePerson(Person p) { /* do stuff */ } public void DeletePerson(Person p) { /* do stuff */ } }

    The Weird and The Wonderful csharp linq functional question

  • DataView - GetEnumerator
    C codemunch

    lol, you are supposed to ignore using break/return completely so you have something to optimize later: Check out "The Speedup loop" http://thedailywtf.com/Articles/The-Speedup-Loop.aspx I could never bring myself to intentionally build a "speedup loop".

    The Weird and The Wonderful data-structures question

  • $1 WILL buy you a cup of coffee
    C codemunch

    whooohoo - i'm not alone. The beans smell really good and are tasty when covered in chocolate but if I were to imagine what little old ladies feet taste like, that's what a cup of coffee would be. X|

    The Lounge com

  • Web or client development?
    C codemunch

    I'm wondering whether it's a good idea to jump onto the "web bandwagon" and get and insight into web development

    Nah, this web thing is just a fad - don't waste your time.

    On an unrelated note, do you have a link to these job offers? :-D

    The Lounge csharp java c++ javascript php

  • Exceptions
    C codemunch

    The original OP wanted to throw their own custom exception...Personally, I prefer to call them all "ABone" and let future maintenance developers sort it out :D EDIT: Or even "AFrikinBone" if you like sharks with lasers...

    C#

  • Exceptions
    C codemunch

    public static bool TryParse(string s, out int result); Int32 myint; if(!Int32.TryParse(",", out myint)) throw new YourCustomException(); return myint;

    C#
  • Login

  • Don't have an account? Register

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