From Gustav at cactus.dk Tue Jul 6 04:54:07 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 Jul 2010 11:54:07 +0200 Subject: [dba-VB] Silverlight PivotViewer Message-ID: Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav From shamil at smsconsulting.spb.ru Tue Jul 6 05:17:49 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Jul 2010 14:17:49 +0400 Subject: [dba-VB] Silverlight PivotViewer In-Reply-To: References: Message-ID: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jul 6 18:25:11 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 7 Jul 2010 09:25:11 +1000 Subject: [dba-VB] Silverlight PivotViewer References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Jul 6 23:45:52 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Jul 2010 08:45:52 +0400 Subject: [dba-VB] Silverlight PivotViewer In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: Hi Michael -- Thank you for sharing your experience with AJAX controls - do you mean controls from "ASP.NET AJAX Control Toolkit"? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Jul 7 01:35:32 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 7 Jul 2010 16:35:32 +1000 Subject: [dba-VB] Silverlight PivotViewer References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant><59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5C9D@ddi-01.DDI.local> Yes, that's them. Can't argue with the price... Cheers Michael Hi Michael -- Thank you for sharing your experience with AJAX controls - do you mean controls from "ASP.NET AJAX Control Toolkit"? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Jul 7 10:36:58 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Jul 2010 17:36:58 +0200 Subject: [dba-VB] Silverlight for Symbian Message-ID: Hi all This was new to me: http://www.silverlight.net/getstarted/devices/symbian/ Silverlight, a cross-browser, cross-platform implementation of the .NET Framework for building media experiences and rich interactive applications for the Web on desktop computers, is also available for Nokia S60 5th Edition devices such as Nokia 5800 XpressMusic, Nokia N97 and Nokia N97 Mini. /gustav From accessd at shaw.ca Wed Jul 7 19:37:36 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 7 Jul 2010 17:37:36 -0700 Subject: [dba-VB] Microsoft is supporting HTML 5 via their now F# In-Reply-To: References: Message-ID: HTML 5 has another friend... http://blogs.msdn.com/b/dsyme/archive/2010/06/04/html5-programming-with-f.as px Jim From jwcolby at colbyconsulting.com Fri Jul 9 14:06:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Jul 2010 15:06:48 -0400 Subject: [dba-VB] Suddenly I can see Message-ID: <4C377348.9030103@colbyconsulting.com> I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am building. The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat little light pipe system to display the power and activity on each disk. The disk sleds plug in to a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic light pipes along the side of the sled which pipes the light to the front so it can be seen. Really cool I thought. What this means to me is that for the first time I can actually see which disks are in use. The server "lights up like a Christmas tree" when stuff is actually written to disk. I am now able to actually compare the screen as I run processes, and watch the lights and I'm here to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a burst of disk activity a half second long, then many seconds of crunching, then a half second of disk activity. -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Fri Jul 9 16:40:45 2010 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 09 Jul 2010 23:40:45 +0200 Subject: [dba-VB] Suddenly I can see Message-ID: Hi John Links please? How noisy is this beauty? /gustav >>> jwcolby at colbyconsulting.com 09-07-2010 21:06 >>> I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am building. The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat little light pipe system to display the power and activity on each disk. The disk sleds plug in to a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic light pipes along the side of the sled which pipes the light to the front so it can be seen. Really cool I thought. What this means to me is that for the first time I can actually see which disks are in use. The server "lights up like a Christmas tree" when stuff is actually written to disk. I am now able to actually compare the screen as I run processes, and watch the lights and I'm here to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a burst of disk activity a half second long, then many seconds of crunching, then a half second of disk activity. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 9 17:53:34 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Jul 2010 18:53:34 -0400 Subject: [dba-VB] Suddenly I can see In-Reply-To: References: Message-ID: <4C37A86E.6000200@colbyconsulting.com> Sorry, I thought I did. http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Links please? > How noisy is this beauty? > > /gustav > > >>>> jwcolby at colbyconsulting.com 09-07-2010 21:06 >>> > I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am > building. > > The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat > little light pipe system to display the power and activity on each disk. The disk sleds plug in to > a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic > light pipes along the side of the sled which pipes the light to the front so it can be seen. Really > cool I thought. > > What this means to me is that for the first time I can actually see which disks are in use. The > server "lights up like a Christmas tree" when stuff is actually written to disk. > > I am now able to actually compare the screen as I run processes, and watch the lights and I'm here > to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a > burst of disk activity a half second long, then many seconds of crunching, then a half second of > disk activity. > From shamil at smsconsulting.spb.ru Sat Jul 10 05:18:10 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Jul 2010 14:18:10 +0400 Subject: [dba-VB] AJAX Control Toolkit - Was: RE: Silverlight PivotViewer In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: <33E3D90D14B54B94BB495B3F1BCF1B8C@nant> Hi All -- FYI: (if you do not have that info yet) I have just downloaded and played with AJAX Control Toolkit http://www.asp.net/ajaxlibrary/act.ashx - and it worked very well for me - all 40 controls - the download from CodePlex has a sample ASP.NET project with all that controls: downloading, setting-up and quick playing with AJAX Control Toolkit samples within VS2008 SP1 took less than an hour - everything did work well as described/expected... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sun Jul 11 08:19:46 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 11 Jul 2010 17:19:46 +0400 Subject: [dba-VB] OT: XP, SCRUM etc. - Sunday watch: "Kent Beck: Ease at Work..." Message-ID: Hi All -- I'm watching now Kent Beck's "Ease at Work..." year 2006 recorded webinar, and I like it, so I decided to share its link with you: http://video.google.com/videoplay?docid=7830246530742207581# Kent Beck is "thinking aloud" about a broad set of issues: When was the last time you were comfortable in your "skin" as a programmer ? When was the last time you were comfortable in your "skin" as a programmer *at work* ? Why should I to "turn off" parts of myself to work here? Something is profoundly wrong with a workplace? Something is missing in my personal worldview? Why should I do "magical things" to feel OK as a programmer? Why should I sacrifice myself to the "altar" of technological progress? Why the sense of "ease and comfort" isn't the part of my everyday work as a programmer? ... Thank you. -- Shamil From jwcolby at colbyconsulting.com Tue Jul 13 15:35:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Jul 2010 16:35:33 -0400 Subject: [dba-VB] Access source control Message-ID: <4C3CCE15.6090200@colbyconsulting.com> I am wondering whether we could put together subversion and Access to do source control. Max's eatbloat will export and import most things Access into a directory structure. Subversion could be used to move that stuff into version control. Once in subversion, we might be able to do differencing etc. Whaddayathink? -- John W. Colby www.ColbyConsulting.com From paul.hartland at googlemail.com Thu Jul 15 06:02:19 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 15 Jul 2010 12:02:19 +0100 Subject: [dba-VB] Using VBTablet.dll With vb.net Message-ID: To all, I have a wacom signature tablet, and we have a piece of code that allows our employees to make digital signatures, but dont seem to be able to get it working. The application looks for a flag file (just empty text file called Update.flg) and if it doesn't exist the application runs a bat file copying & registering the VBTablet.dll and WinTab32.dll into their windows\system32 directory, then asks the user to close the application and re-run it. However when anyone tried to run it, they get the message that no tablet devices are detected on the system. I have been working with our helpdesk, using clean laptop images and still cant get it to work for some reason. Has anyone out their had experience of using the VBTablet.dll with a vb.net application, if so could you give me some pointers on what I may be doing wrong etc. Thanks in advance for any help on this, as it is becoming a real headache. -- Paul Hartland paul.hartland at googlemail.com From dw-murphy at cox.net Thu Jul 15 13:23:37 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 15 Jul 2010 11:23:37 -0700 Subject: [dba-VB] Using VBTablet.dll With vb.net In-Reply-To: References: Message-ID: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> Paul, A tablet running Windows tablet PC have the dll's installed natively. There are lots of examples of using the ImageEdit and ImagePicture controls on the internet. In fact if you download the TabletPC SDK there are many examples of using it with .NET apps. Have not heard of the .flg file, it must have something to do with the application installer. For a start look at http://msdn2.microsoft.com/en-us/library/aa813329.aspx. I know this doesn't answer your question, but it may give you a leed on where to look. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Thursday, July 15, 2010 4:02 AM To: VisualBasicList Subject: [dba-VB] Using VBTablet.dll With vb.net To all, I have a wacom signature tablet, and we have a piece of code that allows our employees to make digital signatures, but dont seem to be able to get it working. The application looks for a flag file (just empty text file called Update.flg) and if it doesn't exist the application runs a bat file copying & registering the VBTablet.dll and WinTab32.dll into their windows\system32 directory, then asks the user to close the application and re-run it. However when anyone tried to run it, they get the message that no tablet devices are detected on the system. I have been working with our helpdesk, using clean laptop images and still cant get it to work for some reason. Has anyone out their had experience of using the VBTablet.dll with a vb.net application, if so could you give me some pointers on what I may be doing wrong etc. Thanks in advance for any help on this, as it is becoming a real headache. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From paul.hartland at googlemail.com Fri Jul 16 02:44:54 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 16 Jul 2010 08:44:54 +0100 Subject: [dba-VB] Using VBTablet.dll With vb.net In-Reply-To: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> References: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> Message-ID: Thanks Doug, any help is very much appreciated, it also gave me a couple more different ideas. On 15 July 2010 19:23, Doug Murphy wrote: > Paul, > > A tablet running Windows tablet PC have the dll's installed natively. There > are lots of examples of using the ImageEdit and ImagePicture controls on > the > internet. In fact if you download the TabletPC SDK there are many examples > of using it with .NET apps. Have not heard of the .flg file, it must have > something to do with the application installer. For a start look at > http://msdn2.microsoft.com/en-us/library/aa813329.aspx. I know this > doesn't > answer your question, but it may give you a leed on where to look. > > Doug > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland > Sent: Thursday, July 15, 2010 4:02 AM > To: VisualBasicList > Subject: [dba-VB] Using VBTablet.dll With vb.net > > To all, > > I have a wacom signature tablet, and we have a piece of code that allows > our > employees to make digital signatures, but dont seem to be able to get it > working. > > The application looks for a flag file (just empty text file called > Update.flg) and if it doesn't exist the application runs a bat file copying > & registering the VBTablet.dll and WinTab32.dll into their windows\system32 > directory, then asks the user to close the application and re-run it. > > However when anyone tried to run it, they get the message that no tablet > devices are detected on the system. > > I have been working with our helpdesk, using clean laptop images and still > cant get it to work for some reason. Has anyone out their had experience > of > using the VBTablet.dll with a vb.net application, if so could you give me > some pointers on what I may be doing wrong etc. > > Thanks in advance for any help on this, as it is becoming a real headache. > > -- > Paul Hartland > paul.hartland at googlemail.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From shamil at smsconsulting.spb.ru Sat Jul 17 05:19:48 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 17 Jul 2010 14:19:48 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers Message-ID: Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil From dw-murphy at cox.net Sat Jul 17 13:19:49 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Sat, 17 Jul 2010 11:19:49 -0700 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 17 17:46:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 17 Jul 2010 18:46:33 -0400 Subject: [dba-VB] =?windows-1252?q?Google=92s_Disk_Failure_Experience?= Message-ID: <4C4232C9.9090608@colbyconsulting.com> http://storagemojo.com/2007/02/19/googles-disk-failure-experience/ I had seen this before but it is an interesting read. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 17 22:31:28 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 17 Jul 2010 23:31:28 -0400 Subject: [dba-VB] FAQ: What is MTBF? Message-ID: <4C427590.2000303@colbyconsulting.com> http://www.t-cubed.com/faq_mtbf.htm -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 17 23:01:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 18 Jul 2010 00:01:36 -0400 Subject: [dba-VB] disk drive temps for the Norco 4020 Message-ID: <4C427CA0.4040400@colbyconsulting.com> I bought the Norco 4020 to build a server with. http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product I am impressed with the case, though it is consumer grade. It is tough to work with however. It has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and the disk backplanes. Obviously it is impossible to leave the wall in place and get all of the cables in, but removing the fan wall is a job for a safe cracker. None the less I did so, got 20 disks in and cabled up, then reinserted the fan wall, and then threaded the cables through the holes in the BOTTOM of the fan wall. Why on earth they didn't leave the holes on the top of the fan wall is beyond me but they didn't. Anyway, for the first time tonight I tested temps with all 20 drives inserted and power applied, and the fan wall operating. I ran a defrag on every volume simultaneously in order to cause the disks to work and generate as much heat as I could cause. Below are the temps. CPU Temperature 55 ?C Ctrl Temperature 49 ?C Power +12V 12.099 V Power +5V 5.053 V Power +3.3V 3.328 V SATA PHY +2.5V 2.528 V DDR-II +1.8V 1.872 V PCI-E +1.8V 1.872 V CPU +1.8V 1.856 V CPU +1.2V 1.232 V DDR-II +0.9V 0.928 V Hdd#1 Temperature 37 ?C Hdd#2 Temperature 40 ?C Hdd#3 Temperature 42 ?C Hdd#4 Temperature 39 ?C Hdd#5 Temperature 47 ?C Hdd#6 Temperature 51 ?C Hdd#7 Temperature 49 ?C Hdd#8 Temperature 46 ?C Hdd#9 Temperature 37 ?C Hdd#10 Temperature 49 ?C Hdd#11 Temperature 44 ?C Hdd#12 Temperature 47 ?C Hdd#13 Temperature 45 ?C Hdd#14 Temperature 50 ?C Hdd#15 Temperature 49 ?C Hdd#16 Temperature 42 ?C There are only 16 drives showing because these 16 are cabled up to my Areca raid co-processor card which is a 16 port card, and that card provides a utility to watch these numbers. The other disks are not being driven but do have power applied. I am satisfied with the temps. Several disks actually hit 53 degrees C under max stress but that is acceptable to me. I would like lower temps but I can live with these. BTW I am using the Corsair 750W modular PS which is a NICE PS. http://www.newegg.com/Product/Product.aspx?Item=N82E16817139010 The 12V cables are ribbon cables which makes them very easy to run and minimizes the air flow impedance. With only 2 inches to work with between the fans and disks, I need all the help I can get. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sun Jul 18 02:30:34 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 18 Jul 2010 11:30:34 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Message-ID: Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From garykjos at gmail.com Sun Jul 18 10:09:29 2010 From: garykjos at gmail.com (Gary Kjos) Date: Sun, 18 Jul 2010 10:09:29 -0500 Subject: [dba-VB] [dba-SQLServer] disk drive temps for the Norco 4020 In-Reply-To: <4C427CA0.4040400@colbyconsulting.com> References: <4C427CA0.4040400@colbyconsulting.com> Message-ID: I was reading some of the reviews posted on the Newegg site when you first posted the link to your new server case and it seemed like other people who purchased it were concerned about the heat the disks would be creating due to lack of space between the drives etc. Nice that you can monitor them. Continued good luck with your new server. GK On Sat, Jul 17, 2010 at 11:01 PM, jwcolby wrote: > I bought the Norco 4020 to build a server with. > > http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product > > I am impressed with the case, though it is consumer grade. ?It is tough to work with however. ?It > has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and > the disk backplanes. ?Obviously it is impossible to leave the wall in place and get all of the > cables in, but removing the fan wall is a job for a safe cracker. > > -- Gary Kjos garykjos at gmail.com From jwcolby at colbyconsulting.com Sun Jul 18 10:21:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 18 Jul 2010 11:21:39 -0400 Subject: [dba-VB] [dba-SQLServer] disk drive temps for the Norco 4020 In-Reply-To: References: <4C427CA0.4040400@colbyconsulting.com> Message-ID: <4C431C03.7020503@colbyconsulting.com> Yea, I am one of those concerned. The bottom of the drive sled touches the top of the drive underneath it. Not a lot of room for drawing air through the drive area. One of the things that people are doing (me included) is to duct tape the holes on the bottom of the fan wall to prevent air from circulating in a big circle, and force the maximum air possible to be pulled through the front past the disks. Other than that I am loving the case. It is easy to find cases for lots of disks... if you don't mind paying $2000. I don't have that kind of money so this case is one alternative. If anyone else knows of lost cost cases like this speak up. John W. Colby www.ColbyConsulting.com Gary Kjos wrote: > I was reading some of the reviews posted on the Newegg site when you > first posted the link to your new server case and it seemed like other > people who purchased it were concerned about the heat the disks would > be creating due to lack of space between the drives etc. Nice that you > can monitor them. > > Continued good luck with your new server. > > GK > > On Sat, Jul 17, 2010 at 11:01 PM, jwcolby wrote: >> I bought the Norco 4020 to build a server with. >> >> http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product >> >> I am impressed with the case, though it is consumer grade. It is tough to work with however. It >> has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and >> the disk backplanes. Obviously it is impossible to leave the wall in place and get all of the >> cables in, but removing the fan wall is a job for a safe cracker. >> >> > From dw-murphy at cox.net Sun Jul 18 19:49:45 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Sun, 18 Jul 2010 17:49:45 -0700 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Message-ID: <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> Hello Shamil, It costs nothing to send through the web interface portal numbers. Each provider has a portal. You can not recieve with this method though. If you want to send and recieve possibly the best thing would be a cellular modem and a cheap cell plan for it. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, July 18, 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Jul 19 06:46:32 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 19 Jul 2010 15:46:32 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> Message-ID: <74D815DD703B45F8B957DE8C558934B6@nant> Thank you, Doug, Cellular modems can't be used there - just plain simple mobile phones to send a short SMS message once a day... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, July 19, 2010 4:50 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, It costs nothing to send through the web interface portal numbers. Each provider has a portal. You can not recieve with this method though. If you want to send and recieve possibly the best thing would be a cellular modem and a cheap cell plan for it. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, July 18, 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 19 22:32:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 19 Jul 2010 23:32:44 -0400 Subject: [dba-VB] SCO/Novell suit is over, SCO loses Message-ID: <4C4518DC.9090305@colbyconsulting.com> http://www.crunchgear.com/2010/06/11/sconovell-suit-is-over-sco-loses/ -- John W. Colby www.ColbyConsulting.com From accessd at shaw.ca Tue Jul 20 00:13:55 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 19 Jul 2010 22:13:55 -0700 Subject: [dba-VB] SCO/Novell suit is over, SCO loses In-Reply-To: <4C4518DC.9090305@colbyconsulting.com> References: <4C4518DC.9090305@colbyconsulting.com> Message-ID: That is truly sad. At one time it was the best UNIX Company out there. I was even a certified installers and reseller and made a good coin with their products. The trouble with the UNIX market is that they were all a bunch of warring camps and they were too busy fighting each other while a small company like Microsoft slide out of nowhere and effectively wiped them all out. It did not matter to anyone that UNIX was a superior operating system, it was always much more important to have a good user friendly interface. Presentation has always been more important than functionality. After the great UNIX wars, the intransient companies continued fighting until their own oblivion and to make themselves little more than a foot note in history. You have to go no further your dictionary and look up the word intransient and you will find the SCO icon clearly displayed. UNIX still exists in the mini and main frame but little else. Microsoft did not even fire a shot and watched their only challengers wipe them selves out. But before Microsoft could claim complete world dominance another flavour of UNIX or Linux appeared; stable, powerful and free. Microsoft has claimed that Linux is the single greatest threat to free enterprise system and maybe it is. Fifteen years later and now Microsoft is watching its empire slowly eroding. Its competitors are using a flavour of Linux UNIX like Mac, using Linux to control the internet like Google or moving to their own desktop, like Ubuntu. Will Linux ever dominate the market? No; but neither or ever again will Microsoft. Some say that Linux is not ready for prime time but when your 10 or 12 year old son or daughter can easily install it, the old fears are just that; old fears. SCO Unix on the other hand is an old and dying product, the epitome and poster boy of the UNIX wars. The only SCO I think of now is the producer of a very fine brand of non alcoholic ginger beer of which I would highly recommend to anyone. For you Unix buffs who want to see the turbulent UNIX/Linux world check out the following: http://www.quicklycode.com/wp-content/files/unix_history.png Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 19, 2010 8:33 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] SCO/Novell suit is over, SCO loses http://www.crunchgear.com/2010/06/11/sconovell-suit-is-over-sco-loses/ -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 20 13:28:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 14:28:55 -0400 Subject: [dba-VB] Has anyone used this? Message-ID: <4C45EAE7.4050203@colbyconsulting.com> http://www.dofactory.com/Framework/Framework.aspx -- John W. Colby www.ColbyConsulting.com From ha at phulse.com Tue Jul 20 13:53:50 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Tue, 20 Jul 2010 19:53:50 +0100 Subject: [dba-VB] Has anyone used this? In-Reply-To: <4C45EAE7.4050203@colbyconsulting.com> References: <4C45EAE7.4050203@colbyconsulting.com> Message-ID: This is a joke, right? Hans-Christian Web Application Development, London, UK e: hans.andersen at phulse.com t: +44 (0)782 894 5456 w: http://nokenode.com l: http://uk.linkedin.com/in/andersenhc ------------------------------------------------------ Unique Gifts, Collectables, Artwork ------------------------------------------------------ Come one Come all to www.corinnajasmine.com ------------------------------------------------------ On 20 July 2010 19:28, jwcolby wrote: > http://www.dofactory.com/Framework/Framework.aspx > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jul 20 14:16:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 15:16:48 -0400 Subject: [dba-VB] C# Sysvars Message-ID: <4C45F620.6010807@colbyconsulting.com> In Access I had a system for handling what I call SysVars, which are program global variables, stored in a table, cached as the program opens. SysVar VarID - Int - surrogate key VarName - Str - name of the variable VarVal - Str - Value of the variable VarDescr - Str - description of how the variable is used VarRefresh - Bool - needs to be refreshed before use. This essentially replaces what many developers use, a single record in a table where you add a new field every time you need a new variable (yuk). Just as an example... I have an asynchronous process where I: 1) Send 2 million record chunks of data to files on disk. 2) Ship the chunk files over to a VM input directory for processing 3) Process each file, placing the processed result files in an output directory. 4) Watch the output directory for processed files and ship back to the server 5) Import the chunks back in to SQL Server. The problem is that step 3 takes about 1 hour per file. If I run this process on a large table I can export 30 files to the VM which translates into 30 hours before it finishes processing. If I get a rush order, I need to delete the files in the VM so that they are not clogging up the works and not automatically send those files back to the VM until I say so. I have a SysVar called VMHold which is a true / false, true if hold files going to the vm and false if not. I can set / reset this sysvar through a sysvars class, and it reads / writes the value to the sql server tlbSysVars, caching them in memory as the program opens, refreshing them before use ONLY if the varRefresh is true. That is what I call SysVars and how / why I use them. It seems like everyone would use these for any moderately complex asynchronous or multi-user program. I am looking for feedback on how others implement this functionality. I will write a second email regarding some of the issues I am running into. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 20 14:18:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 15:18:09 -0400 Subject: [dba-VB] Has anyone used this? In-Reply-To: References: <4C45EAE7.4050203@colbyconsulting.com> Message-ID: <4C45F671.5050505@colbyconsulting.com> LOL, they don't think so. Am I missing something? John W. Colby www.ColbyConsulting.com Hans-Christian Andersen wrote: > This is a joke, right? > > Hans-Christian > Web Application Development, London, UK > > e: hans.andersen at phulse.com > t: +44 (0)782 894 5456 > w: http://nokenode.com > l: http://uk.linkedin.com/in/andersenhc > > ------------------------------------------------------ > Unique Gifts, Collectables, Artwork > ------------------------------------------------------ > Come one > Come all to > www.corinnajasmine.com > ------------------------------------------------------ > > > > On 20 July 2010 19:28, jwcolby wrote: > >> http://www.dofactory.com/Framework/Framework.aspx >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From ha at phulse.com Tue Jul 20 16:00:52 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Tue, 20 Jul 2010 22:00:52 +0100 Subject: [dba-VB] Has anyone used this? In-Reply-To: <4C45F671.5050505@colbyconsulting.com> References: <4C45EAE7.4050203@colbyconsulting.com> <4C45F671.5050505@colbyconsulting.com> Message-ID: Perhaps I am the one missing something, but it seems to me that they are selling their code as if it were plug-able modules, when, in reality, design patterns are concepts. Concepts you need to understand before you can use them, in which case, you should be able to write them yourself. Just feels a bit snake oil-ish to me. But that could just be their marketing department advertising it wrong. Hans-Christian Web Application Development, London, UK e: hans.andersen at phulse.com t: +44 (0)782 894 5456 w: http://nokenode.com l: http://uk.linkedin.com/in/andersenhc ------------------------------------------------------ Unique Gifts, Collectables, Artwork ------------------------------------------------------ Come one Come all to www.corinnajasmine.com ------------------------------------------------------ On 20 July 2010 20:18, jwcolby wrote: > LOL, they don't think so. > > Am I missing something? > > John W. Colby > www.ColbyConsulting.com > > > Hans-Christian Andersen wrote: > > This is a joke, right? > > > > Hans-Christian > > Web Application Development, London, UK > > > > e: hans.andersen at phulse.com > > t: +44 (0)782 894 5456 > > w: http://nokenode.com > > l: http://uk.linkedin.com/in/andersenhc > > > > ------------------------------------------------------ > > Unique Gifts, Collectables, Artwork > > ------------------------------------------------------ > > Come one > > Come all to > > www.corinnajasmine.com > > ------------------------------------------------------ > > > > > > > > On 20 July 2010 19:28, jwcolby wrote: > > > >> http://www.dofactory.com/Framework/Framework.aspx > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jul 20 18:10:35 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 19:10:35 -0400 Subject: [dba-VB] Has anyone used this? In-Reply-To: References: <4C45EAE7.4050203@colbyconsulting.com> <4C45F671.5050505@colbyconsulting.com> Message-ID: <4C462CEB.6080305@colbyconsulting.com> >when, in reality, design patterns are concepts. Concepts you need to understand before you can use them in which case, you should be able to write them yourself. I can understand SQL Server but I don't want to write a database. >Just feels a bit snake oil-ish to me. But that could just be their marketing department advertising it wrong. And so I ask... is anyone actually using this... John W. Colby www.ColbyConsulting.com Hans-Christian Andersen wrote: > Perhaps I am the one missing something, but it seems to me that they are > selling their code as if it were plug-able modules, when, in reality, design > patterns are concepts. Concepts you need to understand before you can use > them, in which case, you should be able to write them yourself. Just feels a > bit snake oil-ish to me. But that could just be their marketing department > advertising it wrong. > > > Hans-Christian > Web Application Development, London, UK > > e: hans.andersen at phulse.com > t: +44 (0)782 894 5456 > w: http://nokenode.com > l: http://uk.linkedin.com/in/andersenhc > > ------------------------------------------------------ > Unique Gifts, Collectables, Artwork > ------------------------------------------------------ > Come one > Come all to > www.corinnajasmine.com > ------------------------------------------------------ > > > > On 20 July 2010 20:18, jwcolby wrote: > >> LOL, they don't think so. >> >> Am I missing something? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Hans-Christian Andersen wrote: >>> This is a joke, right? >>> >>> Hans-Christian >>> Web Application Development, London, UK >>> >>> e: hans.andersen at phulse.com >>> t: +44 (0)782 894 5456 >>> w: http://nokenode.com >>> l: http://uk.linkedin.com/in/andersenhc >>> >>> ------------------------------------------------------ >>> Unique Gifts, Collectables, Artwork >>> ------------------------------------------------------ >>> Come one >>> Come all to >>> www.corinnajasmine.com >>> ------------------------------------------------------ >>> >>> >>> >>> On 20 July 2010 19:28, jwcolby wrote: >>> >>>> http://www.dofactory.com/Framework/Framework.aspx >>>> >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-VB mailing list >>>> dba-VB at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From gustav at cactus.dk Wed Jul 21 01:10:12 2010 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 21 Jul 2010 08:10:12 +0200 Subject: [dba-VB] Low Cost Worldwide SMS providers Message-ID: Hi Shamil Skype? Would require the Skype client to be installed though. /gustav >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil From pcs.accessd at gmail.com Wed Jul 21 01:20:30 2010 From: pcs.accessd at gmail.com (Borge Hansen) Date: Wed, 21 Jul 2010 16:20:30 +1000 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: Hi Shamil, www.exetel.com.au is an australian communications company. They currently offer sms to local (Australian) numbers for A$0.05 per sms International sms is A$.088 (8.8 cents) They have an api so you can incorporate sending sms into your application. check it out.... Their order form for (residential) low cost sms is https://www.exetel.com.au/sms/sms_order1.php This is for a pre-paid account - pay A$10 and test it out.... I am currently testing it out myself. Regards Borge Hansen, Gold Coast, Australia On Wed, Jul 21, 2010 at 4:10 PM, Gustav Brock wrote: > Hi Shamil > > Skype? > Would require the Skype client to be installed though. > > /gustav > > >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> > Hi All -- > > I'm looking for a low cost worldwide two-way SMS provider to be integrated > in my customer's application: > > Google search: > > http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide > rs&aq=f&aqi=&aql=&oq=&gs_rfai= > > > has returned the following links: > > 1. http://www.clickatell.com/products/two_way.php > 2. http://www.ficall.com/english/#/ficall/about > 3. http://www.animatele.com/index.html > > > The first one - Clickatell - seems to be a good option. Do you have any > experience in working with Clickatell? Do you know and successfully used > any > other low cost worldwide SMS providers in your applications? > > > Thank you. > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Jul 21 07:42:05 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Jul 2010 08:42:05 -0400 Subject: [dba-VB] Friday Humor Message-ID: <4C46EB1D.40605@colbyconsulting.com> One year, I decided to buy my mother-in-law a cemetery plot as a Christmas gift... The next year, I didn't buy her a gift. When she asked me why, I replied, "Well, you still haven't used the gift I bought you last year!" And that's how the fight started..... ______________________________ My wife and I were watching Who Wants To Be A Millionaire while we were in bed. I turned to her and said, 'Do you want to have Sex?' 'No,' she answered. I then said, 'Is that your final answer?' She didn't even look at me this time, simply saying, 'Yes..' So I said, "Then I'd like to phone a friend." And that's when the fight started... ________________________________ I took my wife to a restaurant. The waiter, for some reason, took my order first. "I'll have the rump steak, rare, please." He said, "Aren't you worried about the mad cow?" "Nah, she can order for herself." And that's when the fight started..... ________________________________ My wife and I were sitting at a table at her high school reunion, and she kept staring at a drunken man swigging his drink as he sat alone at a nearby table. I asked her, "Do you know him?" "Yes", she sighed, "He's my old boyfriend.... I understand he took to drinking right after we split up those many years ago, and I hear he hasn't been sober since." "My God!" I said, "Who would think a person could go on celebrating that long?" And then the fight started... ________________________________ When our lawn mower broke and wouldn't run, my wife kept hinting to me that I should get it fixed. But, somehow I always had something else to take care of first, the shed, the boat, making beer.. Always something more important to me. Finally she thought of a clever way to make her point. When I arrived home one day, I found her seated in the tall grass, busily snipping away with a tiny pair of sewing scissors. I watched silently for a short time and then went into the house.. I was gone only a minute, and when I came out again I handed her a toothbrush. I said, "When you finish cutting the grass, you might as well sweep the driveway." The doctors say I will walk again, but I will always have a limp. ________________________________ My wife sat down next to me as I was flipping channels. She asked, "What's on TV?" I said, "Dust." And then the fight started... ________________________________ Saturday morning I got up early, quietly dressed, made my lunch, and slipped quietly into the garage. I hooked up the boat up to the van, and proceeded to back out into a torrential downpour. The wind was blowing 50 mph, so I pulled back into the garage, turned on the radio, and discovered that the weather would be bad all day. I went back into the house, quietly undressed, and slipped back into bed.. I cuddled up to my wife's back, now with a different anticipation, and whispered, "The weather out there is terrible." My loving wife of 5 years replied, "And, can you believe my stupid husband is out fishing in that?" And that's how the fight started... ________________________________ My wife was hinting about what she wanted for our upcoming anniversary. She said, "I want something shiny that goes from 0 to 150 in about 3 seconds." I bought her a bathroom scale. And then the fight started...... ________________________________ After retiring, I went to the Social Security office to apply for Social Security. The woman behind the counter asked me for my driver's License to verify my age. I looked in my pockets and realized I had left my wallet at home. I told the woman that I was very sorry, but I would have to go home and come back later. The woman said, 'Unbutton your shirt'. So I opened my shirt revealing my curly silver hair. She said, 'That silver hair on your chest is proof enough for me' and she processed my Social Security application.. When I got home, I excitedly told my wife about my experience at the Social Security office... She said, 'You should have dropped your pants. You might have gotten disability, too.' And then the fight started... ________________________________ My wife was standing nude, looking in the bedroom mirror. She was not happy with what she saw and said to me, "I feel horrible; I look old, fat and ugly. I really need you to pay me a compliment.' I replied, "Your eyesight's damn near perfect." And then the fight started........ -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:43:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:43:25 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <11C05396010D46A7AA66094042A83C48@nant> Hi Gustav -- No, Skype can't be used AFAIU - "front-end" SMS sending device could be just a simple mobile phone... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 21, 2010 10:10 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hi Shamil Skype? Would require the Skype client to be installed though. /gustav >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:43:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:43:25 +0400 Subject: [dba-VB] C# Sysvars In-Reply-To: <4C45F620.6010807@colbyconsulting.com> References: <4C45F620.6010807@colbyconsulting.com> Message-ID: <2D6B3569445A4B7F8DE277D5B0FC87F7@nant> Hi John -- You probably mean handling "Locking and Thread Safety" http://www.albahari.com/threading/part2.aspx#_Locking or "best practices" in implementing of Singleton pattern http://www.yoda.arachsys.com/csharp/singleton.html while using your Sysvars ? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 20, 2010 11:17 PM To: VBA Subject: [dba-VB] C# Sysvars In Access I had a system for handling what I call SysVars, which are program global variables, stored in a table, cached as the program opens. SysVar VarID - Int - surrogate key VarName - Str - name of the variable VarVal - Str - Value of the variable VarDescr - Str - description of how the variable is used VarRefresh - Bool - needs to be refreshed before use. This essentially replaces what many developers use, a single record in a table where you add a new field every time you need a new variable (yuk). Just as an example... I have an asynchronous process where I: 1) Send 2 million record chunks of data to files on disk. 2) Ship the chunk files over to a VM input directory for processing 3) Process each file, placing the processed result files in an output directory. 4) Watch the output directory for processed files and ship back to the server 5) Import the chunks back in to SQL Server. The problem is that step 3 takes about 1 hour per file. If I run this process on a large table I can export 30 files to the VM which translates into 30 hours before it finishes processing. If I get a rush order, I need to delete the files in the VM so that they are not clogging up the works and not automatically send those files back to the VM until I say so. I have a SysVar called VMHold which is a true / false, true if hold files going to the vm and false if not. I can set / reset this sysvar through a sysvars class, and it reads / writes the value to the sql server tlbSysVars, caching them in memory as the program opens, refreshing them before use ONLY if the varRefresh is true. That is what I call SysVars and how / why I use them. It seems like everyone would use these for any moderately complex asynchronous or multi-user program. I am looking for feedback on how others implement this functionality. I will write a second email regarding some of the issues I am running into. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:46:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:46:39 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <6EC65E2729FD472AA1A5AC2B5534B318@nant> Thank you, Borge. Yes, that seems to be a good option to send SMS from computers but as I noted here in my customer case "front-end" is a simple mobile phone they use once a day (every day) to send just one SMS message - and that "front-ends" can be located everywhere in this small world - and they wanted SMS sending costs to be as low as possible - the companies as Clickatel (http://www.clickatell.com/products/two_way.php ) AFAIU have special agreements with many countries SMS providers to get local SMS messages sent to special mobile numbers transferred to Clickatel servers where from they can be retrieved many ways - now using computers... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Wednesday, July 21, 2010 10:21 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hi Shamil, www.exetel.com.au is an australian communications company. They currently offer sms to local (Australian) numbers for A$0.05 per sms International sms is A$.088 (8.8 cents) They have an api so you can incorporate sending sms into your application. check it out.... Their order form for (residential) low cost sms is https://www.exetel.com.au/sms/sms_order1.php This is for a pre-paid account - pay A$10 and test it out.... I am currently testing it out myself. Regards Borge Hansen, Gold Coast, Australia On Wed, Jul 21, 2010 at 4:10 PM, Gustav Brock wrote: > Hi Shamil > > Skype? > Would require the Skype client to be installed though. > > /gustav > > >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> > Hi All -- > > I'm looking for a low cost worldwide two-way SMS provider to be integrated > in my customer's application: > > Google search: > > http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide > rs&aq=f&aqi=&aql=&oq=&gs_rfai= > > > has returned the following links: > > 1. http://www.clickatell.com/products/two_way.php > 2. http://www.ficall.com/english/#/ficall/about > 3. http://www.animatele.com/index.html > > > The first one - Clickatell - seems to be a good option. Do you have any > experience in working with Clickatell? Do you know and successfully used > any > other low cost worldwide SMS providers in your applications? > > > Thank you. > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:48:56 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:48:56 +0400 Subject: [dba-VB] Friday Humor In-Reply-To: <4C46EB1D.40605@colbyconsulting.com> References: <4C46EB1D.40605@colbyconsulting.com> Message-ID: <757355B821DE4FC3801B82FAA593A52C@nant> LOL. Is it Friday there already? :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 21, 2010 4:42 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] Friday Humor ... My wife sat down next to me as I was flipping channels. She asked, "What's on TV?" I said, "Dust." And then the fight started... ... -- John W. Colby www.ColbyConsulting.com _______________________________________________ From andy at minstersystems.co.uk Wed Jul 21 09:58:00 2010 From: andy at minstersystems.co.uk (Andrew Lacey) Date: Wed, 21 Jul 2010 15:58:00 +0100 (BST) Subject: [dba-VB] Friday Humor In-Reply-To: <757355B821DE4FC3801B82FAA593A52C@nant> References: <4C46EB1D.40605@colbyconsulting.com> <757355B821DE4FC3801B82FAA593A52C@nant> Message-ID: <1958596177.20915.1279724280879.JavaMail.open-xchange@oxltgw14.schlund.de> Nah, but it's quiet. Good one JC. ? Andy On 21 July 2010 at 16:48 Shamil Salakhetdinov wrote: > LOL. > > Is it Friday there already? :) > > -- Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, July 21, 2010 4:42 PM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] Friday Humor > > ... > > My wife sat down next to me as I was flipping channels. > She asked, "What's on TV?" > I said, "Dust." > And then the fight started... > > > ... > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Thu Jul 22 23:36:58 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 00:36:58 -0400 Subject: [dba-VB] C# custom exceptions Message-ID: <4C491C6A.7080306@colbyconsulting.com> I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 00:11:31 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 01:11:31 -0400 Subject: [dba-VB] try catch finally Message-ID: <4C492483.4020203@colbyconsulting.com> OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Fri Jul 23 00:19:57 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:19:57 +1000 Subject: [dba-VB] C# custom exceptions References: <4C491C6A.7080306@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> Hi John, Check out NLog for your logging requirements. It is comprehensive and free. http://nlog-project.org/ It will write logs to just about anywhere including SQL. My take on error handling in.net is to 1st Avoid exceptions ie test for null before using the object. 2nd Use supplied methods to avoid exceptions ie If !File.Exists("C:\test.txt") ... 3rd Use supplied object exceptions ie Catch ( FileNotFound e) You will know what errors you can recover from and what is fatal to your application. Unhandled exceptions bubble up to a handler, if there is no handler it will throw an error in your Main sub. You can catch unhandled errors there, including threading errors. This is how I handled unhandled thread exceptions, with logging, in a recent app. /// /// The main entry point for the application. /// [STAThread] static void Main ( ) { Application.ThreadException += new ThreadExceptionEventHandler ( Application_ThreadException ); bool createdNew = true; using ( Mutex mutex = new Mutex ( true, "EZHL7", out createdNew ) ) { if ( createdNew ) { Application.EnableVisualStyles ( ); Application.SetCompatibleTextRenderingDefault ( false ); Application.Run ( new FormMain ( ) ); } } } static void Application_ThreadException ( object sender, ThreadExceptionEventArgs e ) { Logger logger = MyLogManager.Instance.GetCurrentClassLogger ( ); logger.FatalException ( "Unhandled Thread Error!", e.Exception ); Application.Restart ( ); } HTH Cheers Michael M PS Looking at the subject line, yes you can create your own custom errors for your custom classes. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, 23 July 2010 2:37 PM To: VBA Subject: [dba-VB] C# custom exceptions I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 23 00:25:49 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:25:49 +1000 Subject: [dba-VB] try catch finally References: <4C492483.4020203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6F@ddi-01.DDI.local> Coding in Outlook so watch out :-) OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection --> Open connection --> if connection open { open a new reader -->If reader.hasrows(); { Do something with the reader close the reader close the connection } } } } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { -->I rarely use this } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 23 00:57:00 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:57:00 +1000 Subject: [dba-VB] try catch finally References: <4C492483.4020203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D70@ddi-01.DDI.local> BTW, The finally is executed before the error bubbles up to calling method. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, 23 July 2010 3:12 PM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 23 08:03:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 09:03:49 -0400 Subject: [dba-VB] C# custom exceptions In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> References: <4C491C6A.7080306@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> Message-ID: <4C499335.5010600@colbyconsulting.com> Oh my, studying this carefully! Moving all logging to this would be an awesome thing. Thanks. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Hi John, > > Check out NLog for your logging requirements. It is comprehensive and > free. > http://nlog-project.org/ > It will write logs to just about anywhere including SQL. > > My take on error handling in.net is to > 1st Avoid exceptions ie test for null before using the object. > 2nd Use supplied methods to avoid exceptions ie If > !File.Exists("C:\test.txt") ... > 3rd Use supplied object exceptions ie Catch ( FileNotFound e) > > You will know what errors you can recover from and what is fatal to your > application. > Unhandled exceptions bubble up to a handler, if there is no handler it > will throw an error in your Main sub. > You can catch unhandled errors there, including threading errors. > > This is how I handled unhandled thread exceptions, with logging, in a > recent app. > > /// > /// The main entry point for the application. > /// > [STAThread] > static void Main ( ) > { > Application.ThreadException += new > ThreadExceptionEventHandler ( Application_ThreadException ); > > bool createdNew = true; > using ( Mutex mutex = new Mutex ( true, "EZHL7", out > createdNew ) ) > { > if ( createdNew ) > { > Application.EnableVisualStyles ( ); > Application.SetCompatibleTextRenderingDefault ( > false ); > Application.Run ( new FormMain ( ) ); > } > } > } > > static void Application_ThreadException ( object sender, > ThreadExceptionEventArgs e ) > { > Logger logger = MyLogManager.Instance.GetCurrentClassLogger > ( ); > logger.FatalException ( "Unhandled Thread Error!", > e.Exception ); > Application.Restart ( ); > } > > HTH > > Cheers > > Michael M > > PS Looking at the subject line, yes you can create your own custom > errors for your custom classes. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, 23 July 2010 2:37 PM > To: VBA > Subject: [dba-VB] C# custom exceptions > > I am trying to find info on how and when where and why to use custom > exceptions and particularly how to log them. > > I am developing a system which uses four asynchronous processes. > > Stage 1) Export a SQL table or view to address validation. I have a > table that has records which tell stage 1 the name of the database, view > to export, date to process, directory on disk and a few other things. > > Stage 1 creates text files on disk in a staging directory, one file for > each 2 million records exported. This creates a record in a log table > with the PK of stage 1 table, name of the database, view exported, > directory on disk (output staging directory), file name, and some date > flags to monitor completion of the remaining stages. IOW one log file > per text file exported, all info needed for the remaining stages, date > fields for each remaining stage to log that it processed that file. > > Stage 2) Move the files in the staging directory to a virtual machine. > The log files created by stage 1 are read and used to move the files and > set a datetime flag in the log record saying that stage 2 completed (the > file moved to VM). The virtual machine may not be available, but if it > is the file moves and the log record is updated. If the file goes to the > VM, the VM will process the file and place it in an output directory. > This will take between 1/2 hour and 1 hour per file. > > Stage 3) Move the completed files from the VM back to a different > (input) staging directory. Again, the log file is used to determine > what files should be available on the VM and if found and moved, a > datetime flag is set saying that file was moved back from the VM back to > the Input Staging Directory. > > Stage 4) Import the files from the input staging directory back into SQL > server. The log record for any file moved back in is marked with a > datetime flag saying that the file was imported back in to SQL server. > > I have about a dozen or so "data" tables which have to be processed > monthly, rain or shine. By placing records in the stage 1 source table, > I can cause the system to process each of my data tables. As the > process finishes, it creates a new record adding a "number of days to > next process" > to the date so that it is queued to process again in X days. > > I also have orders that I run that will write one or more records into > this same table and cause their data to process. > > So... nicely divided, asynchronous process: Sql to Staging, Staging to > VM, VM to staging, Staging in to SQL Server. These things must be > asynchronous because the VM may or may not be available, and it is > critical that each file is processed through each stage and tracked. > > Records in the main table triggers the process (stage 1). Records in > the log table track stages 2-4 for each file created in stage 1. > > I want to run 4 threads to do these processes. IOW, a process just runs > on the server (or somewhere, but probably eventually on the server). > Each stage is entirely independent, and takes its input from a table, > and writes a datetime flag as it finishes. > > > OK, so back to exceptions... > > I am new to threads. I wrote the code from the bottom up, with working > processes for doing each of the 4 stages, but triggered by button > clicks. It all worked, except that it wasn't table driven (of course). > I even had each button click create a worker thread and that worked. > > I created a supervisor class, with four methods, one for each stage. I > moved the button click code to these methods. I fired each of them up, > and it mostly works... each stage is running in its own thread and > watching the tables, updating the records as each does its thing. > Except that I would get weird errors that were not handled by any > exception handler. > > I removed all traces of messagebox.show and I *think* I have caused that > to go away. Or maybe not, who knows. > > But now I really need to get errors logged. > > Again, I am new to threading, and new to custom exceptions. New to > exception logging. Do I sound like a nubee? ;) > > Anyway, I do not particularly want to use the Windows error log because > then the error logs would be scattered around on whatever machine the > parts run on. Remember that there is a user interface part which sets > up the records in stage 1 and monitors the process. > > This is potentially a nice little system but it has to be done right or > I will fight it for the rest of my career. So I need to learn > exceptions, and I need to log the exceptions, my preference is into SQL > Server, though there are of course some potential errors (SQL server > errors) which could not be logged there because SQL server isn't > available at the instant the log is created. > > Kinda messy. > > Any pointers, articles, books, or other sources of information I could > go to to learn this stuff. > Google is not my friend in this case because I am getting stuff from > 2003 to the present and I really want modern code. > > Help! > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Jul 23 12:19:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 13:19:36 -0400 Subject: [dba-VB] C# NLog setup Message-ID: <4C49CF28.3070801@colbyconsulting.com> Can anyone step me through setting NLog up to do logging. I don't care where the destination is (file or database) I just want to get it working and starting to use it and able to look at the files, then I will go back and tweak it later. I can be dense sometimes but the initial setup seems a little arcane. Any help appreciated -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Jul 23 12:21:58 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Jul 2010 21:21:58 +0400 Subject: [dba-VB] C# custom exceptions In-Reply-To: <4C491C6A.7080306@colbyconsulting.com> References: <4C491C6A.7080306@colbyconsulting.com> Message-ID: <04E9EE312E584A37B93EBA3B1A2BD23A@nant> Hi John -- Just follow KISS principle - I used to use that principle to profile/log applications with up to one hundred threads - and I never had any issues. I do just log to a simple text file log shared by all threads, and I put lock around log text record write operation: System.IO.File.AppendAllText(...) (If you expect that putting a lock on such a simple file write operation will somehow influence badly your multi-threaded application then you can develop a code for a special utility thread handling log writes using .NET Enqueue / Dequeue features (http://msdn.microsoft.com/en-us/library/1c8bzx97.aspx ) but do not introduce that complexity from the very beginning...) I must note that nor I nor my customers usually do not care about keeping logs history - so log file records are just getting lost after several days overwritten by the new ones: the code does make log backup into a .bak file after main log file gets several MB in size - we do use log in the cases of runtime errors/bugs/other issues and one day log is usually more than enough to find and fix the issues... In your case if you wanted to log into MS SQL DB - just do it if it's available (I do use simple SP in such cases), if it's not available do log into a text file, and if the latter isn't available (e.g. no disk space) - then do log into Windows System Application Events log - one can even try to send an e-mail message using SMTP or log into a Web Service or FTP site - all that is relatively simple to do in .NET but when simple text log works well why bother about advanced logging options? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 8:37 AM To: VBA Subject: [dba-VB] C# custom exceptions I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Jul 23 13:05:08 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Jul 2010 22:05:08 +0400 Subject: [dba-VB] try catch finally In-Reply-To: <4C492483.4020203@colbyconsulting.com> References: <4C492483.4020203@colbyconsulting.com> Message-ID: <29E411AB69F94BEAAD0F7CDC492E8D19@nant> Hi John, Yes, you can dimension connection and reader object variables outside the try/catch block - something like it is done by the code in P.S. of this posting. If you have unhandled exception in your worker thread then it completes abnormally but your main thread continues running OK, still you'd better have all your worker thread exceptions handled gracefully and returning some failing code to the main thread in the case of runtime errors... Throw call issued and executed in catch block does immediately return control/"bubles" to the nearest try/catch block in the call stack, and if there is no any then worker or main thread crash... HTH, -- Shamil P.S. static void Main(string[] args) { try { tryCatchFinally(); } catch (Exception ex) { System.Console.WriteLine("Runtime.Error: " + ex.Message); } } public static void tryCatchFinally() { string serverName = @"MyServer\MySQLServer"; string databaseName = "MyDb"; SqlConnection cnn = null; SqlCommand cmd = null; SqlDataReader rdr = null; string connectionString = string.Format( @"Data Source={0};Initial Catalog={1};Integrated Security=True", serverName, databaseName); try { string cmdText = "select * from [Users]"; cnn = new SqlConnection(connectionString); cnn.Open(); cmd = new SqlCommand(cmdText, cnn); rdr = cmd.ExecuteReader(); while (rdr.Read()) { System.Console.WriteLine("{0} {1} {2}", rdr[0], rdr[1], rdr[2]); } } catch (SqlException ex) { if (cnn != null) System.Console.WriteLine("tryCatchFinally.SQL: {0} {1} {2}", cnn.WorkstationId, cnn.State, ex.Message); throw; } catch (Exception ex) { if (cnn != null) System.Console.WriteLine("tryCatchFinally.Runtime: {0} {1} {2}", cnn.WorkstationId, cnn.State, ex.Message); throw; } finally { if (rdr != null) rdr.Close(); if (cnn != null) cnn.Close(); } } -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 9:12 AM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Fri Jul 23 13:13:32 2010 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 23 Jul 2010 14:13:32 -0400 Subject: [dba-VB] try catch finally In-Reply-To: <4C492483.4020203@colbyconsulting.com> References: <4C492483.4020203@colbyconsulting.com> Message-ID: John, You are correct that you do have to dimension the connection and reader before the try. The Finally block executes whether an error is encountered or not. A good developer always makes sure the garbage got taken care of on the way out the door. The suggestion of checking that the connection did get opened before you execute the rest of the code isn't a bad idea. However, things can still go wrong once the reader/connection are opened and I've personally seen cases where the server-side still sees the connection as open even though the client-side thinks it is gone. Instead of handling the error and then throwing the exception up to the calling block, why not use Functions instead of Procedures and pass back a Boolean indicating whether the operation was successful. Doris Manning Sr. Developer & Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 1:12 AM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 23 14:05:14 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:05:14 -0400 Subject: [dba-VB] C# - what am I doing wrong here? Message-ID: <4C49E7EA.2000609@colbyconsulting.com> OK so I want to do the right thing, I just don't know how. 8( In the following code, I want to declare the connection and command object outside the try, initialize the two objects inside of a try, catch any errors, and finally cleanup. The objects in the finally say that they were never initialized. If I put them inside of the try, it complains that the objects aren't valid in the scope of the finally. If I initialize them outside of the try it isn't using a try and errors will not be handled. It seems that I am damned any way I look at this. namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn; SqlCommand myCommand; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { myCommand.Dispose(); mCnn.Close(); } } } } -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 14:47:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:47:15 -0400 Subject: [dba-VB] Oh man, I love this piece Message-ID: <4C49F1C3.1030708@colbyconsulting.com> If it worked... but it doesn't. What a MESS! http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 14:51:13 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:51:13 -0400 Subject: [dba-VB] C# - but what happened to catch? Message-ID: <4C49F2B1.3060600@colbyconsulting.com> http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 15:07:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 16:07:55 -0400 Subject: [dba-VB] c# so FINALLY ? Message-ID: <4C49F69B.2030403@colbyconsulting.com> The version that seems to addre4ss all of the issues: namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } } } What do you do with the command object? Does it need cleanup handling at all? It doesn't have a close method, though it does have a dispose method. And finally (pun intended) what should I do with this method? Return a boolean true = worked? But WHERE? The finally will execute whether the function "worked" or not. AFTER the finally block? As I understand it that code would ONLY execute if the catch statements do not throw an error? A throw does exit the function never to return correct? Should I log (write to a log file) BEFORE the throw? This is "closest to the error" and I can pass additional info about the context. Or should I just continuously throw it all the way up to the top and log everything at the very top? (mutters under breath - "I will learn this stuff") -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Jul 24 00:16:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 09:16:12 +0400 Subject: [dba-VB] C# - but what happened to catch? In-Reply-To: <4C49F2B1.3060600@colbyconsulting.com> References: <4C49F2B1.3060600@colbyconsulting.com> Message-ID: John, You can make it like that also: using (reader = file.OpenText()) { reader.Read(source, 0, length); } Then 'finally' code block will not be needed as reader will be "automagically" closed by its IDispose call on exit of using code block... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 11:51 PM To: VBA Subject: [dba-VB] C# - but what happened to catch? http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Jul 24 00:16:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 09:16:12 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C49F69B.2030403@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com> Message-ID: <39CF9897AAF846D49115A5F2A38041F4@nant> Hi John -- Dispose does all the clean-up for SqlCommand object instance... It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside catch blocks... Such methods do usually return "RecordAffected" value if that needed by the callers, some other execution stats, or nothing... <<< Or should I just continuously throw it all the way up to the top and log everything at the very top? >>> Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; - return to the highest position in the call stack where you can gracefully continue your application execution, or quit your app with a user-friendly error message... Logging all the way up to the top of the call stack would be similar to On Error GoTo ... VB6/VBA approach - that one proved itself to be a professional approach for VB6/VBA but for C#/VB.NET it's usually considered as a timid, pavid, apprehensive and too expensive (in many areas) to be true approach, e.g. do you take into account that try/catch/finally do influence your code execution speed so putting them everywhere could degrade your code performance?... Code instrumentation/logging/profiling is usually done while going down to the call stack, and .NET has special instrumentation classes, which can be used to organize as detailed as needed logging depending on current application settings... After all - your application usually work or crash when deployed? - if the latter then whatever advanced logging/code instrumentation approach you'll use you'll anyway loose your customers (pun not intended)... Be courageous! Forget "VB6/VBA timidity", recall your best times when you've been a "code cowboy" but do use Unit Testing (at least) - then you'll make your coding style light, your code running lightning fast and still being "bullet-proof"... Thank you. :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 12:08 AM To: VBA Subject: [dba-VB] c# so FINALLY ? The version that seems to addre4ss all of the issues: namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } } } What do you do with the command object? Does it need cleanup handling at all? It doesn't have a close method, though it does have a dispose method. And finally (pun intended) what should I do with this method? Return a boolean true = worked? But WHERE? The finally will execute whether the function "worked" or not. AFTER the finally block? As I understand it that code would ONLY execute if the catch statements do not throw an error? A throw does exit the function never to return correct? Should I log (write to a log file) BEFORE the throw? This is "closest to the error" and I can pass additional info about the context. Or should I just continuously throw it all the way up to the top and log everything at the very top? (mutters under breath - "I will learn this stuff") -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 24 04:26:02 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 05:26:02 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <39CF9897AAF846D49115A5F2A38041F4@nant> References: <4C49F69B.2030403@colbyconsulting.com> <39CF9897AAF846D49115A5F2A38041F4@nant> Message-ID: <4C4AB1AA.2040100@colbyconsulting.com> Shamil, Thanks for your reply. C#, .Net and Visual Studio are very complex and I have so much to learn. And I have to make a living while I am learning, and I am trying to teach a young fellow that works for me what little I know as well. I need more information from you. I have two specific things I am trying to implement and make sure that I "cleanup" correctly. The first is that I have a ton of places in my code where I am using SQL Server records for table driven processes. As such I need to: 1) Work with data readers, looping through records. 2) Work with command objects doing .ExecuteNonQuery() to perform updates on flags. In both these scenarios I want to make sure that I open the connection, open the command object, do whatever the command object is going to do, close the connection, and cleanup the command object. And I want (am trying) to do this in a single place so that I get consistent object handling / cleanup. So, for example I use a static method of a class: public static bool ExecNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } return true; } > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? > It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside of catch blocks OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. And of course I need a reliable logger so that I can go see any errors. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Dispose does all the clean-up for SqlCommand object instance... > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has > > throw > > calls inside catch blocks... > > Such methods do usually return "RecordAffected" value if that needed by the > callers, some other execution stats, or nothing... > > <<< > Or should I just continuously throw > it all the way up to the top > and log everything at the very top? > Again follow KISS-principle: > - log exceptions as close as possible to the point where they appeared; > - return to the highest position in the call stack where you can gracefully > continue your application execution, or quit your app with a user-friendly > error message... > > Logging all the way up to the top of the call stack would be similar to > > On Error GoTo ... > > VB6/VBA approach - that one proved itself to be a professional approach for > VB6/VBA but for C#/VB.NET it's usually considered as a timid, pavid, > apprehensive and too expensive (in many areas) to be true approach, e.g. do > you take into account that try/catch/finally do influence your code > execution speed so putting them everywhere could degrade your code > performance?... > > Code instrumentation/logging/profiling is usually done while going down to > the call stack, and .NET has special instrumentation classes, which can be > used to organize as detailed as needed logging depending on current > application settings... > > After all - your application usually work or crash when deployed? - if the > latter then whatever advanced logging/code instrumentation approach you'll > use you'll anyway loose your customers (pun not intended)... > > Be courageous! Forget "VB6/VBA timidity", recall your best times when you've > been a "code cowboy" but do use Unit Testing (at least) - then you'll make > your coding style light, your code running lightning fast and still being > "bullet-proof"... > > Thank you. :) > > -- Shamil From jwcolby at colbyconsulting.com Sat Jul 24 06:33:26 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 07:33:26 -0400 Subject: [dba-VB] NLog assistance Message-ID: <4C4ACF86.6050707@colbyconsulting.com> I am still looking for anyone on the list that uses NLog that can help me get it sorking initially. My confusion is in how to set it up. The help discusses setting an XML file, and I have found about 40 different versions of that file out on Google, but I am not sure where I go to edit it. My solution has several projects, and I assume that I have to do an XML config file in each project? I would prefer ONE for the solution but I will do what it takes. This appears to be one of those "you can't use it until you know how to use it" things. Just a few words of advice might be enough to get me going. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 24 09:41:10 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 10:41:10 -0400 Subject: [dba-VB] NLog making progress Message-ID: <4C4AFB86.4030305@colbyconsulting.com> OK, so it appears that I am making progress. I found an online tutorial http://nlog-project.org/wiki/Tutorial#Installing_NLog which got me set up and working on one project. Basically after referencing in the project and using in the class, I insert something like: Logger nlog = LogManager.GetLogger("clsAZLog"); in the header of each class. My question is, is there any syntax that could give me the name of the class? IOW: Logger nlog = LogManager.GetLogger(SomeObject.Name); where SomeObject is the class itself. The objective to be just cutting and pasting a single identical line in the header of each class. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Jul 24 11:33:53 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 20:33:53 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C4AB1AA.2040100@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> Message-ID: <8A310364129E48FF9AFE923F44EFBAA0@nant> Hi John -- Thank you for your questions. <<< > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? >>> Yes, it's more than correct IMO :) - I must say I almost never use that much clean-up coding in my .NET development: - I do never clean-up SqlCommand and SqlDataReader explicitly; - I do never close/clean-up SqlConnection; - I do use try { using (SqlConnection cnn = new SqlConnection(connectionString) { // SqlCommand and SqlDataReader etc. are in } } catch (SqlException ex) { // log exception throw ex; } catch (Exception ex) { // log exception throw ex; } Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be not so good (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several years in db intensive multi-user web apps - and it works well - no "memory leakage" - and I must say I have used my logging just a few times and it was informative enough to find and fix the bugs... "Excessive clean-up" is not needed in .NET as CLR's garbage collector does do good job for the code as above... <<<<<< If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. >>>>>> John, IMO there is no generic/common answer to your question - it depends on your app what to do with handled exception - "log and buble it up" or "log and suppress it" returning boolean failure code to the caller method: - logging and using Boolean is what is called "defensive" programming AFAIU - and it's "heavy good old professional style"; - logging and throwing and exception up to the higest level caller is what is called "modern lightweight programming style" - in my opinion :) - and it's the most recommended nowadays AFAIS... Of course in the latter case of "modern lightweight programming style" there should be something(/some code) on the upper call stack levels to take care of the exception (to make some more logging and) to: - continue application execution gracefully; - quit the application... <<< And of course I need a reliable logger so that I can go see any errors. >>> I do not use any besides some custom simple coding I outlined in this thread: - I just log into a simple text file; - I log into MS SQL, if that fails, log into text file, if that fails log into MS Windows application log. You can plan to use some existing logging frameworks but for the time beeing just write simple custom wrapper class, and then you can add advanced logging later... <<< And I have to make a living while I am learning, >>> Yes, that's our destiny - the same story here, moreever... <<< and I am trying to teach a young fellow that works for me what little I know as well. >>> If this young fellow is from a good IT college then they can teach you a lot (myself included) - I mean they usually know well all the modern approaches/methods of application programming - yes, more in theory than in practice but they often have a good overview we (seasoned developers) might lack because of the lack of time to study the theory - "fighting" everyday for living - just talk to the "kid programmer" - and you'll together will find your "proper" way of programming together... I suppose that for your case there are two proven sources: - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer to Programmer) (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 642) - it has real life sample web site/code solution with multi-layer "framework" - I did quote "framework" because it has just a few classes - you can "grab and use them" (sources are available free on WROX site)... - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge framework - and I personally do not use it - I'd recommend to just get its sources (they are free) and to investigate the part of code belonging to the DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this framework immediately - it would be very time consuming to learn it in details... I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + custom SPs mapping to your ADO.NET EF DataModel would be "what doctor ordered" but again it could take a lot of time to learn that "super modern" stuff - you can use simpler and time proven approaches referred above while learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if any).... Thank you. -- Shamil P.S: Disclaimer: All the above my opinions are coming from my own everyday .NET development experience, and are also gathered on Web, including Access-D/dba-VB and from technical books - they can be my own "misinterpretation or real world" sometimes - but they work well for me and for my customers :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 1:26 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# so FINALLY ? Shamil, Thanks for your reply. C#, .Net and Visual Studio are very complex and I have so much to learn. And I have to make a living while I am learning, and I am trying to teach a young fellow that works for me what little I know as well. I need more information from you. I have two specific things I am trying to implement and make sure that I "cleanup" correctly. The first is that I have a ton of places in my code where I am using SQL Server records for table driven processes. As such I need to: 1) Work with data readers, looping through records. 2) Work with command objects doing .ExecuteNonQuery() to perform updates on flags. In both these scenarios I want to make sure that I open the connection, open the command object, do whatever the command object is going to do, close the connection, and cleanup the command object. And I want (am trying) to do this in a single place so that I get consistent object handling / cleanup. So, for example I use a static method of a class: public static bool ExecNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } return true; } > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? > It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside of catch blocks OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. And of course I need a reliable logger so that I can go see any errors. John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 24 11:45:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 12:45:15 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <8A310364129E48FF9AFE923F44EFBAA0@nant> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> <8A310364129E48FF9AFE923F44EFBAA0@nant> Message-ID: <4C4B189B.6080504@colbyconsulting.com> Thanks Shamil. Interesting stuff all of this. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Jul 24 11:53:57 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 12:53:57 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <8A310364129E48FF9AFE923F44EFBAA0@nant> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> <8A310364129E48FF9AFE923F44EFBAA0@nant> Message-ID: <4C4B1AA5.4070802@colbyconsulting.com> I have NLog running very basic, just logging to a log file in my bin directory. NLog appears to be capable of logging to multiple places and do all kinds of sophisticated things like log to email, sql server etc. We shall see. It is going to be a bit of work to retrofit my app to use logging since I have none in it ATM but I have been wanting to do this for a long time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jul 24 13:11:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 22:11:21 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C4B1AA5.4070802@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com><8A310364129E48FF9AFE923F44EFBAA0@nant> <4C4B1AA5.4070802@colbyconsulting.com> Message-ID: <67F1EC9B1A864250B342838202B33875@nant> Hi John -- Yes, NLog seems to be a good choice for multi-threaded apps also http://nlog-project.org/wiki/File_target... I will probably try to use it in one of my applications... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 8:54 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# so FINALLY ? I have NLog running very basic, just logging to a log file in my bin directory. NLog appears to be capable of logging to multiple places and do all kinds of sophisticated things like log to email, sql server etc. We shall see. It is going to be a bit of work to retrofit my app to use logging since I have none in it ATM but I have been wanting to do this for a long time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 25 14:30:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 15:30:11 -0400 Subject: [dba-VB] C# - what does this mean Message-ID: <4C4C90C3.8070901@colbyconsulting.com> From: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx Closing the DataReader You should always call the Close method when you have finished using the DataReader object. If your Command contains output parameters or return values, they will not be available until the DataReader is closed. Note that while a DataReader is open, the Connection is in use exclusively by that DataReader. You will not be able to execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed. Note Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection. NOTICE the Note above. Why would you NOT call close at the very least. I understand Dispose - that is the garbage collector's job to do that when it decides it needs to but close? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Jul 25 15:08:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 16:08:17 -0400 Subject: [dba-VB] C# - rigorous programming Message-ID: <4C4C99B1.7040804@colbyconsulting.com> I had a bunch of code to open connections, command objects and a reader, do something with the reader and then close it all. it is not a trivial amount of code if you are going to try and wrap it in a try / catch and properly close the stuff. So I wrote the following code: public static SqlDataReader GetDataReader(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; SqlDataReader myDR; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myDR = myCommand.ExecuteReader(); return myDR; } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } Which basically just took the three pieces and wrapped them. Unfortunately it doesn't work because the reader closes if the connection closes. It seems that the reader only holds one record at a time and when the next record is asked for goes and gets it on demand. But look at all of the code required to get around the C# syntax police. The objects have to be dimensioned before the try, the try has to wrap the object opens in case they fail (the point of the try) and the finally has to close everything back down correctly, but now have to be checked against null because they might in fact be null which would trigger another error trying to close an object that isn't opened. So what's a poor boy to do? I decided to build a class to do this and then use a property to expose the reader. The class correctly cleans up when it is destroyed. That seems to work. -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Sun Jul 25 18:32:52 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 26 Jul 2010 09:32:52 +1000 Subject: [dba-VB] C# - rigorous programming References: <4C4C99B1.7040804@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> Hi John, I see you have made a lot of progress over the weekend. Now that you have moved this method into its own class, make sure you don't ... ' call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class' which is what I think MS was saying in you previous message. I think the reason is that the finalizer is indeterminate. So the 'close it when you no longer need it' rule still applies. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, 26 July 2010 6:08 AM To: VBA Subject: [dba-VB] C# - rigorous programming I had a bunch of code to open connections, command objects and a reader, do something with the reader and then close it all. it is not a trivial amount of code if you are going to try and wrap it in a try / catch and properly close the stuff. So I wrote the following code: public static SqlDataReader GetDataReader(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; SqlDataReader myDR; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myDR = myCommand.ExecuteReader(); return myDR; } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } Which basically just took the three pieces and wrapped them. Unfortunately it doesn't work because the reader closes if the connection closes. It seems that the reader only holds one record at a time and when the next record is asked for goes and gets it on demand. But look at all of the code required to get around the C# syntax police. The objects have to be dimensioned before the try, the try has to wrap the object opens in case they fail (the point of the try) and the finally has to close everything back down correctly, but now have to be checked against null because they might in fact be null which would trigger another error trying to close an object that isn't opened. So what's a poor boy to do? I decided to build a class to do this and then use a property to expose the reader. The class correctly cleans up when it is destroyed. That seems to work. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 25 21:08:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 22:08:33 -0400 Subject: [dba-VB] C# - rigorous programming In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> References: <4C4C99B1.7040804@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> Message-ID: <4C4CEE21.4050203@colbyconsulting.com> Michael, > I see you have made a lot of progress over the weekend. I made awesome progress on two different fronts. I got NLog working (to a file, not to SQL Server) and I got some stuff figured out on C# cleanup. I believe in logging, both errors and progress. I haven't had logging though, only specific application control stuff. > I think the reason is that the finalizer is indeterminate. So the 'close it when you no longer need it' rule still applies. I understand "close when you no longer need it". I did think that the the Dispose method forced the garbage collector to take care of that specific object right then and there. I thought that in the case of SQL Server or other database objects, that immediate cleanup would be a good thing. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Hi John, > > I see you have made a lot of progress over the weekend. > > Now that you have moved this method into its own class, make sure you > don't ... > ' call Close or Dispose on a Connection, a DataReader, or any other > managed object > in the Finalize method of your class' which is what I think MS was > saying in you previous message. > I think the reason is that the finalizer is indeterminate. So the 'close > it when you no longer need it' rule still applies. > > Cheers > > Michael M > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, 26 July 2010 6:08 AM > To: VBA > Subject: [dba-VB] C# - rigorous programming > > I had a bunch of code to open connections, command objects and a reader, > do something with the reader and then close it all. it is not a trivial > amount of code if you are going to try and wrap it in a try / catch and > properly close the stuff. So I wrote the following code: > > public static SqlDataReader GetDataReader(string strCnn, string > strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > SqlDataReader myDR; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myDR = myCommand.ExecuteReader(); > return myDR; > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > } > > > Which basically just took the three pieces and wrapped them. > > Unfortunately it doesn't work because the reader closes if the > connection closes. It seems that the reader only holds one record at a > time and when the next record is asked for goes and gets it on demand. > > But look at all of the code required to get around the C# syntax police. > The objects have to be dimensioned before the try, the try has to wrap > the object opens in case they fail (the point of the > try) and the finally has to close everything back down correctly, but > now have to be checked against null because they might in fact be null > which would trigger another error trying to close an object that isn't > opened. > > So what's a poor boy to do? > > I decided to build a class to do this and then use a property to expose > the reader. The class correctly cleans up when it is destroyed. That > seems to work. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sun Jul 25 22:11:52 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 23:11:52 -0400 Subject: [dba-VB] C# - NLog to SQL Server Message-ID: <4C4CFCF8.8050505@colbyconsulting.com> Is anyone doing this? I am using the following as a config: INSERT INTO LogTable(time_stamp, [level], logger, [message]) VALUES (@time_stamp, at level, at logger, at message) I have a server Azul, I am using integrated security, I created a database _NLogDatabase and a table NLog with fields of those names. Data types: Time_Stamp: DateTime Level: Varchar(50) Logger: VarChar(50) Message: Varchar(max) So far the logs are going to file but not to the table. -- John W. Colby www.ColbyConsulting.com From marklbreen at gmail.com Mon Jul 26 05:43:53 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 26 Jul 2010 11:43:53 +0100 Subject: [dba-VB] NLog making progress In-Reply-To: <4C4AFB86.4030305@colbyconsulting.com> References: <4C4AFB86.4030305@colbyconsulting.com> Message-ID: Hello John, When I read this email, I recalled the hazy, easy days of Glen Grubb and the ggCC error handler. Oh, how life was easy back then :) Mark On 24 July 2010 15:41, jwcolby wrote: > OK, so it appears that I am making progress. I found an online tutorial > > http://nlog-project.org/wiki/Tutorial#Installing_NLog > > which got me set up and working on one project. > > Basically after referencing in the project and using in the class, I insert > something like: > > Logger nlog = LogManager.GetLogger("clsAZLog"); > > in the header of each class. > > My question is, is there any syntax that could give me the name of the > class? IOW: > > Logger nlog = LogManager.GetLogger(SomeObject.Name); > > where SomeObject is the class itself. The objective to be just cutting and > pasting a single > identical line in the header of each class. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Jul 26 07:22:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Jul 2010 08:22:15 -0400 Subject: [dba-VB] NLog making progress In-Reply-To: References: <4C4AFB86.4030305@colbyconsulting.com> Message-ID: <4C4D7DF7.3090007@colbyconsulting.com> Mark, LOL. Yea, the good ole days. ;) I have to say that, being a programmer at heart, I just truly enjoy the C# language and the .Net environment. There is so much to learn, and so much power. Life is not easy yet in C#, and because of the sheer complexity may never be, but I anticipate the day when, like VBA and DAO in Access, I can pretty much just type away as fast as my fingers can move, writing code. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > When I read this email, I recalled the hazy, easy days of Glen Grubb and the > ggCC error handler. Oh, how life was easy back then :) > > Mark From jwcolby at colbyconsulting.com Wed Jul 28 00:35:18 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 01:35:18 -0400 Subject: [dba-VB] C# - NLog Message-ID: <4C4FC196.5050709@colbyconsulting.com> Wow! I must say that NLog is doing everything I need. Well... other than logging to SQL Server which I have not figured out yet. As I wrote in a previous post, I am designing an asynchronous process, consisting of 4 steps where 1) Tables are exported to text files (csv) 2) The files are moved to a vm for processing by a third party application 3) The resulting files (csv) are brought back from the vm 4) The files are imported back in to SQL Server. The objective is to have these 4 steps able to process completely autonomously, completely table driven. I am trying to run each stage on a thread so that each can do it's thing as it sees fit. This brings a large degree of interaction and I need to be able to see where exceptions are thrown, stack traces and all of that. NLog is handling this beautifully. I am not done by any stretch of the imagination but I would be completely unable to figure this out without the exception logging that NLog enables me to do. Very nice stuff. -- John W. Colby www.ColbyConsulting.com From bheid at sc.rr.com Wed Jul 28 11:08:16 2010 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 28 Jul 2010 12:08:16 -0400 Subject: [dba-VB] C# - what does this mean In-Reply-To: <4C4C90C3.8070901@colbyconsulting.com> References: <4C4C90C3.8070901@colbyconsulting.com> Message-ID: <003c01cb2e6f$168e6770$43ab3650$@rr.com> I think they are talking about calling close in an overridden Finalize method on a class. That would only be if you implement your own dispose/finalize methods in a class. You do want to close the reader and all if you are just using ado.net to connect to and read from a SQL/OLEdb connection. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 25, 2010 3:30 PM To: VBA Subject: [dba-VB] C# - what does this mean From: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx Closing the DataReader You should always call the Close method when you have finished using the DataReader object. If your Command contains output parameters or return values, they will not be available until the DataReader is closed. Note that while a DataReader is open, the Connection is in use exclusively by that DataReader. You will not be able to execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed. Note Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection. NOTICE the Note above. Why would you NOT call close at the very least. I understand Dispose - that is the garbage collector's job to do that when it decides it needs to but close? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From bheid at sc.rr.com Wed Jul 28 11:10:44 2010 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 28 Jul 2010 12:10:44 -0400 Subject: [dba-VB] C# - but what happened to catch? In-Reply-To: References: <4C49F2B1.3060600@colbyconsulting.com> Message-ID: <003d01cb2e6f$6eb19350$4c14b9f0$@rr.com> In the example in John's email, they are going to let the exception "bubble up". But they still want to close the reader whether or not there is an exception. SO in the example, the try is only so they can have a finally. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 24, 2010 1:16 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - but what happened to catch? John, You can make it like that also: using (reader = file.OpenText()) { reader.Read(source, 0, length); } Then 'finally' code block will not be needed as reader will be "automagically" closed by its IDispose call on exit of using code block... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 11:51 PM To: VBA Subject: [dba-VB] C# - but what happened to catch? http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 28 18:41:54 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 19:41:54 -0400 Subject: [dba-VB] C# - Cleanup Message-ID: <4C50C042.7020309@colbyconsulting.com> I have been reading up on the proper way to cleanup unmanaged code. Basically what this entails is inheriting CriticalFinalizerObject and IDisposable, and then adding stuff to the class. The finalizer is used to dispose of unmanaged ubjects "deterministically", IOW when I say to, not when the garbage collector decides to. This becomes an issue when you open a lot of connections. The garbage collector does not understand that the connections exist and so performs it's cleanup when it gets around to it. At least that is what I am understanding. Doing a massive rewrite to add this finalizer code to all my classes that use such code has dropped my errors DRASTICALLY! The code looks like this: #region Dispose ~clsSPAccuzipExportTo() { Dispose(true); } public void Close() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Implement IDisposable. // Do not make this method virtual. // A derived class should not be able to override this method. public void Dispose() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { if (mCnn != null) { try { mCnn.Close(); } catch (Exception) { } mCnn.Dispose(); } } } disposed = true; } #endregion -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Wed Jul 28 19:09:07 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 29 Jul 2010 10:09:07 +1000 Subject: [dba-VB] C# - Cleanup References: <4C50C042.7020309@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> Looks like a good candidate for adding to your base data access class. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, 29 July 2010 9:42 AM To: VBA Subject: [dba-VB] C# - Cleanup I have been reading up on the proper way to cleanup unmanaged code. Basically what this entails is inheriting CriticalFinalizerObject and IDisposable, and then adding stuff to the class. The finalizer is used to dispose of unmanaged ubjects "deterministically", IOW when I say to, not when the garbage collector decides to. This becomes an issue when you open a lot of connections. The garbage collector does not understand that the connections exist and so performs it's cleanup when it gets around to it. At least that is what I am understanding. Doing a massive rewrite to add this finalizer code to all my classes that use such code has dropped my errors DRASTICALLY! The code looks like this: #region Dispose ~clsSPAccuzipExportTo() { Dispose(true); } public void Close() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Implement IDisposable. // Do not make this method virtual. // A derived class should not be able to override this method. public void Dispose() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { if (mCnn != null) { try { mCnn.Close(); } catch (Exception) { } mCnn.Dispose(); } } } disposed = true; } #endregion -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 28 21:29:20 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 22:29:20 -0400 Subject: [dba-VB] C# - Cleanup In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> References: <4C50C042.7020309@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> Message-ID: <4C50E780.1080006@colbyconsulting.com> Yep. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Looks like a good candidate for adding to your base data access class. > > Cheers > > Michael M > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, 29 July 2010 9:42 AM > To: VBA > Subject: [dba-VB] C# - Cleanup > > I have been reading up on the proper way to cleanup unmanaged code. > Basically what this entails is inheriting CriticalFinalizerObject and > IDisposable, and then adding stuff to the class. The finalizer is used > to dispose of unmanaged ubjects "deterministically", IOW when I say to, > not when the garbage collector decides to. > > This becomes an issue when you open a lot of connections. The garbage > collector does not understand that the connections exist and so performs > it's cleanup when it gets around to it. > > At least that is what I am understanding. Doing a massive rewrite to > add this finalizer code to all my classes that use such code has dropped > my errors DRASTICALLY! > > The code looks like this: > > #region Dispose > > ~clsSPAccuzipExportTo() > { > Dispose(true); > } > public void Close() > { > Dispose(true); > // This object will be cleaned up by the Dispose method. > // Therefore, you should call GC.SupressFinalize to > // take this object off the finalization queue > // and prevent finalization code for this object > // from executing a second time. > GC.SuppressFinalize(this); > } > // Implement IDisposable. > // Do not make this method virtual. > // A derived class should not be able to override this method. > public void Dispose() > { > Dispose(true); > // This object will be cleaned up by the Dispose method. > // Therefore, you should call GC.SupressFinalize to > // take this object off the finalization queue > // and prevent finalization code for this object > // from executing a second time. > GC.SuppressFinalize(this); > } > // Dispose(bool disposing) executes in two distinct scenarios. > // If disposing equals true, the method has been called > directly > // or indirectly by a user's code. Managed and unmanaged > resources > // can be disposed. > // If disposing equals false, the method has been called by the > // runtime from inside the finalizer and you should not > reference > // other objects. Only unmanaged resources can be disposed. > private void Dispose(bool disposing) > { > // Check to see if Dispose has already been called. > if (!this.disposed) > { > // If disposing equals true, dispose all managed > // and unmanaged resources. > if (disposing) > { > if (mCnn != null) > { > try > { > mCnn.Close(); > } > catch (Exception) > { > } > mCnn.Dispose(); > } > } > > } > disposed = true; > } > #endregion > > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Jul 29 19:35:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 Jul 2010 20:35:49 -0400 Subject: [dba-VB] BCP out, records affected Message-ID: <4C521E65.8070707@colbyconsulting.com> I am running a stored procedure to BCP out a chunk of records. The stored procedure uses exec master..xp_cmdshell @sql to perform the BCP out. Is it possible to get a "records affected" back from command shell ofr the SQL statement executed? If not is there another way to do this? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue Jul 6 04:54:07 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 Jul 2010 11:54:07 +0200 Subject: [dba-VB] Silverlight PivotViewer Message-ID: Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav From shamil at smsconsulting.spb.ru Tue Jul 6 05:17:49 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Jul 2010 14:17:49 +0400 Subject: [dba-VB] Silverlight PivotViewer In-Reply-To: References: Message-ID: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jul 6 18:25:11 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 7 Jul 2010 09:25:11 +1000 Subject: [dba-VB] Silverlight PivotViewer References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Jul 6 23:45:52 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Jul 2010 08:45:52 +0400 Subject: [dba-VB] Silverlight PivotViewer In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: Hi Michael -- Thank you for sharing your experience with AJAX controls - do you mean controls from "ASP.NET AJAX Control Toolkit"? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Jul 7 01:35:32 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 7 Jul 2010 16:35:32 +1000 Subject: [dba-VB] Silverlight PivotViewer References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant><59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5C9D@ddi-01.DDI.local> Yes, that's them. Can't argue with the price... Cheers Michael Hi Michael -- Thank you for sharing your experience with AJAX controls - do you mean controls from "ASP.NET AJAX Control Toolkit"? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Jul 7 10:36:58 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Jul 2010 17:36:58 +0200 Subject: [dba-VB] Silverlight for Symbian Message-ID: Hi all This was new to me: http://www.silverlight.net/getstarted/devices/symbian/ Silverlight, a cross-browser, cross-platform implementation of the .NET Framework for building media experiences and rich interactive applications for the Web on desktop computers, is also available for Nokia S60 5th Edition devices such as Nokia 5800 XpressMusic, Nokia N97 and Nokia N97 Mini. /gustav From accessd at shaw.ca Wed Jul 7 19:37:36 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 7 Jul 2010 17:37:36 -0700 Subject: [dba-VB] Microsoft is supporting HTML 5 via their now F# In-Reply-To: References: Message-ID: HTML 5 has another friend... http://blogs.msdn.com/b/dsyme/archive/2010/06/04/html5-programming-with-f.as px Jim From jwcolby at colbyconsulting.com Fri Jul 9 14:06:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Jul 2010 15:06:48 -0400 Subject: [dba-VB] Suddenly I can see Message-ID: <4C377348.9030103@colbyconsulting.com> I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am building. The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat little light pipe system to display the power and activity on each disk. The disk sleds plug in to a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic light pipes along the side of the sled which pipes the light to the front so it can be seen. Really cool I thought. What this means to me is that for the first time I can actually see which disks are in use. The server "lights up like a Christmas tree" when stuff is actually written to disk. I am now able to actually compare the screen as I run processes, and watch the lights and I'm here to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a burst of disk activity a half second long, then many seconds of crunching, then a half second of disk activity. -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Fri Jul 9 16:40:45 2010 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 09 Jul 2010 23:40:45 +0200 Subject: [dba-VB] Suddenly I can see Message-ID: Hi John Links please? How noisy is this beauty? /gustav >>> jwcolby at colbyconsulting.com 09-07-2010 21:06 >>> I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am building. The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat little light pipe system to display the power and activity on each disk. The disk sleds plug in to a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic light pipes along the side of the sled which pipes the light to the front so it can be seen. Really cool I thought. What this means to me is that for the first time I can actually see which disks are in use. The server "lights up like a Christmas tree" when stuff is actually written to disk. I am now able to actually compare the screen as I run processes, and watch the lights and I'm here to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a burst of disk activity a half second long, then many seconds of crunching, then a half second of disk activity. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 9 17:53:34 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Jul 2010 18:53:34 -0400 Subject: [dba-VB] Suddenly I can see In-Reply-To: References: Message-ID: <4C37A86E.6000200@colbyconsulting.com> Sorry, I thought I did. http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Links please? > How noisy is this beauty? > > /gustav > > >>>> jwcolby at colbyconsulting.com 09-07-2010 21:06 >>> > I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am > building. > > The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat > little light pipe system to display the power and activity on each disk. The disk sleds plug in to > a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic > light pipes along the side of the sled which pipes the light to the front so it can be seen. Really > cool I thought. > > What this means to me is that for the first time I can actually see which disks are in use. The > server "lights up like a Christmas tree" when stuff is actually written to disk. > > I am now able to actually compare the screen as I run processes, and watch the lights and I'm here > to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a > burst of disk activity a half second long, then many seconds of crunching, then a half second of > disk activity. > From shamil at smsconsulting.spb.ru Sat Jul 10 05:18:10 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Jul 2010 14:18:10 +0400 Subject: [dba-VB] AJAX Control Toolkit - Was: RE: Silverlight PivotViewer In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: <33E3D90D14B54B94BB495B3F1BCF1B8C@nant> Hi All -- FYI: (if you do not have that info yet) I have just downloaded and played with AJAX Control Toolkit http://www.asp.net/ajaxlibrary/act.ashx - and it worked very well for me - all 40 controls - the download from CodePlex has a sample ASP.NET project with all that controls: downloading, setting-up and quick playing with AJAX Control Toolkit samples within VS2008 SP1 took less than an hour - everything did work well as described/expected... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sun Jul 11 08:19:46 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 11 Jul 2010 17:19:46 +0400 Subject: [dba-VB] OT: XP, SCRUM etc. - Sunday watch: "Kent Beck: Ease at Work..." Message-ID: Hi All -- I'm watching now Kent Beck's "Ease at Work..." year 2006 recorded webinar, and I like it, so I decided to share its link with you: http://video.google.com/videoplay?docid=7830246530742207581# Kent Beck is "thinking aloud" about a broad set of issues: When was the last time you were comfortable in your "skin" as a programmer ? When was the last time you were comfortable in your "skin" as a programmer *at work* ? Why should I to "turn off" parts of myself to work here? Something is profoundly wrong with a workplace? Something is missing in my personal worldview? Why should I do "magical things" to feel OK as a programmer? Why should I sacrifice myself to the "altar" of technological progress? Why the sense of "ease and comfort" isn't the part of my everyday work as a programmer? ... Thank you. -- Shamil From jwcolby at colbyconsulting.com Tue Jul 13 15:35:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Jul 2010 16:35:33 -0400 Subject: [dba-VB] Access source control Message-ID: <4C3CCE15.6090200@colbyconsulting.com> I am wondering whether we could put together subversion and Access to do source control. Max's eatbloat will export and import most things Access into a directory structure. Subversion could be used to move that stuff into version control. Once in subversion, we might be able to do differencing etc. Whaddayathink? -- John W. Colby www.ColbyConsulting.com From paul.hartland at googlemail.com Thu Jul 15 06:02:19 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 15 Jul 2010 12:02:19 +0100 Subject: [dba-VB] Using VBTablet.dll With vb.net Message-ID: To all, I have a wacom signature tablet, and we have a piece of code that allows our employees to make digital signatures, but dont seem to be able to get it working. The application looks for a flag file (just empty text file called Update.flg) and if it doesn't exist the application runs a bat file copying & registering the VBTablet.dll and WinTab32.dll into their windows\system32 directory, then asks the user to close the application and re-run it. However when anyone tried to run it, they get the message that no tablet devices are detected on the system. I have been working with our helpdesk, using clean laptop images and still cant get it to work for some reason. Has anyone out their had experience of using the VBTablet.dll with a vb.net application, if so could you give me some pointers on what I may be doing wrong etc. Thanks in advance for any help on this, as it is becoming a real headache. -- Paul Hartland paul.hartland at googlemail.com From dw-murphy at cox.net Thu Jul 15 13:23:37 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 15 Jul 2010 11:23:37 -0700 Subject: [dba-VB] Using VBTablet.dll With vb.net In-Reply-To: References: Message-ID: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> Paul, A tablet running Windows tablet PC have the dll's installed natively. There are lots of examples of using the ImageEdit and ImagePicture controls on the internet. In fact if you download the TabletPC SDK there are many examples of using it with .NET apps. Have not heard of the .flg file, it must have something to do with the application installer. For a start look at http://msdn2.microsoft.com/en-us/library/aa813329.aspx. I know this doesn't answer your question, but it may give you a leed on where to look. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Thursday, July 15, 2010 4:02 AM To: VisualBasicList Subject: [dba-VB] Using VBTablet.dll With vb.net To all, I have a wacom signature tablet, and we have a piece of code that allows our employees to make digital signatures, but dont seem to be able to get it working. The application looks for a flag file (just empty text file called Update.flg) and if it doesn't exist the application runs a bat file copying & registering the VBTablet.dll and WinTab32.dll into their windows\system32 directory, then asks the user to close the application and re-run it. However when anyone tried to run it, they get the message that no tablet devices are detected on the system. I have been working with our helpdesk, using clean laptop images and still cant get it to work for some reason. Has anyone out their had experience of using the VBTablet.dll with a vb.net application, if so could you give me some pointers on what I may be doing wrong etc. Thanks in advance for any help on this, as it is becoming a real headache. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From paul.hartland at googlemail.com Fri Jul 16 02:44:54 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 16 Jul 2010 08:44:54 +0100 Subject: [dba-VB] Using VBTablet.dll With vb.net In-Reply-To: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> References: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> Message-ID: Thanks Doug, any help is very much appreciated, it also gave me a couple more different ideas. On 15 July 2010 19:23, Doug Murphy wrote: > Paul, > > A tablet running Windows tablet PC have the dll's installed natively. There > are lots of examples of using the ImageEdit and ImagePicture controls on > the > internet. In fact if you download the TabletPC SDK there are many examples > of using it with .NET apps. Have not heard of the .flg file, it must have > something to do with the application installer. For a start look at > http://msdn2.microsoft.com/en-us/library/aa813329.aspx. I know this > doesn't > answer your question, but it may give you a leed on where to look. > > Doug > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland > Sent: Thursday, July 15, 2010 4:02 AM > To: VisualBasicList > Subject: [dba-VB] Using VBTablet.dll With vb.net > > To all, > > I have a wacom signature tablet, and we have a piece of code that allows > our > employees to make digital signatures, but dont seem to be able to get it > working. > > The application looks for a flag file (just empty text file called > Update.flg) and if it doesn't exist the application runs a bat file copying > & registering the VBTablet.dll and WinTab32.dll into their windows\system32 > directory, then asks the user to close the application and re-run it. > > However when anyone tried to run it, they get the message that no tablet > devices are detected on the system. > > I have been working with our helpdesk, using clean laptop images and still > cant get it to work for some reason. Has anyone out their had experience > of > using the VBTablet.dll with a vb.net application, if so could you give me > some pointers on what I may be doing wrong etc. > > Thanks in advance for any help on this, as it is becoming a real headache. > > -- > Paul Hartland > paul.hartland at googlemail.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From shamil at smsconsulting.spb.ru Sat Jul 17 05:19:48 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 17 Jul 2010 14:19:48 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers Message-ID: Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil From dw-murphy at cox.net Sat Jul 17 13:19:49 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Sat, 17 Jul 2010 11:19:49 -0700 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 17 17:46:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 17 Jul 2010 18:46:33 -0400 Subject: [dba-VB] =?windows-1252?q?Google=92s_Disk_Failure_Experience?= Message-ID: <4C4232C9.9090608@colbyconsulting.com> http://storagemojo.com/2007/02/19/googles-disk-failure-experience/ I had seen this before but it is an interesting read. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 17 22:31:28 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 17 Jul 2010 23:31:28 -0400 Subject: [dba-VB] FAQ: What is MTBF? Message-ID: <4C427590.2000303@colbyconsulting.com> http://www.t-cubed.com/faq_mtbf.htm -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 17 23:01:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 18 Jul 2010 00:01:36 -0400 Subject: [dba-VB] disk drive temps for the Norco 4020 Message-ID: <4C427CA0.4040400@colbyconsulting.com> I bought the Norco 4020 to build a server with. http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product I am impressed with the case, though it is consumer grade. It is tough to work with however. It has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and the disk backplanes. Obviously it is impossible to leave the wall in place and get all of the cables in, but removing the fan wall is a job for a safe cracker. None the less I did so, got 20 disks in and cabled up, then reinserted the fan wall, and then threaded the cables through the holes in the BOTTOM of the fan wall. Why on earth they didn't leave the holes on the top of the fan wall is beyond me but they didn't. Anyway, for the first time tonight I tested temps with all 20 drives inserted and power applied, and the fan wall operating. I ran a defrag on every volume simultaneously in order to cause the disks to work and generate as much heat as I could cause. Below are the temps. CPU Temperature 55 ?C Ctrl Temperature 49 ?C Power +12V 12.099 V Power +5V 5.053 V Power +3.3V 3.328 V SATA PHY +2.5V 2.528 V DDR-II +1.8V 1.872 V PCI-E +1.8V 1.872 V CPU +1.8V 1.856 V CPU +1.2V 1.232 V DDR-II +0.9V 0.928 V Hdd#1 Temperature 37 ?C Hdd#2 Temperature 40 ?C Hdd#3 Temperature 42 ?C Hdd#4 Temperature 39 ?C Hdd#5 Temperature 47 ?C Hdd#6 Temperature 51 ?C Hdd#7 Temperature 49 ?C Hdd#8 Temperature 46 ?C Hdd#9 Temperature 37 ?C Hdd#10 Temperature 49 ?C Hdd#11 Temperature 44 ?C Hdd#12 Temperature 47 ?C Hdd#13 Temperature 45 ?C Hdd#14 Temperature 50 ?C Hdd#15 Temperature 49 ?C Hdd#16 Temperature 42 ?C There are only 16 drives showing because these 16 are cabled up to my Areca raid co-processor card which is a 16 port card, and that card provides a utility to watch these numbers. The other disks are not being driven but do have power applied. I am satisfied with the temps. Several disks actually hit 53 degrees C under max stress but that is acceptable to me. I would like lower temps but I can live with these. BTW I am using the Corsair 750W modular PS which is a NICE PS. http://www.newegg.com/Product/Product.aspx?Item=N82E16817139010 The 12V cables are ribbon cables which makes them very easy to run and minimizes the air flow impedance. With only 2 inches to work with between the fans and disks, I need all the help I can get. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sun Jul 18 02:30:34 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 18 Jul 2010 11:30:34 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Message-ID: Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From garykjos at gmail.com Sun Jul 18 10:09:29 2010 From: garykjos at gmail.com (Gary Kjos) Date: Sun, 18 Jul 2010 10:09:29 -0500 Subject: [dba-VB] [dba-SQLServer] disk drive temps for the Norco 4020 In-Reply-To: <4C427CA0.4040400@colbyconsulting.com> References: <4C427CA0.4040400@colbyconsulting.com> Message-ID: I was reading some of the reviews posted on the Newegg site when you first posted the link to your new server case and it seemed like other people who purchased it were concerned about the heat the disks would be creating due to lack of space between the drives etc. Nice that you can monitor them. Continued good luck with your new server. GK On Sat, Jul 17, 2010 at 11:01 PM, jwcolby wrote: > I bought the Norco 4020 to build a server with. > > http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product > > I am impressed with the case, though it is consumer grade. ?It is tough to work with however. ?It > has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and > the disk backplanes. ?Obviously it is impossible to leave the wall in place and get all of the > cables in, but removing the fan wall is a job for a safe cracker. > > -- Gary Kjos garykjos at gmail.com From jwcolby at colbyconsulting.com Sun Jul 18 10:21:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 18 Jul 2010 11:21:39 -0400 Subject: [dba-VB] [dba-SQLServer] disk drive temps for the Norco 4020 In-Reply-To: References: <4C427CA0.4040400@colbyconsulting.com> Message-ID: <4C431C03.7020503@colbyconsulting.com> Yea, I am one of those concerned. The bottom of the drive sled touches the top of the drive underneath it. Not a lot of room for drawing air through the drive area. One of the things that people are doing (me included) is to duct tape the holes on the bottom of the fan wall to prevent air from circulating in a big circle, and force the maximum air possible to be pulled through the front past the disks. Other than that I am loving the case. It is easy to find cases for lots of disks... if you don't mind paying $2000. I don't have that kind of money so this case is one alternative. If anyone else knows of lost cost cases like this speak up. John W. Colby www.ColbyConsulting.com Gary Kjos wrote: > I was reading some of the reviews posted on the Newegg site when you > first posted the link to your new server case and it seemed like other > people who purchased it were concerned about the heat the disks would > be creating due to lack of space between the drives etc. Nice that you > can monitor them. > > Continued good luck with your new server. > > GK > > On Sat, Jul 17, 2010 at 11:01 PM, jwcolby wrote: >> I bought the Norco 4020 to build a server with. >> >> http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product >> >> I am impressed with the case, though it is consumer grade. It is tough to work with however. It >> has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and >> the disk backplanes. Obviously it is impossible to leave the wall in place and get all of the >> cables in, but removing the fan wall is a job for a safe cracker. >> >> > From dw-murphy at cox.net Sun Jul 18 19:49:45 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Sun, 18 Jul 2010 17:49:45 -0700 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Message-ID: <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> Hello Shamil, It costs nothing to send through the web interface portal numbers. Each provider has a portal. You can not recieve with this method though. If you want to send and recieve possibly the best thing would be a cellular modem and a cheap cell plan for it. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, July 18, 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Jul 19 06:46:32 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 19 Jul 2010 15:46:32 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> Message-ID: <74D815DD703B45F8B957DE8C558934B6@nant> Thank you, Doug, Cellular modems can't be used there - just plain simple mobile phones to send a short SMS message once a day... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, July 19, 2010 4:50 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, It costs nothing to send through the web interface portal numbers. Each provider has a portal. You can not recieve with this method though. If you want to send and recieve possibly the best thing would be a cellular modem and a cheap cell plan for it. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, July 18, 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 19 22:32:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 19 Jul 2010 23:32:44 -0400 Subject: [dba-VB] SCO/Novell suit is over, SCO loses Message-ID: <4C4518DC.9090305@colbyconsulting.com> http://www.crunchgear.com/2010/06/11/sconovell-suit-is-over-sco-loses/ -- John W. Colby www.ColbyConsulting.com From accessd at shaw.ca Tue Jul 20 00:13:55 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 19 Jul 2010 22:13:55 -0700 Subject: [dba-VB] SCO/Novell suit is over, SCO loses In-Reply-To: <4C4518DC.9090305@colbyconsulting.com> References: <4C4518DC.9090305@colbyconsulting.com> Message-ID: That is truly sad. At one time it was the best UNIX Company out there. I was even a certified installers and reseller and made a good coin with their products. The trouble with the UNIX market is that they were all a bunch of warring camps and they were too busy fighting each other while a small company like Microsoft slide out of nowhere and effectively wiped them all out. It did not matter to anyone that UNIX was a superior operating system, it was always much more important to have a good user friendly interface. Presentation has always been more important than functionality. After the great UNIX wars, the intransient companies continued fighting until their own oblivion and to make themselves little more than a foot note in history. You have to go no further your dictionary and look up the word intransient and you will find the SCO icon clearly displayed. UNIX still exists in the mini and main frame but little else. Microsoft did not even fire a shot and watched their only challengers wipe them selves out. But before Microsoft could claim complete world dominance another flavour of UNIX or Linux appeared; stable, powerful and free. Microsoft has claimed that Linux is the single greatest threat to free enterprise system and maybe it is. Fifteen years later and now Microsoft is watching its empire slowly eroding. Its competitors are using a flavour of Linux UNIX like Mac, using Linux to control the internet like Google or moving to their own desktop, like Ubuntu. Will Linux ever dominate the market? No; but neither or ever again will Microsoft. Some say that Linux is not ready for prime time but when your 10 or 12 year old son or daughter can easily install it, the old fears are just that; old fears. SCO Unix on the other hand is an old and dying product, the epitome and poster boy of the UNIX wars. The only SCO I think of now is the producer of a very fine brand of non alcoholic ginger beer of which I would highly recommend to anyone. For you Unix buffs who want to see the turbulent UNIX/Linux world check out the following: http://www.quicklycode.com/wp-content/files/unix_history.png Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 19, 2010 8:33 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] SCO/Novell suit is over, SCO loses http://www.crunchgear.com/2010/06/11/sconovell-suit-is-over-sco-loses/ -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 20 13:28:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 14:28:55 -0400 Subject: [dba-VB] Has anyone used this? Message-ID: <4C45EAE7.4050203@colbyconsulting.com> http://www.dofactory.com/Framework/Framework.aspx -- John W. Colby www.ColbyConsulting.com From ha at phulse.com Tue Jul 20 13:53:50 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Tue, 20 Jul 2010 19:53:50 +0100 Subject: [dba-VB] Has anyone used this? In-Reply-To: <4C45EAE7.4050203@colbyconsulting.com> References: <4C45EAE7.4050203@colbyconsulting.com> Message-ID: This is a joke, right? Hans-Christian Web Application Development, London, UK e: hans.andersen at phulse.com t: +44 (0)782 894 5456 w: http://nokenode.com l: http://uk.linkedin.com/in/andersenhc ------------------------------------------------------ Unique Gifts, Collectables, Artwork ------------------------------------------------------ Come one Come all to www.corinnajasmine.com ------------------------------------------------------ On 20 July 2010 19:28, jwcolby wrote: > http://www.dofactory.com/Framework/Framework.aspx > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jul 20 14:16:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 15:16:48 -0400 Subject: [dba-VB] C# Sysvars Message-ID: <4C45F620.6010807@colbyconsulting.com> In Access I had a system for handling what I call SysVars, which are program global variables, stored in a table, cached as the program opens. SysVar VarID - Int - surrogate key VarName - Str - name of the variable VarVal - Str - Value of the variable VarDescr - Str - description of how the variable is used VarRefresh - Bool - needs to be refreshed before use. This essentially replaces what many developers use, a single record in a table where you add a new field every time you need a new variable (yuk). Just as an example... I have an asynchronous process where I: 1) Send 2 million record chunks of data to files on disk. 2) Ship the chunk files over to a VM input directory for processing 3) Process each file, placing the processed result files in an output directory. 4) Watch the output directory for processed files and ship back to the server 5) Import the chunks back in to SQL Server. The problem is that step 3 takes about 1 hour per file. If I run this process on a large table I can export 30 files to the VM which translates into 30 hours before it finishes processing. If I get a rush order, I need to delete the files in the VM so that they are not clogging up the works and not automatically send those files back to the VM until I say so. I have a SysVar called VMHold which is a true / false, true if hold files going to the vm and false if not. I can set / reset this sysvar through a sysvars class, and it reads / writes the value to the sql server tlbSysVars, caching them in memory as the program opens, refreshing them before use ONLY if the varRefresh is true. That is what I call SysVars and how / why I use them. It seems like everyone would use these for any moderately complex asynchronous or multi-user program. I am looking for feedback on how others implement this functionality. I will write a second email regarding some of the issues I am running into. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 20 14:18:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 15:18:09 -0400 Subject: [dba-VB] Has anyone used this? In-Reply-To: References: <4C45EAE7.4050203@colbyconsulting.com> Message-ID: <4C45F671.5050505@colbyconsulting.com> LOL, they don't think so. Am I missing something? John W. Colby www.ColbyConsulting.com Hans-Christian Andersen wrote: > This is a joke, right? > > Hans-Christian > Web Application Development, London, UK > > e: hans.andersen at phulse.com > t: +44 (0)782 894 5456 > w: http://nokenode.com > l: http://uk.linkedin.com/in/andersenhc > > ------------------------------------------------------ > Unique Gifts, Collectables, Artwork > ------------------------------------------------------ > Come one > Come all to > www.corinnajasmine.com > ------------------------------------------------------ > > > > On 20 July 2010 19:28, jwcolby wrote: > >> http://www.dofactory.com/Framework/Framework.aspx >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From ha at phulse.com Tue Jul 20 16:00:52 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Tue, 20 Jul 2010 22:00:52 +0100 Subject: [dba-VB] Has anyone used this? In-Reply-To: <4C45F671.5050505@colbyconsulting.com> References: <4C45EAE7.4050203@colbyconsulting.com> <4C45F671.5050505@colbyconsulting.com> Message-ID: Perhaps I am the one missing something, but it seems to me that they are selling their code as if it were plug-able modules, when, in reality, design patterns are concepts. Concepts you need to understand before you can use them, in which case, you should be able to write them yourself. Just feels a bit snake oil-ish to me. But that could just be their marketing department advertising it wrong. Hans-Christian Web Application Development, London, UK e: hans.andersen at phulse.com t: +44 (0)782 894 5456 w: http://nokenode.com l: http://uk.linkedin.com/in/andersenhc ------------------------------------------------------ Unique Gifts, Collectables, Artwork ------------------------------------------------------ Come one Come all to www.corinnajasmine.com ------------------------------------------------------ On 20 July 2010 20:18, jwcolby wrote: > LOL, they don't think so. > > Am I missing something? > > John W. Colby > www.ColbyConsulting.com > > > Hans-Christian Andersen wrote: > > This is a joke, right? > > > > Hans-Christian > > Web Application Development, London, UK > > > > e: hans.andersen at phulse.com > > t: +44 (0)782 894 5456 > > w: http://nokenode.com > > l: http://uk.linkedin.com/in/andersenhc > > > > ------------------------------------------------------ > > Unique Gifts, Collectables, Artwork > > ------------------------------------------------------ > > Come one > > Come all to > > www.corinnajasmine.com > > ------------------------------------------------------ > > > > > > > > On 20 July 2010 19:28, jwcolby wrote: > > > >> http://www.dofactory.com/Framework/Framework.aspx > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jul 20 18:10:35 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 19:10:35 -0400 Subject: [dba-VB] Has anyone used this? In-Reply-To: References: <4C45EAE7.4050203@colbyconsulting.com> <4C45F671.5050505@colbyconsulting.com> Message-ID: <4C462CEB.6080305@colbyconsulting.com> >when, in reality, design patterns are concepts. Concepts you need to understand before you can use them in which case, you should be able to write them yourself. I can understand SQL Server but I don't want to write a database. >Just feels a bit snake oil-ish to me. But that could just be their marketing department advertising it wrong. And so I ask... is anyone actually using this... John W. Colby www.ColbyConsulting.com Hans-Christian Andersen wrote: > Perhaps I am the one missing something, but it seems to me that they are > selling their code as if it were plug-able modules, when, in reality, design > patterns are concepts. Concepts you need to understand before you can use > them, in which case, you should be able to write them yourself. Just feels a > bit snake oil-ish to me. But that could just be their marketing department > advertising it wrong. > > > Hans-Christian > Web Application Development, London, UK > > e: hans.andersen at phulse.com > t: +44 (0)782 894 5456 > w: http://nokenode.com > l: http://uk.linkedin.com/in/andersenhc > > ------------------------------------------------------ > Unique Gifts, Collectables, Artwork > ------------------------------------------------------ > Come one > Come all to > www.corinnajasmine.com > ------------------------------------------------------ > > > > On 20 July 2010 20:18, jwcolby wrote: > >> LOL, they don't think so. >> >> Am I missing something? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Hans-Christian Andersen wrote: >>> This is a joke, right? >>> >>> Hans-Christian >>> Web Application Development, London, UK >>> >>> e: hans.andersen at phulse.com >>> t: +44 (0)782 894 5456 >>> w: http://nokenode.com >>> l: http://uk.linkedin.com/in/andersenhc >>> >>> ------------------------------------------------------ >>> Unique Gifts, Collectables, Artwork >>> ------------------------------------------------------ >>> Come one >>> Come all to >>> www.corinnajasmine.com >>> ------------------------------------------------------ >>> >>> >>> >>> On 20 July 2010 19:28, jwcolby wrote: >>> >>>> http://www.dofactory.com/Framework/Framework.aspx >>>> >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-VB mailing list >>>> dba-VB at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From gustav at cactus.dk Wed Jul 21 01:10:12 2010 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 21 Jul 2010 08:10:12 +0200 Subject: [dba-VB] Low Cost Worldwide SMS providers Message-ID: Hi Shamil Skype? Would require the Skype client to be installed though. /gustav >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil From pcs.accessd at gmail.com Wed Jul 21 01:20:30 2010 From: pcs.accessd at gmail.com (Borge Hansen) Date: Wed, 21 Jul 2010 16:20:30 +1000 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: Hi Shamil, www.exetel.com.au is an australian communications company. They currently offer sms to local (Australian) numbers for A$0.05 per sms International sms is A$.088 (8.8 cents) They have an api so you can incorporate sending sms into your application. check it out.... Their order form for (residential) low cost sms is https://www.exetel.com.au/sms/sms_order1.php This is for a pre-paid account - pay A$10 and test it out.... I am currently testing it out myself. Regards Borge Hansen, Gold Coast, Australia On Wed, Jul 21, 2010 at 4:10 PM, Gustav Brock wrote: > Hi Shamil > > Skype? > Would require the Skype client to be installed though. > > /gustav > > >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> > Hi All -- > > I'm looking for a low cost worldwide two-way SMS provider to be integrated > in my customer's application: > > Google search: > > http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide > rs&aq=f&aqi=&aql=&oq=&gs_rfai= > > > has returned the following links: > > 1. http://www.clickatell.com/products/two_way.php > 2. http://www.ficall.com/english/#/ficall/about > 3. http://www.animatele.com/index.html > > > The first one - Clickatell - seems to be a good option. Do you have any > experience in working with Clickatell? Do you know and successfully used > any > other low cost worldwide SMS providers in your applications? > > > Thank you. > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Jul 21 07:42:05 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Jul 2010 08:42:05 -0400 Subject: [dba-VB] Friday Humor Message-ID: <4C46EB1D.40605@colbyconsulting.com> One year, I decided to buy my mother-in-law a cemetery plot as a Christmas gift... The next year, I didn't buy her a gift. When she asked me why, I replied, "Well, you still haven't used the gift I bought you last year!" And that's how the fight started..... ______________________________ My wife and I were watching Who Wants To Be A Millionaire while we were in bed. I turned to her and said, 'Do you want to have Sex?' 'No,' she answered. I then said, 'Is that your final answer?' She didn't even look at me this time, simply saying, 'Yes..' So I said, "Then I'd like to phone a friend." And that's when the fight started... ________________________________ I took my wife to a restaurant. The waiter, for some reason, took my order first. "I'll have the rump steak, rare, please." He said, "Aren't you worried about the mad cow?" "Nah, she can order for herself." And that's when the fight started..... ________________________________ My wife and I were sitting at a table at her high school reunion, and she kept staring at a drunken man swigging his drink as he sat alone at a nearby table. I asked her, "Do you know him?" "Yes", she sighed, "He's my old boyfriend.... I understand he took to drinking right after we split up those many years ago, and I hear he hasn't been sober since." "My God!" I said, "Who would think a person could go on celebrating that long?" And then the fight started... ________________________________ When our lawn mower broke and wouldn't run, my wife kept hinting to me that I should get it fixed. But, somehow I always had something else to take care of first, the shed, the boat, making beer.. Always something more important to me. Finally she thought of a clever way to make her point. When I arrived home one day, I found her seated in the tall grass, busily snipping away with a tiny pair of sewing scissors. I watched silently for a short time and then went into the house.. I was gone only a minute, and when I came out again I handed her a toothbrush. I said, "When you finish cutting the grass, you might as well sweep the driveway." The doctors say I will walk again, but I will always have a limp. ________________________________ My wife sat down next to me as I was flipping channels. She asked, "What's on TV?" I said, "Dust." And then the fight started... ________________________________ Saturday morning I got up early, quietly dressed, made my lunch, and slipped quietly into the garage. I hooked up the boat up to the van, and proceeded to back out into a torrential downpour. The wind was blowing 50 mph, so I pulled back into the garage, turned on the radio, and discovered that the weather would be bad all day. I went back into the house, quietly undressed, and slipped back into bed.. I cuddled up to my wife's back, now with a different anticipation, and whispered, "The weather out there is terrible." My loving wife of 5 years replied, "And, can you believe my stupid husband is out fishing in that?" And that's how the fight started... ________________________________ My wife was hinting about what she wanted for our upcoming anniversary. She said, "I want something shiny that goes from 0 to 150 in about 3 seconds." I bought her a bathroom scale. And then the fight started...... ________________________________ After retiring, I went to the Social Security office to apply for Social Security. The woman behind the counter asked me for my driver's License to verify my age. I looked in my pockets and realized I had left my wallet at home. I told the woman that I was very sorry, but I would have to go home and come back later. The woman said, 'Unbutton your shirt'. So I opened my shirt revealing my curly silver hair. She said, 'That silver hair on your chest is proof enough for me' and she processed my Social Security application.. When I got home, I excitedly told my wife about my experience at the Social Security office... She said, 'You should have dropped your pants. You might have gotten disability, too.' And then the fight started... ________________________________ My wife was standing nude, looking in the bedroom mirror. She was not happy with what she saw and said to me, "I feel horrible; I look old, fat and ugly. I really need you to pay me a compliment.' I replied, "Your eyesight's damn near perfect." And then the fight started........ -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:43:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:43:25 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <11C05396010D46A7AA66094042A83C48@nant> Hi Gustav -- No, Skype can't be used AFAIU - "front-end" SMS sending device could be just a simple mobile phone... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 21, 2010 10:10 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hi Shamil Skype? Would require the Skype client to be installed though. /gustav >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:43:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:43:25 +0400 Subject: [dba-VB] C# Sysvars In-Reply-To: <4C45F620.6010807@colbyconsulting.com> References: <4C45F620.6010807@colbyconsulting.com> Message-ID: <2D6B3569445A4B7F8DE277D5B0FC87F7@nant> Hi John -- You probably mean handling "Locking and Thread Safety" http://www.albahari.com/threading/part2.aspx#_Locking or "best practices" in implementing of Singleton pattern http://www.yoda.arachsys.com/csharp/singleton.html while using your Sysvars ? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 20, 2010 11:17 PM To: VBA Subject: [dba-VB] C# Sysvars In Access I had a system for handling what I call SysVars, which are program global variables, stored in a table, cached as the program opens. SysVar VarID - Int - surrogate key VarName - Str - name of the variable VarVal - Str - Value of the variable VarDescr - Str - description of how the variable is used VarRefresh - Bool - needs to be refreshed before use. This essentially replaces what many developers use, a single record in a table where you add a new field every time you need a new variable (yuk). Just as an example... I have an asynchronous process where I: 1) Send 2 million record chunks of data to files on disk. 2) Ship the chunk files over to a VM input directory for processing 3) Process each file, placing the processed result files in an output directory. 4) Watch the output directory for processed files and ship back to the server 5) Import the chunks back in to SQL Server. The problem is that step 3 takes about 1 hour per file. If I run this process on a large table I can export 30 files to the VM which translates into 30 hours before it finishes processing. If I get a rush order, I need to delete the files in the VM so that they are not clogging up the works and not automatically send those files back to the VM until I say so. I have a SysVar called VMHold which is a true / false, true if hold files going to the vm and false if not. I can set / reset this sysvar through a sysvars class, and it reads / writes the value to the sql server tlbSysVars, caching them in memory as the program opens, refreshing them before use ONLY if the varRefresh is true. That is what I call SysVars and how / why I use them. It seems like everyone would use these for any moderately complex asynchronous or multi-user program. I am looking for feedback on how others implement this functionality. I will write a second email regarding some of the issues I am running into. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:46:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:46:39 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <6EC65E2729FD472AA1A5AC2B5534B318@nant> Thank you, Borge. Yes, that seems to be a good option to send SMS from computers but as I noted here in my customer case "front-end" is a simple mobile phone they use once a day (every day) to send just one SMS message - and that "front-ends" can be located everywhere in this small world - and they wanted SMS sending costs to be as low as possible - the companies as Clickatel (http://www.clickatell.com/products/two_way.php ) AFAIU have special agreements with many countries SMS providers to get local SMS messages sent to special mobile numbers transferred to Clickatel servers where from they can be retrieved many ways - now using computers... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Wednesday, July 21, 2010 10:21 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hi Shamil, www.exetel.com.au is an australian communications company. They currently offer sms to local (Australian) numbers for A$0.05 per sms International sms is A$.088 (8.8 cents) They have an api so you can incorporate sending sms into your application. check it out.... Their order form for (residential) low cost sms is https://www.exetel.com.au/sms/sms_order1.php This is for a pre-paid account - pay A$10 and test it out.... I am currently testing it out myself. Regards Borge Hansen, Gold Coast, Australia On Wed, Jul 21, 2010 at 4:10 PM, Gustav Brock wrote: > Hi Shamil > > Skype? > Would require the Skype client to be installed though. > > /gustav > > >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> > Hi All -- > > I'm looking for a low cost worldwide two-way SMS provider to be integrated > in my customer's application: > > Google search: > > http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide > rs&aq=f&aqi=&aql=&oq=&gs_rfai= > > > has returned the following links: > > 1. http://www.clickatell.com/products/two_way.php > 2. http://www.ficall.com/english/#/ficall/about > 3. http://www.animatele.com/index.html > > > The first one - Clickatell - seems to be a good option. Do you have any > experience in working with Clickatell? Do you know and successfully used > any > other low cost worldwide SMS providers in your applications? > > > Thank you. > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:48:56 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:48:56 +0400 Subject: [dba-VB] Friday Humor In-Reply-To: <4C46EB1D.40605@colbyconsulting.com> References: <4C46EB1D.40605@colbyconsulting.com> Message-ID: <757355B821DE4FC3801B82FAA593A52C@nant> LOL. Is it Friday there already? :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 21, 2010 4:42 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] Friday Humor ... My wife sat down next to me as I was flipping channels. She asked, "What's on TV?" I said, "Dust." And then the fight started... ... -- John W. Colby www.ColbyConsulting.com _______________________________________________ From andy at minstersystems.co.uk Wed Jul 21 09:58:00 2010 From: andy at minstersystems.co.uk (Andrew Lacey) Date: Wed, 21 Jul 2010 15:58:00 +0100 (BST) Subject: [dba-VB] Friday Humor In-Reply-To: <757355B821DE4FC3801B82FAA593A52C@nant> References: <4C46EB1D.40605@colbyconsulting.com> <757355B821DE4FC3801B82FAA593A52C@nant> Message-ID: <1958596177.20915.1279724280879.JavaMail.open-xchange@oxltgw14.schlund.de> Nah, but it's quiet. Good one JC. ? Andy On 21 July 2010 at 16:48 Shamil Salakhetdinov wrote: > LOL. > > Is it Friday there already? :) > > -- Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, July 21, 2010 4:42 PM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] Friday Humor > > ... > > My wife sat down next to me as I was flipping channels. > She asked, "What's on TV?" > I said, "Dust." > And then the fight started... > > > ... > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Thu Jul 22 23:36:58 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 00:36:58 -0400 Subject: [dba-VB] C# custom exceptions Message-ID: <4C491C6A.7080306@colbyconsulting.com> I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 00:11:31 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 01:11:31 -0400 Subject: [dba-VB] try catch finally Message-ID: <4C492483.4020203@colbyconsulting.com> OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Fri Jul 23 00:19:57 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:19:57 +1000 Subject: [dba-VB] C# custom exceptions References: <4C491C6A.7080306@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> Hi John, Check out NLog for your logging requirements. It is comprehensive and free. http://nlog-project.org/ It will write logs to just about anywhere including SQL. My take on error handling in.net is to 1st Avoid exceptions ie test for null before using the object. 2nd Use supplied methods to avoid exceptions ie If !File.Exists("C:\test.txt") ... 3rd Use supplied object exceptions ie Catch ( FileNotFound e) You will know what errors you can recover from and what is fatal to your application. Unhandled exceptions bubble up to a handler, if there is no handler it will throw an error in your Main sub. You can catch unhandled errors there, including threading errors. This is how I handled unhandled thread exceptions, with logging, in a recent app. /// /// The main entry point for the application. /// [STAThread] static void Main ( ) { Application.ThreadException += new ThreadExceptionEventHandler ( Application_ThreadException ); bool createdNew = true; using ( Mutex mutex = new Mutex ( true, "EZHL7", out createdNew ) ) { if ( createdNew ) { Application.EnableVisualStyles ( ); Application.SetCompatibleTextRenderingDefault ( false ); Application.Run ( new FormMain ( ) ); } } } static void Application_ThreadException ( object sender, ThreadExceptionEventArgs e ) { Logger logger = MyLogManager.Instance.GetCurrentClassLogger ( ); logger.FatalException ( "Unhandled Thread Error!", e.Exception ); Application.Restart ( ); } HTH Cheers Michael M PS Looking at the subject line, yes you can create your own custom errors for your custom classes. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, 23 July 2010 2:37 PM To: VBA Subject: [dba-VB] C# custom exceptions I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 23 00:25:49 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:25:49 +1000 Subject: [dba-VB] try catch finally References: <4C492483.4020203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6F@ddi-01.DDI.local> Coding in Outlook so watch out :-) OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection --> Open connection --> if connection open { open a new reader -->If reader.hasrows(); { Do something with the reader close the reader close the connection } } } } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { -->I rarely use this } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 23 00:57:00 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:57:00 +1000 Subject: [dba-VB] try catch finally References: <4C492483.4020203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D70@ddi-01.DDI.local> BTW, The finally is executed before the error bubbles up to calling method. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, 23 July 2010 3:12 PM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 23 08:03:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 09:03:49 -0400 Subject: [dba-VB] C# custom exceptions In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> References: <4C491C6A.7080306@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> Message-ID: <4C499335.5010600@colbyconsulting.com> Oh my, studying this carefully! Moving all logging to this would be an awesome thing. Thanks. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Hi John, > > Check out NLog for your logging requirements. It is comprehensive and > free. > http://nlog-project.org/ > It will write logs to just about anywhere including SQL. > > My take on error handling in.net is to > 1st Avoid exceptions ie test for null before using the object. > 2nd Use supplied methods to avoid exceptions ie If > !File.Exists("C:\test.txt") ... > 3rd Use supplied object exceptions ie Catch ( FileNotFound e) > > You will know what errors you can recover from and what is fatal to your > application. > Unhandled exceptions bubble up to a handler, if there is no handler it > will throw an error in your Main sub. > You can catch unhandled errors there, including threading errors. > > This is how I handled unhandled thread exceptions, with logging, in a > recent app. > > /// > /// The main entry point for the application. > /// > [STAThread] > static void Main ( ) > { > Application.ThreadException += new > ThreadExceptionEventHandler ( Application_ThreadException ); > > bool createdNew = true; > using ( Mutex mutex = new Mutex ( true, "EZHL7", out > createdNew ) ) > { > if ( createdNew ) > { > Application.EnableVisualStyles ( ); > Application.SetCompatibleTextRenderingDefault ( > false ); > Application.Run ( new FormMain ( ) ); > } > } > } > > static void Application_ThreadException ( object sender, > ThreadExceptionEventArgs e ) > { > Logger logger = MyLogManager.Instance.GetCurrentClassLogger > ( ); > logger.FatalException ( "Unhandled Thread Error!", > e.Exception ); > Application.Restart ( ); > } > > HTH > > Cheers > > Michael M > > PS Looking at the subject line, yes you can create your own custom > errors for your custom classes. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, 23 July 2010 2:37 PM > To: VBA > Subject: [dba-VB] C# custom exceptions > > I am trying to find info on how and when where and why to use custom > exceptions and particularly how to log them. > > I am developing a system which uses four asynchronous processes. > > Stage 1) Export a SQL table or view to address validation. I have a > table that has records which tell stage 1 the name of the database, view > to export, date to process, directory on disk and a few other things. > > Stage 1 creates text files on disk in a staging directory, one file for > each 2 million records exported. This creates a record in a log table > with the PK of stage 1 table, name of the database, view exported, > directory on disk (output staging directory), file name, and some date > flags to monitor completion of the remaining stages. IOW one log file > per text file exported, all info needed for the remaining stages, date > fields for each remaining stage to log that it processed that file. > > Stage 2) Move the files in the staging directory to a virtual machine. > The log files created by stage 1 are read and used to move the files and > set a datetime flag in the log record saying that stage 2 completed (the > file moved to VM). The virtual machine may not be available, but if it > is the file moves and the log record is updated. If the file goes to the > VM, the VM will process the file and place it in an output directory. > This will take between 1/2 hour and 1 hour per file. > > Stage 3) Move the completed files from the VM back to a different > (input) staging directory. Again, the log file is used to determine > what files should be available on the VM and if found and moved, a > datetime flag is set saying that file was moved back from the VM back to > the Input Staging Directory. > > Stage 4) Import the files from the input staging directory back into SQL > server. The log record for any file moved back in is marked with a > datetime flag saying that the file was imported back in to SQL server. > > I have about a dozen or so "data" tables which have to be processed > monthly, rain or shine. By placing records in the stage 1 source table, > I can cause the system to process each of my data tables. As the > process finishes, it creates a new record adding a "number of days to > next process" > to the date so that it is queued to process again in X days. > > I also have orders that I run that will write one or more records into > this same table and cause their data to process. > > So... nicely divided, asynchronous process: Sql to Staging, Staging to > VM, VM to staging, Staging in to SQL Server. These things must be > asynchronous because the VM may or may not be available, and it is > critical that each file is processed through each stage and tracked. > > Records in the main table triggers the process (stage 1). Records in > the log table track stages 2-4 for each file created in stage 1. > > I want to run 4 threads to do these processes. IOW, a process just runs > on the server (or somewhere, but probably eventually on the server). > Each stage is entirely independent, and takes its input from a table, > and writes a datetime flag as it finishes. > > > OK, so back to exceptions... > > I am new to threads. I wrote the code from the bottom up, with working > processes for doing each of the 4 stages, but triggered by button > clicks. It all worked, except that it wasn't table driven (of course). > I even had each button click create a worker thread and that worked. > > I created a supervisor class, with four methods, one for each stage. I > moved the button click code to these methods. I fired each of them up, > and it mostly works... each stage is running in its own thread and > watching the tables, updating the records as each does its thing. > Except that I would get weird errors that were not handled by any > exception handler. > > I removed all traces of messagebox.show and I *think* I have caused that > to go away. Or maybe not, who knows. > > But now I really need to get errors logged. > > Again, I am new to threading, and new to custom exceptions. New to > exception logging. Do I sound like a nubee? ;) > > Anyway, I do not particularly want to use the Windows error log because > then the error logs would be scattered around on whatever machine the > parts run on. Remember that there is a user interface part which sets > up the records in stage 1 and monitors the process. > > This is potentially a nice little system but it has to be done right or > I will fight it for the rest of my career. So I need to learn > exceptions, and I need to log the exceptions, my preference is into SQL > Server, though there are of course some potential errors (SQL server > errors) which could not be logged there because SQL server isn't > available at the instant the log is created. > > Kinda messy. > > Any pointers, articles, books, or other sources of information I could > go to to learn this stuff. > Google is not my friend in this case because I am getting stuff from > 2003 to the present and I really want modern code. > > Help! > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Jul 23 12:19:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 13:19:36 -0400 Subject: [dba-VB] C# NLog setup Message-ID: <4C49CF28.3070801@colbyconsulting.com> Can anyone step me through setting NLog up to do logging. I don't care where the destination is (file or database) I just want to get it working and starting to use it and able to look at the files, then I will go back and tweak it later. I can be dense sometimes but the initial setup seems a little arcane. Any help appreciated -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Jul 23 12:21:58 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Jul 2010 21:21:58 +0400 Subject: [dba-VB] C# custom exceptions In-Reply-To: <4C491C6A.7080306@colbyconsulting.com> References: <4C491C6A.7080306@colbyconsulting.com> Message-ID: <04E9EE312E584A37B93EBA3B1A2BD23A@nant> Hi John -- Just follow KISS principle - I used to use that principle to profile/log applications with up to one hundred threads - and I never had any issues. I do just log to a simple text file log shared by all threads, and I put lock around log text record write operation: System.IO.File.AppendAllText(...) (If you expect that putting a lock on such a simple file write operation will somehow influence badly your multi-threaded application then you can develop a code for a special utility thread handling log writes using .NET Enqueue / Dequeue features (http://msdn.microsoft.com/en-us/library/1c8bzx97.aspx ) but do not introduce that complexity from the very beginning...) I must note that nor I nor my customers usually do not care about keeping logs history - so log file records are just getting lost after several days overwritten by the new ones: the code does make log backup into a .bak file after main log file gets several MB in size - we do use log in the cases of runtime errors/bugs/other issues and one day log is usually more than enough to find and fix the issues... In your case if you wanted to log into MS SQL DB - just do it if it's available (I do use simple SP in such cases), if it's not available do log into a text file, and if the latter isn't available (e.g. no disk space) - then do log into Windows System Application Events log - one can even try to send an e-mail message using SMTP or log into a Web Service or FTP site - all that is relatively simple to do in .NET but when simple text log works well why bother about advanced logging options? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 8:37 AM To: VBA Subject: [dba-VB] C# custom exceptions I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Jul 23 13:05:08 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Jul 2010 22:05:08 +0400 Subject: [dba-VB] try catch finally In-Reply-To: <4C492483.4020203@colbyconsulting.com> References: <4C492483.4020203@colbyconsulting.com> Message-ID: <29E411AB69F94BEAAD0F7CDC492E8D19@nant> Hi John, Yes, you can dimension connection and reader object variables outside the try/catch block - something like it is done by the code in P.S. of this posting. If you have unhandled exception in your worker thread then it completes abnormally but your main thread continues running OK, still you'd better have all your worker thread exceptions handled gracefully and returning some failing code to the main thread in the case of runtime errors... Throw call issued and executed in catch block does immediately return control/"bubles" to the nearest try/catch block in the call stack, and if there is no any then worker or main thread crash... HTH, -- Shamil P.S. static void Main(string[] args) { try { tryCatchFinally(); } catch (Exception ex) { System.Console.WriteLine("Runtime.Error: " + ex.Message); } } public static void tryCatchFinally() { string serverName = @"MyServer\MySQLServer"; string databaseName = "MyDb"; SqlConnection cnn = null; SqlCommand cmd = null; SqlDataReader rdr = null; string connectionString = string.Format( @"Data Source={0};Initial Catalog={1};Integrated Security=True", serverName, databaseName); try { string cmdText = "select * from [Users]"; cnn = new SqlConnection(connectionString); cnn.Open(); cmd = new SqlCommand(cmdText, cnn); rdr = cmd.ExecuteReader(); while (rdr.Read()) { System.Console.WriteLine("{0} {1} {2}", rdr[0], rdr[1], rdr[2]); } } catch (SqlException ex) { if (cnn != null) System.Console.WriteLine("tryCatchFinally.SQL: {0} {1} {2}", cnn.WorkstationId, cnn.State, ex.Message); throw; } catch (Exception ex) { if (cnn != null) System.Console.WriteLine("tryCatchFinally.Runtime: {0} {1} {2}", cnn.WorkstationId, cnn.State, ex.Message); throw; } finally { if (rdr != null) rdr.Close(); if (cnn != null) cnn.Close(); } } -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 9:12 AM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Fri Jul 23 13:13:32 2010 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 23 Jul 2010 14:13:32 -0400 Subject: [dba-VB] try catch finally In-Reply-To: <4C492483.4020203@colbyconsulting.com> References: <4C492483.4020203@colbyconsulting.com> Message-ID: John, You are correct that you do have to dimension the connection and reader before the try. The Finally block executes whether an error is encountered or not. A good developer always makes sure the garbage got taken care of on the way out the door. The suggestion of checking that the connection did get opened before you execute the rest of the code isn't a bad idea. However, things can still go wrong once the reader/connection are opened and I've personally seen cases where the server-side still sees the connection as open even though the client-side thinks it is gone. Instead of handling the error and then throwing the exception up to the calling block, why not use Functions instead of Procedures and pass back a Boolean indicating whether the operation was successful. Doris Manning Sr. Developer & Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 1:12 AM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 23 14:05:14 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:05:14 -0400 Subject: [dba-VB] C# - what am I doing wrong here? Message-ID: <4C49E7EA.2000609@colbyconsulting.com> OK so I want to do the right thing, I just don't know how. 8( In the following code, I want to declare the connection and command object outside the try, initialize the two objects inside of a try, catch any errors, and finally cleanup. The objects in the finally say that they were never initialized. If I put them inside of the try, it complains that the objects aren't valid in the scope of the finally. If I initialize them outside of the try it isn't using a try and errors will not be handled. It seems that I am damned any way I look at this. namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn; SqlCommand myCommand; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { myCommand.Dispose(); mCnn.Close(); } } } } -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 14:47:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:47:15 -0400 Subject: [dba-VB] Oh man, I love this piece Message-ID: <4C49F1C3.1030708@colbyconsulting.com> If it worked... but it doesn't. What a MESS! http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 14:51:13 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:51:13 -0400 Subject: [dba-VB] C# - but what happened to catch? Message-ID: <4C49F2B1.3060600@colbyconsulting.com> http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 15:07:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 16:07:55 -0400 Subject: [dba-VB] c# so FINALLY ? Message-ID: <4C49F69B.2030403@colbyconsulting.com> The version that seems to addre4ss all of the issues: namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } } } What do you do with the command object? Does it need cleanup handling at all? It doesn't have a close method, though it does have a dispose method. And finally (pun intended) what should I do with this method? Return a boolean true = worked? But WHERE? The finally will execute whether the function "worked" or not. AFTER the finally block? As I understand it that code would ONLY execute if the catch statements do not throw an error? A throw does exit the function never to return correct? Should I log (write to a log file) BEFORE the throw? This is "closest to the error" and I can pass additional info about the context. Or should I just continuously throw it all the way up to the top and log everything at the very top? (mutters under breath - "I will learn this stuff") -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Jul 24 00:16:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 09:16:12 +0400 Subject: [dba-VB] C# - but what happened to catch? In-Reply-To: <4C49F2B1.3060600@colbyconsulting.com> References: <4C49F2B1.3060600@colbyconsulting.com> Message-ID: John, You can make it like that also: using (reader = file.OpenText()) { reader.Read(source, 0, length); } Then 'finally' code block will not be needed as reader will be "automagically" closed by its IDispose call on exit of using code block... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 11:51 PM To: VBA Subject: [dba-VB] C# - but what happened to catch? http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Jul 24 00:16:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 09:16:12 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C49F69B.2030403@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com> Message-ID: <39CF9897AAF846D49115A5F2A38041F4@nant> Hi John -- Dispose does all the clean-up for SqlCommand object instance... It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside catch blocks... Such methods do usually return "RecordAffected" value if that needed by the callers, some other execution stats, or nothing... <<< Or should I just continuously throw it all the way up to the top and log everything at the very top? >>> Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; - return to the highest position in the call stack where you can gracefully continue your application execution, or quit your app with a user-friendly error message... Logging all the way up to the top of the call stack would be similar to On Error GoTo ... VB6/VBA approach - that one proved itself to be a professional approach for VB6/VBA but for C#/VB.NET it's usually considered as a timid, pavid, apprehensive and too expensive (in many areas) to be true approach, e.g. do you take into account that try/catch/finally do influence your code execution speed so putting them everywhere could degrade your code performance?... Code instrumentation/logging/profiling is usually done while going down to the call stack, and .NET has special instrumentation classes, which can be used to organize as detailed as needed logging depending on current application settings... After all - your application usually work or crash when deployed? - if the latter then whatever advanced logging/code instrumentation approach you'll use you'll anyway loose your customers (pun not intended)... Be courageous! Forget "VB6/VBA timidity", recall your best times when you've been a "code cowboy" but do use Unit Testing (at least) - then you'll make your coding style light, your code running lightning fast and still being "bullet-proof"... Thank you. :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 12:08 AM To: VBA Subject: [dba-VB] c# so FINALLY ? The version that seems to addre4ss all of the issues: namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } } } What do you do with the command object? Does it need cleanup handling at all? It doesn't have a close method, though it does have a dispose method. And finally (pun intended) what should I do with this method? Return a boolean true = worked? But WHERE? The finally will execute whether the function "worked" or not. AFTER the finally block? As I understand it that code would ONLY execute if the catch statements do not throw an error? A throw does exit the function never to return correct? Should I log (write to a log file) BEFORE the throw? This is "closest to the error" and I can pass additional info about the context. Or should I just continuously throw it all the way up to the top and log everything at the very top? (mutters under breath - "I will learn this stuff") -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 24 04:26:02 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 05:26:02 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <39CF9897AAF846D49115A5F2A38041F4@nant> References: <4C49F69B.2030403@colbyconsulting.com> <39CF9897AAF846D49115A5F2A38041F4@nant> Message-ID: <4C4AB1AA.2040100@colbyconsulting.com> Shamil, Thanks for your reply. C#, .Net and Visual Studio are very complex and I have so much to learn. And I have to make a living while I am learning, and I am trying to teach a young fellow that works for me what little I know as well. I need more information from you. I have two specific things I am trying to implement and make sure that I "cleanup" correctly. The first is that I have a ton of places in my code where I am using SQL Server records for table driven processes. As such I need to: 1) Work with data readers, looping through records. 2) Work with command objects doing .ExecuteNonQuery() to perform updates on flags. In both these scenarios I want to make sure that I open the connection, open the command object, do whatever the command object is going to do, close the connection, and cleanup the command object. And I want (am trying) to do this in a single place so that I get consistent object handling / cleanup. So, for example I use a static method of a class: public static bool ExecNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } return true; } > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? > It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside of catch blocks OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. And of course I need a reliable logger so that I can go see any errors. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Dispose does all the clean-up for SqlCommand object instance... > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has > > throw > > calls inside catch blocks... > > Such methods do usually return "RecordAffected" value if that needed by the > callers, some other execution stats, or nothing... > > <<< > Or should I just continuously throw > it all the way up to the top > and log everything at the very top? > Again follow KISS-principle: > - log exceptions as close as possible to the point where they appeared; > - return to the highest position in the call stack where you can gracefully > continue your application execution, or quit your app with a user-friendly > error message... > > Logging all the way up to the top of the call stack would be similar to > > On Error GoTo ... > > VB6/VBA approach - that one proved itself to be a professional approach for > VB6/VBA but for C#/VB.NET it's usually considered as a timid, pavid, > apprehensive and too expensive (in many areas) to be true approach, e.g. do > you take into account that try/catch/finally do influence your code > execution speed so putting them everywhere could degrade your code > performance?... > > Code instrumentation/logging/profiling is usually done while going down to > the call stack, and .NET has special instrumentation classes, which can be > used to organize as detailed as needed logging depending on current > application settings... > > After all - your application usually work or crash when deployed? - if the > latter then whatever advanced logging/code instrumentation approach you'll > use you'll anyway loose your customers (pun not intended)... > > Be courageous! Forget "VB6/VBA timidity", recall your best times when you've > been a "code cowboy" but do use Unit Testing (at least) - then you'll make > your coding style light, your code running lightning fast and still being > "bullet-proof"... > > Thank you. :) > > -- Shamil From jwcolby at colbyconsulting.com Sat Jul 24 06:33:26 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 07:33:26 -0400 Subject: [dba-VB] NLog assistance Message-ID: <4C4ACF86.6050707@colbyconsulting.com> I am still looking for anyone on the list that uses NLog that can help me get it sorking initially. My confusion is in how to set it up. The help discusses setting an XML file, and I have found about 40 different versions of that file out on Google, but I am not sure where I go to edit it. My solution has several projects, and I assume that I have to do an XML config file in each project? I would prefer ONE for the solution but I will do what it takes. This appears to be one of those "you can't use it until you know how to use it" things. Just a few words of advice might be enough to get me going. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 24 09:41:10 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 10:41:10 -0400 Subject: [dba-VB] NLog making progress Message-ID: <4C4AFB86.4030305@colbyconsulting.com> OK, so it appears that I am making progress. I found an online tutorial http://nlog-project.org/wiki/Tutorial#Installing_NLog which got me set up and working on one project. Basically after referencing in the project and using in the class, I insert something like: Logger nlog = LogManager.GetLogger("clsAZLog"); in the header of each class. My question is, is there any syntax that could give me the name of the class? IOW: Logger nlog = LogManager.GetLogger(SomeObject.Name); where SomeObject is the class itself. The objective to be just cutting and pasting a single identical line in the header of each class. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Jul 24 11:33:53 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 20:33:53 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C4AB1AA.2040100@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> Message-ID: <8A310364129E48FF9AFE923F44EFBAA0@nant> Hi John -- Thank you for your questions. <<< > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? >>> Yes, it's more than correct IMO :) - I must say I almost never use that much clean-up coding in my .NET development: - I do never clean-up SqlCommand and SqlDataReader explicitly; - I do never close/clean-up SqlConnection; - I do use try { using (SqlConnection cnn = new SqlConnection(connectionString) { // SqlCommand and SqlDataReader etc. are in } } catch (SqlException ex) { // log exception throw ex; } catch (Exception ex) { // log exception throw ex; } Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be not so good (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several years in db intensive multi-user web apps - and it works well - no "memory leakage" - and I must say I have used my logging just a few times and it was informative enough to find and fix the bugs... "Excessive clean-up" is not needed in .NET as CLR's garbage collector does do good job for the code as above... <<<<<< If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. >>>>>> John, IMO there is no generic/common answer to your question - it depends on your app what to do with handled exception - "log and buble it up" or "log and suppress it" returning boolean failure code to the caller method: - logging and using Boolean is what is called "defensive" programming AFAIU - and it's "heavy good old professional style"; - logging and throwing and exception up to the higest level caller is what is called "modern lightweight programming style" - in my opinion :) - and it's the most recommended nowadays AFAIS... Of course in the latter case of "modern lightweight programming style" there should be something(/some code) on the upper call stack levels to take care of the exception (to make some more logging and) to: - continue application execution gracefully; - quit the application... <<< And of course I need a reliable logger so that I can go see any errors. >>> I do not use any besides some custom simple coding I outlined in this thread: - I just log into a simple text file; - I log into MS SQL, if that fails, log into text file, if that fails log into MS Windows application log. You can plan to use some existing logging frameworks but for the time beeing just write simple custom wrapper class, and then you can add advanced logging later... <<< And I have to make a living while I am learning, >>> Yes, that's our destiny - the same story here, moreever... <<< and I am trying to teach a young fellow that works for me what little I know as well. >>> If this young fellow is from a good IT college then they can teach you a lot (myself included) - I mean they usually know well all the modern approaches/methods of application programming - yes, more in theory than in practice but they often have a good overview we (seasoned developers) might lack because of the lack of time to study the theory - "fighting" everyday for living - just talk to the "kid programmer" - and you'll together will find your "proper" way of programming together... I suppose that for your case there are two proven sources: - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer to Programmer) (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 642) - it has real life sample web site/code solution with multi-layer "framework" - I did quote "framework" because it has just a few classes - you can "grab and use them" (sources are available free on WROX site)... - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge framework - and I personally do not use it - I'd recommend to just get its sources (they are free) and to investigate the part of code belonging to the DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this framework immediately - it would be very time consuming to learn it in details... I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + custom SPs mapping to your ADO.NET EF DataModel would be "what doctor ordered" but again it could take a lot of time to learn that "super modern" stuff - you can use simpler and time proven approaches referred above while learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if any).... Thank you. -- Shamil P.S: Disclaimer: All the above my opinions are coming from my own everyday .NET development experience, and are also gathered on Web, including Access-D/dba-VB and from technical books - they can be my own "misinterpretation or real world" sometimes - but they work well for me and for my customers :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 1:26 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# so FINALLY ? Shamil, Thanks for your reply. C#, .Net and Visual Studio are very complex and I have so much to learn. And I have to make a living while I am learning, and I am trying to teach a young fellow that works for me what little I know as well. I need more information from you. I have two specific things I am trying to implement and make sure that I "cleanup" correctly. The first is that I have a ton of places in my code where I am using SQL Server records for table driven processes. As such I need to: 1) Work with data readers, looping through records. 2) Work with command objects doing .ExecuteNonQuery() to perform updates on flags. In both these scenarios I want to make sure that I open the connection, open the command object, do whatever the command object is going to do, close the connection, and cleanup the command object. And I want (am trying) to do this in a single place so that I get consistent object handling / cleanup. So, for example I use a static method of a class: public static bool ExecNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } return true; } > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? > It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside of catch blocks OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. And of course I need a reliable logger so that I can go see any errors. John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 24 11:45:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 12:45:15 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <8A310364129E48FF9AFE923F44EFBAA0@nant> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> <8A310364129E48FF9AFE923F44EFBAA0@nant> Message-ID: <4C4B189B.6080504@colbyconsulting.com> Thanks Shamil. Interesting stuff all of this. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Jul 24 11:53:57 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 12:53:57 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <8A310364129E48FF9AFE923F44EFBAA0@nant> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> <8A310364129E48FF9AFE923F44EFBAA0@nant> Message-ID: <4C4B1AA5.4070802@colbyconsulting.com> I have NLog running very basic, just logging to a log file in my bin directory. NLog appears to be capable of logging to multiple places and do all kinds of sophisticated things like log to email, sql server etc. We shall see. It is going to be a bit of work to retrofit my app to use logging since I have none in it ATM but I have been wanting to do this for a long time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jul 24 13:11:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 22:11:21 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C4B1AA5.4070802@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com><8A310364129E48FF9AFE923F44EFBAA0@nant> <4C4B1AA5.4070802@colbyconsulting.com> Message-ID: <67F1EC9B1A864250B342838202B33875@nant> Hi John -- Yes, NLog seems to be a good choice for multi-threaded apps also http://nlog-project.org/wiki/File_target... I will probably try to use it in one of my applications... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 8:54 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# so FINALLY ? I have NLog running very basic, just logging to a log file in my bin directory. NLog appears to be capable of logging to multiple places and do all kinds of sophisticated things like log to email, sql server etc. We shall see. It is going to be a bit of work to retrofit my app to use logging since I have none in it ATM but I have been wanting to do this for a long time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 25 14:30:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 15:30:11 -0400 Subject: [dba-VB] C# - what does this mean Message-ID: <4C4C90C3.8070901@colbyconsulting.com> From: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx Closing the DataReader You should always call the Close method when you have finished using the DataReader object. If your Command contains output parameters or return values, they will not be available until the DataReader is closed. Note that while a DataReader is open, the Connection is in use exclusively by that DataReader. You will not be able to execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed. Note Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection. NOTICE the Note above. Why would you NOT call close at the very least. I understand Dispose - that is the garbage collector's job to do that when it decides it needs to but close? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Jul 25 15:08:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 16:08:17 -0400 Subject: [dba-VB] C# - rigorous programming Message-ID: <4C4C99B1.7040804@colbyconsulting.com> I had a bunch of code to open connections, command objects and a reader, do something with the reader and then close it all. it is not a trivial amount of code if you are going to try and wrap it in a try / catch and properly close the stuff. So I wrote the following code: public static SqlDataReader GetDataReader(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; SqlDataReader myDR; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myDR = myCommand.ExecuteReader(); return myDR; } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } Which basically just took the three pieces and wrapped them. Unfortunately it doesn't work because the reader closes if the connection closes. It seems that the reader only holds one record at a time and when the next record is asked for goes and gets it on demand. But look at all of the code required to get around the C# syntax police. The objects have to be dimensioned before the try, the try has to wrap the object opens in case they fail (the point of the try) and the finally has to close everything back down correctly, but now have to be checked against null because they might in fact be null which would trigger another error trying to close an object that isn't opened. So what's a poor boy to do? I decided to build a class to do this and then use a property to expose the reader. The class correctly cleans up when it is destroyed. That seems to work. -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Sun Jul 25 18:32:52 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 26 Jul 2010 09:32:52 +1000 Subject: [dba-VB] C# - rigorous programming References: <4C4C99B1.7040804@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> Hi John, I see you have made a lot of progress over the weekend. Now that you have moved this method into its own class, make sure you don't ... ' call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class' which is what I think MS was saying in you previous message. I think the reason is that the finalizer is indeterminate. So the 'close it when you no longer need it' rule still applies. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, 26 July 2010 6:08 AM To: VBA Subject: [dba-VB] C# - rigorous programming I had a bunch of code to open connections, command objects and a reader, do something with the reader and then close it all. it is not a trivial amount of code if you are going to try and wrap it in a try / catch and properly close the stuff. So I wrote the following code: public static SqlDataReader GetDataReader(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; SqlDataReader myDR; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myDR = myCommand.ExecuteReader(); return myDR; } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } Which basically just took the three pieces and wrapped them. Unfortunately it doesn't work because the reader closes if the connection closes. It seems that the reader only holds one record at a time and when the next record is asked for goes and gets it on demand. But look at all of the code required to get around the C# syntax police. The objects have to be dimensioned before the try, the try has to wrap the object opens in case they fail (the point of the try) and the finally has to close everything back down correctly, but now have to be checked against null because they might in fact be null which would trigger another error trying to close an object that isn't opened. So what's a poor boy to do? I decided to build a class to do this and then use a property to expose the reader. The class correctly cleans up when it is destroyed. That seems to work. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 25 21:08:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 22:08:33 -0400 Subject: [dba-VB] C# - rigorous programming In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> References: <4C4C99B1.7040804@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> Message-ID: <4C4CEE21.4050203@colbyconsulting.com> Michael, > I see you have made a lot of progress over the weekend. I made awesome progress on two different fronts. I got NLog working (to a file, not to SQL Server) and I got some stuff figured out on C# cleanup. I believe in logging, both errors and progress. I haven't had logging though, only specific application control stuff. > I think the reason is that the finalizer is indeterminate. So the 'close it when you no longer need it' rule still applies. I understand "close when you no longer need it". I did think that the the Dispose method forced the garbage collector to take care of that specific object right then and there. I thought that in the case of SQL Server or other database objects, that immediate cleanup would be a good thing. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Hi John, > > I see you have made a lot of progress over the weekend. > > Now that you have moved this method into its own class, make sure you > don't ... > ' call Close or Dispose on a Connection, a DataReader, or any other > managed object > in the Finalize method of your class' which is what I think MS was > saying in you previous message. > I think the reason is that the finalizer is indeterminate. So the 'close > it when you no longer need it' rule still applies. > > Cheers > > Michael M > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, 26 July 2010 6:08 AM > To: VBA > Subject: [dba-VB] C# - rigorous programming > > I had a bunch of code to open connections, command objects and a reader, > do something with the reader and then close it all. it is not a trivial > amount of code if you are going to try and wrap it in a try / catch and > properly close the stuff. So I wrote the following code: > > public static SqlDataReader GetDataReader(string strCnn, string > strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > SqlDataReader myDR; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myDR = myCommand.ExecuteReader(); > return myDR; > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > } > > > Which basically just took the three pieces and wrapped them. > > Unfortunately it doesn't work because the reader closes if the > connection closes. It seems that the reader only holds one record at a > time and when the next record is asked for goes and gets it on demand. > > But look at all of the code required to get around the C# syntax police. > The objects have to be dimensioned before the try, the try has to wrap > the object opens in case they fail (the point of the > try) and the finally has to close everything back down correctly, but > now have to be checked against null because they might in fact be null > which would trigger another error trying to close an object that isn't > opened. > > So what's a poor boy to do? > > I decided to build a class to do this and then use a property to expose > the reader. The class correctly cleans up when it is destroyed. That > seems to work. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sun Jul 25 22:11:52 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 23:11:52 -0400 Subject: [dba-VB] C# - NLog to SQL Server Message-ID: <4C4CFCF8.8050505@colbyconsulting.com> Is anyone doing this? I am using the following as a config: INSERT INTO LogTable(time_stamp, [level], logger, [message]) VALUES (@time_stamp, at level, at logger, at message) I have a server Azul, I am using integrated security, I created a database _NLogDatabase and a table NLog with fields of those names. Data types: Time_Stamp: DateTime Level: Varchar(50) Logger: VarChar(50) Message: Varchar(max) So far the logs are going to file but not to the table. -- John W. Colby www.ColbyConsulting.com From marklbreen at gmail.com Mon Jul 26 05:43:53 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 26 Jul 2010 11:43:53 +0100 Subject: [dba-VB] NLog making progress In-Reply-To: <4C4AFB86.4030305@colbyconsulting.com> References: <4C4AFB86.4030305@colbyconsulting.com> Message-ID: Hello John, When I read this email, I recalled the hazy, easy days of Glen Grubb and the ggCC error handler. Oh, how life was easy back then :) Mark On 24 July 2010 15:41, jwcolby wrote: > OK, so it appears that I am making progress. I found an online tutorial > > http://nlog-project.org/wiki/Tutorial#Installing_NLog > > which got me set up and working on one project. > > Basically after referencing in the project and using in the class, I insert > something like: > > Logger nlog = LogManager.GetLogger("clsAZLog"); > > in the header of each class. > > My question is, is there any syntax that could give me the name of the > class? IOW: > > Logger nlog = LogManager.GetLogger(SomeObject.Name); > > where SomeObject is the class itself. The objective to be just cutting and > pasting a single > identical line in the header of each class. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Jul 26 07:22:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Jul 2010 08:22:15 -0400 Subject: [dba-VB] NLog making progress In-Reply-To: References: <4C4AFB86.4030305@colbyconsulting.com> Message-ID: <4C4D7DF7.3090007@colbyconsulting.com> Mark, LOL. Yea, the good ole days. ;) I have to say that, being a programmer at heart, I just truly enjoy the C# language and the .Net environment. There is so much to learn, and so much power. Life is not easy yet in C#, and because of the sheer complexity may never be, but I anticipate the day when, like VBA and DAO in Access, I can pretty much just type away as fast as my fingers can move, writing code. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > When I read this email, I recalled the hazy, easy days of Glen Grubb and the > ggCC error handler. Oh, how life was easy back then :) > > Mark From jwcolby at colbyconsulting.com Wed Jul 28 00:35:18 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 01:35:18 -0400 Subject: [dba-VB] C# - NLog Message-ID: <4C4FC196.5050709@colbyconsulting.com> Wow! I must say that NLog is doing everything I need. Well... other than logging to SQL Server which I have not figured out yet. As I wrote in a previous post, I am designing an asynchronous process, consisting of 4 steps where 1) Tables are exported to text files (csv) 2) The files are moved to a vm for processing by a third party application 3) The resulting files (csv) are brought back from the vm 4) The files are imported back in to SQL Server. The objective is to have these 4 steps able to process completely autonomously, completely table driven. I am trying to run each stage on a thread so that each can do it's thing as it sees fit. This brings a large degree of interaction and I need to be able to see where exceptions are thrown, stack traces and all of that. NLog is handling this beautifully. I am not done by any stretch of the imagination but I would be completely unable to figure this out without the exception logging that NLog enables me to do. Very nice stuff. -- John W. Colby www.ColbyConsulting.com From bheid at sc.rr.com Wed Jul 28 11:08:16 2010 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 28 Jul 2010 12:08:16 -0400 Subject: [dba-VB] C# - what does this mean In-Reply-To: <4C4C90C3.8070901@colbyconsulting.com> References: <4C4C90C3.8070901@colbyconsulting.com> Message-ID: <003c01cb2e6f$168e6770$43ab3650$@rr.com> I think they are talking about calling close in an overridden Finalize method on a class. That would only be if you implement your own dispose/finalize methods in a class. You do want to close the reader and all if you are just using ado.net to connect to and read from a SQL/OLEdb connection. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 25, 2010 3:30 PM To: VBA Subject: [dba-VB] C# - what does this mean From: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx Closing the DataReader You should always call the Close method when you have finished using the DataReader object. If your Command contains output parameters or return values, they will not be available until the DataReader is closed. Note that while a DataReader is open, the Connection is in use exclusively by that DataReader. You will not be able to execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed. Note Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection. NOTICE the Note above. Why would you NOT call close at the very least. I understand Dispose - that is the garbage collector's job to do that when it decides it needs to but close? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From bheid at sc.rr.com Wed Jul 28 11:10:44 2010 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 28 Jul 2010 12:10:44 -0400 Subject: [dba-VB] C# - but what happened to catch? In-Reply-To: References: <4C49F2B1.3060600@colbyconsulting.com> Message-ID: <003d01cb2e6f$6eb19350$4c14b9f0$@rr.com> In the example in John's email, they are going to let the exception "bubble up". But they still want to close the reader whether or not there is an exception. SO in the example, the try is only so they can have a finally. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 24, 2010 1:16 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - but what happened to catch? John, You can make it like that also: using (reader = file.OpenText()) { reader.Read(source, 0, length); } Then 'finally' code block will not be needed as reader will be "automagically" closed by its IDispose call on exit of using code block... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 11:51 PM To: VBA Subject: [dba-VB] C# - but what happened to catch? http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 28 18:41:54 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 19:41:54 -0400 Subject: [dba-VB] C# - Cleanup Message-ID: <4C50C042.7020309@colbyconsulting.com> I have been reading up on the proper way to cleanup unmanaged code. Basically what this entails is inheriting CriticalFinalizerObject and IDisposable, and then adding stuff to the class. The finalizer is used to dispose of unmanaged ubjects "deterministically", IOW when I say to, not when the garbage collector decides to. This becomes an issue when you open a lot of connections. The garbage collector does not understand that the connections exist and so performs it's cleanup when it gets around to it. At least that is what I am understanding. Doing a massive rewrite to add this finalizer code to all my classes that use such code has dropped my errors DRASTICALLY! The code looks like this: #region Dispose ~clsSPAccuzipExportTo() { Dispose(true); } public void Close() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Implement IDisposable. // Do not make this method virtual. // A derived class should not be able to override this method. public void Dispose() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { if (mCnn != null) { try { mCnn.Close(); } catch (Exception) { } mCnn.Dispose(); } } } disposed = true; } #endregion -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Wed Jul 28 19:09:07 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 29 Jul 2010 10:09:07 +1000 Subject: [dba-VB] C# - Cleanup References: <4C50C042.7020309@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> Looks like a good candidate for adding to your base data access class. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, 29 July 2010 9:42 AM To: VBA Subject: [dba-VB] C# - Cleanup I have been reading up on the proper way to cleanup unmanaged code. Basically what this entails is inheriting CriticalFinalizerObject and IDisposable, and then adding stuff to the class. The finalizer is used to dispose of unmanaged ubjects "deterministically", IOW when I say to, not when the garbage collector decides to. This becomes an issue when you open a lot of connections. The garbage collector does not understand that the connections exist and so performs it's cleanup when it gets around to it. At least that is what I am understanding. Doing a massive rewrite to add this finalizer code to all my classes that use such code has dropped my errors DRASTICALLY! The code looks like this: #region Dispose ~clsSPAccuzipExportTo() { Dispose(true); } public void Close() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Implement IDisposable. // Do not make this method virtual. // A derived class should not be able to override this method. public void Dispose() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { if (mCnn != null) { try { mCnn.Close(); } catch (Exception) { } mCnn.Dispose(); } } } disposed = true; } #endregion -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 28 21:29:20 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 22:29:20 -0400 Subject: [dba-VB] C# - Cleanup In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> References: <4C50C042.7020309@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> Message-ID: <4C50E780.1080006@colbyconsulting.com> Yep. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Looks like a good candidate for adding to your base data access class. > > Cheers > > Michael M > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, 29 July 2010 9:42 AM > To: VBA > Subject: [dba-VB] C# - Cleanup > > I have been reading up on the proper way to cleanup unmanaged code. > Basically what this entails is inheriting CriticalFinalizerObject and > IDisposable, and then adding stuff to the class. The finalizer is used > to dispose of unmanaged ubjects "deterministically", IOW when I say to, > not when the garbage collector decides to. > > This becomes an issue when you open a lot of connections. The garbage > collector does not understand that the connections exist and so performs > it's cleanup when it gets around to it. > > At least that is what I am understanding. Doing a massive rewrite to > add this finalizer code to all my classes that use such code has dropped > my errors DRASTICALLY! > > The code looks like this: > > #region Dispose > > ~clsSPAccuzipExportTo() > { > Dispose(true); > } > public void Close() > { > Dispose(true); > // This object will be cleaned up by the Dispose method. > // Therefore, you should call GC.SupressFinalize to > // take this object off the finalization queue > // and prevent finalization code for this object > // from executing a second time. > GC.SuppressFinalize(this); > } > // Implement IDisposable. > // Do not make this method virtual. > // A derived class should not be able to override this method. > public void Dispose() > { > Dispose(true); > // This object will be cleaned up by the Dispose method. > // Therefore, you should call GC.SupressFinalize to > // take this object off the finalization queue > // and prevent finalization code for this object > // from executing a second time. > GC.SuppressFinalize(this); > } > // Dispose(bool disposing) executes in two distinct scenarios. > // If disposing equals true, the method has been called > directly > // or indirectly by a user's code. Managed and unmanaged > resources > // can be disposed. > // If disposing equals false, the method has been called by the > // runtime from inside the finalizer and you should not > reference > // other objects. Only unmanaged resources can be disposed. > private void Dispose(bool disposing) > { > // Check to see if Dispose has already been called. > if (!this.disposed) > { > // If disposing equals true, dispose all managed > // and unmanaged resources. > if (disposing) > { > if (mCnn != null) > { > try > { > mCnn.Close(); > } > catch (Exception) > { > } > mCnn.Dispose(); > } > } > > } > disposed = true; > } > #endregion > > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Jul 29 19:35:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 Jul 2010 20:35:49 -0400 Subject: [dba-VB] BCP out, records affected Message-ID: <4C521E65.8070707@colbyconsulting.com> I am running a stored procedure to BCP out a chunk of records. The stored procedure uses exec master..xp_cmdshell @sql to perform the BCP out. Is it possible to get a "records affected" back from command shell ofr the SQL statement executed? If not is there another way to do this? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue Jul 6 04:54:07 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 Jul 2010 11:54:07 +0200 Subject: [dba-VB] Silverlight PivotViewer Message-ID: Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav From shamil at smsconsulting.spb.ru Tue Jul 6 05:17:49 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Jul 2010 14:17:49 +0400 Subject: [dba-VB] Silverlight PivotViewer In-Reply-To: References: Message-ID: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jul 6 18:25:11 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 7 Jul 2010 09:25:11 +1000 Subject: [dba-VB] Silverlight PivotViewer References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Jul 6 23:45:52 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Jul 2010 08:45:52 +0400 Subject: [dba-VB] Silverlight PivotViewer In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: Hi Michael -- Thank you for sharing your experience with AJAX controls - do you mean controls from "ASP.NET AJAX Control Toolkit"? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Jul 7 01:35:32 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 7 Jul 2010 16:35:32 +1000 Subject: [dba-VB] Silverlight PivotViewer References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant><59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5C9D@ddi-01.DDI.local> Yes, that's them. Can't argue with the price... Cheers Michael Hi Michael -- Thank you for sharing your experience with AJAX controls - do you mean controls from "ASP.NET AJAX Control Toolkit"? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Jul 7 10:36:58 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Jul 2010 17:36:58 +0200 Subject: [dba-VB] Silverlight for Symbian Message-ID: Hi all This was new to me: http://www.silverlight.net/getstarted/devices/symbian/ Silverlight, a cross-browser, cross-platform implementation of the .NET Framework for building media experiences and rich interactive applications for the Web on desktop computers, is also available for Nokia S60 5th Edition devices such as Nokia 5800 XpressMusic, Nokia N97 and Nokia N97 Mini. /gustav From accessd at shaw.ca Wed Jul 7 19:37:36 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 7 Jul 2010 17:37:36 -0700 Subject: [dba-VB] Microsoft is supporting HTML 5 via their now F# In-Reply-To: References: Message-ID: HTML 5 has another friend... http://blogs.msdn.com/b/dsyme/archive/2010/06/04/html5-programming-with-f.as px Jim From jwcolby at colbyconsulting.com Fri Jul 9 14:06:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Jul 2010 15:06:48 -0400 Subject: [dba-VB] Suddenly I can see Message-ID: <4C377348.9030103@colbyconsulting.com> I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am building. The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat little light pipe system to display the power and activity on each disk. The disk sleds plug in to a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic light pipes along the side of the sled which pipes the light to the front so it can be seen. Really cool I thought. What this means to me is that for the first time I can actually see which disks are in use. The server "lights up like a Christmas tree" when stuff is actually written to disk. I am now able to actually compare the screen as I run processes, and watch the lights and I'm here to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a burst of disk activity a half second long, then many seconds of crunching, then a half second of disk activity. -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Fri Jul 9 16:40:45 2010 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 09 Jul 2010 23:40:45 +0200 Subject: [dba-VB] Suddenly I can see Message-ID: Hi John Links please? How noisy is this beauty? /gustav >>> jwcolby at colbyconsulting.com 09-07-2010 21:06 >>> I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am building. The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat little light pipe system to display the power and activity on each disk. The disk sleds plug in to a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic light pipes along the side of the sled which pipes the light to the front so it can be seen. Really cool I thought. What this means to me is that for the first time I can actually see which disks are in use. The server "lights up like a Christmas tree" when stuff is actually written to disk. I am now able to actually compare the screen as I run processes, and watch the lights and I'm here to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a burst of disk activity a half second long, then many seconds of crunching, then a half second of disk activity. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 9 17:53:34 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Jul 2010 18:53:34 -0400 Subject: [dba-VB] Suddenly I can see In-Reply-To: References: Message-ID: <4C37A86E.6000200@colbyconsulting.com> Sorry, I thought I did. http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Links please? > How noisy is this beauty? > > /gustav > > >>>> jwcolby at colbyconsulting.com 09-07-2010 21:06 >>> > I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am > building. > > The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat > little light pipe system to display the power and activity on each disk. The disk sleds plug in to > a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic > light pipes along the side of the sled which pipes the light to the front so it can be seen. Really > cool I thought. > > What this means to me is that for the first time I can actually see which disks are in use. The > server "lights up like a Christmas tree" when stuff is actually written to disk. > > I am now able to actually compare the screen as I run processes, and watch the lights and I'm here > to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a > burst of disk activity a half second long, then many seconds of crunching, then a half second of > disk activity. > From shamil at smsconsulting.spb.ru Sat Jul 10 05:18:10 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Jul 2010 14:18:10 +0400 Subject: [dba-VB] AJAX Control Toolkit - Was: RE: Silverlight PivotViewer In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: <33E3D90D14B54B94BB495B3F1BCF1B8C@nant> Hi All -- FYI: (if you do not have that info yet) I have just downloaded and played with AJAX Control Toolkit http://www.asp.net/ajaxlibrary/act.ashx - and it worked very well for me - all 40 controls - the download from CodePlex has a sample ASP.NET project with all that controls: downloading, setting-up and quick playing with AJAX Control Toolkit samples within VS2008 SP1 took less than an hour - everything did work well as described/expected... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sun Jul 11 08:19:46 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 11 Jul 2010 17:19:46 +0400 Subject: [dba-VB] OT: XP, SCRUM etc. - Sunday watch: "Kent Beck: Ease at Work..." Message-ID: Hi All -- I'm watching now Kent Beck's "Ease at Work..." year 2006 recorded webinar, and I like it, so I decided to share its link with you: http://video.google.com/videoplay?docid=7830246530742207581# Kent Beck is "thinking aloud" about a broad set of issues: When was the last time you were comfortable in your "skin" as a programmer ? When was the last time you were comfortable in your "skin" as a programmer *at work* ? Why should I to "turn off" parts of myself to work here? Something is profoundly wrong with a workplace? Something is missing in my personal worldview? Why should I do "magical things" to feel OK as a programmer? Why should I sacrifice myself to the "altar" of technological progress? Why the sense of "ease and comfort" isn't the part of my everyday work as a programmer? ... Thank you. -- Shamil From jwcolby at colbyconsulting.com Tue Jul 13 15:35:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Jul 2010 16:35:33 -0400 Subject: [dba-VB] Access source control Message-ID: <4C3CCE15.6090200@colbyconsulting.com> I am wondering whether we could put together subversion and Access to do source control. Max's eatbloat will export and import most things Access into a directory structure. Subversion could be used to move that stuff into version control. Once in subversion, we might be able to do differencing etc. Whaddayathink? -- John W. Colby www.ColbyConsulting.com From paul.hartland at googlemail.com Thu Jul 15 06:02:19 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 15 Jul 2010 12:02:19 +0100 Subject: [dba-VB] Using VBTablet.dll With vb.net Message-ID: To all, I have a wacom signature tablet, and we have a piece of code that allows our employees to make digital signatures, but dont seem to be able to get it working. The application looks for a flag file (just empty text file called Update.flg) and if it doesn't exist the application runs a bat file copying & registering the VBTablet.dll and WinTab32.dll into their windows\system32 directory, then asks the user to close the application and re-run it. However when anyone tried to run it, they get the message that no tablet devices are detected on the system. I have been working with our helpdesk, using clean laptop images and still cant get it to work for some reason. Has anyone out their had experience of using the VBTablet.dll with a vb.net application, if so could you give me some pointers on what I may be doing wrong etc. Thanks in advance for any help on this, as it is becoming a real headache. -- Paul Hartland paul.hartland at googlemail.com From dw-murphy at cox.net Thu Jul 15 13:23:37 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 15 Jul 2010 11:23:37 -0700 Subject: [dba-VB] Using VBTablet.dll With vb.net In-Reply-To: References: Message-ID: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> Paul, A tablet running Windows tablet PC have the dll's installed natively. There are lots of examples of using the ImageEdit and ImagePicture controls on the internet. In fact if you download the TabletPC SDK there are many examples of using it with .NET apps. Have not heard of the .flg file, it must have something to do with the application installer. For a start look at http://msdn2.microsoft.com/en-us/library/aa813329.aspx. I know this doesn't answer your question, but it may give you a leed on where to look. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Thursday, July 15, 2010 4:02 AM To: VisualBasicList Subject: [dba-VB] Using VBTablet.dll With vb.net To all, I have a wacom signature tablet, and we have a piece of code that allows our employees to make digital signatures, but dont seem to be able to get it working. The application looks for a flag file (just empty text file called Update.flg) and if it doesn't exist the application runs a bat file copying & registering the VBTablet.dll and WinTab32.dll into their windows\system32 directory, then asks the user to close the application and re-run it. However when anyone tried to run it, they get the message that no tablet devices are detected on the system. I have been working with our helpdesk, using clean laptop images and still cant get it to work for some reason. Has anyone out their had experience of using the VBTablet.dll with a vb.net application, if so could you give me some pointers on what I may be doing wrong etc. Thanks in advance for any help on this, as it is becoming a real headache. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From paul.hartland at googlemail.com Fri Jul 16 02:44:54 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 16 Jul 2010 08:44:54 +0100 Subject: [dba-VB] Using VBTablet.dll With vb.net In-Reply-To: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> References: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> Message-ID: Thanks Doug, any help is very much appreciated, it also gave me a couple more different ideas. On 15 July 2010 19:23, Doug Murphy wrote: > Paul, > > A tablet running Windows tablet PC have the dll's installed natively. There > are lots of examples of using the ImageEdit and ImagePicture controls on > the > internet. In fact if you download the TabletPC SDK there are many examples > of using it with .NET apps. Have not heard of the .flg file, it must have > something to do with the application installer. For a start look at > http://msdn2.microsoft.com/en-us/library/aa813329.aspx. I know this > doesn't > answer your question, but it may give you a leed on where to look. > > Doug > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland > Sent: Thursday, July 15, 2010 4:02 AM > To: VisualBasicList > Subject: [dba-VB] Using VBTablet.dll With vb.net > > To all, > > I have a wacom signature tablet, and we have a piece of code that allows > our > employees to make digital signatures, but dont seem to be able to get it > working. > > The application looks for a flag file (just empty text file called > Update.flg) and if it doesn't exist the application runs a bat file copying > & registering the VBTablet.dll and WinTab32.dll into their windows\system32 > directory, then asks the user to close the application and re-run it. > > However when anyone tried to run it, they get the message that no tablet > devices are detected on the system. > > I have been working with our helpdesk, using clean laptop images and still > cant get it to work for some reason. Has anyone out their had experience > of > using the VBTablet.dll with a vb.net application, if so could you give me > some pointers on what I may be doing wrong etc. > > Thanks in advance for any help on this, as it is becoming a real headache. > > -- > Paul Hartland > paul.hartland at googlemail.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From shamil at smsconsulting.spb.ru Sat Jul 17 05:19:48 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 17 Jul 2010 14:19:48 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers Message-ID: Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil From dw-murphy at cox.net Sat Jul 17 13:19:49 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Sat, 17 Jul 2010 11:19:49 -0700 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 17 17:46:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 17 Jul 2010 18:46:33 -0400 Subject: [dba-VB] =?windows-1252?q?Google=92s_Disk_Failure_Experience?= Message-ID: <4C4232C9.9090608@colbyconsulting.com> http://storagemojo.com/2007/02/19/googles-disk-failure-experience/ I had seen this before but it is an interesting read. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 17 22:31:28 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 17 Jul 2010 23:31:28 -0400 Subject: [dba-VB] FAQ: What is MTBF? Message-ID: <4C427590.2000303@colbyconsulting.com> http://www.t-cubed.com/faq_mtbf.htm -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 17 23:01:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 18 Jul 2010 00:01:36 -0400 Subject: [dba-VB] disk drive temps for the Norco 4020 Message-ID: <4C427CA0.4040400@colbyconsulting.com> I bought the Norco 4020 to build a server with. http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product I am impressed with the case, though it is consumer grade. It is tough to work with however. It has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and the disk backplanes. Obviously it is impossible to leave the wall in place and get all of the cables in, but removing the fan wall is a job for a safe cracker. None the less I did so, got 20 disks in and cabled up, then reinserted the fan wall, and then threaded the cables through the holes in the BOTTOM of the fan wall. Why on earth they didn't leave the holes on the top of the fan wall is beyond me but they didn't. Anyway, for the first time tonight I tested temps with all 20 drives inserted and power applied, and the fan wall operating. I ran a defrag on every volume simultaneously in order to cause the disks to work and generate as much heat as I could cause. Below are the temps. CPU Temperature 55 ?C Ctrl Temperature 49 ?C Power +12V 12.099 V Power +5V 5.053 V Power +3.3V 3.328 V SATA PHY +2.5V 2.528 V DDR-II +1.8V 1.872 V PCI-E +1.8V 1.872 V CPU +1.8V 1.856 V CPU +1.2V 1.232 V DDR-II +0.9V 0.928 V Hdd#1 Temperature 37 ?C Hdd#2 Temperature 40 ?C Hdd#3 Temperature 42 ?C Hdd#4 Temperature 39 ?C Hdd#5 Temperature 47 ?C Hdd#6 Temperature 51 ?C Hdd#7 Temperature 49 ?C Hdd#8 Temperature 46 ?C Hdd#9 Temperature 37 ?C Hdd#10 Temperature 49 ?C Hdd#11 Temperature 44 ?C Hdd#12 Temperature 47 ?C Hdd#13 Temperature 45 ?C Hdd#14 Temperature 50 ?C Hdd#15 Temperature 49 ?C Hdd#16 Temperature 42 ?C There are only 16 drives showing because these 16 are cabled up to my Areca raid co-processor card which is a 16 port card, and that card provides a utility to watch these numbers. The other disks are not being driven but do have power applied. I am satisfied with the temps. Several disks actually hit 53 degrees C under max stress but that is acceptable to me. I would like lower temps but I can live with these. BTW I am using the Corsair 750W modular PS which is a NICE PS. http://www.newegg.com/Product/Product.aspx?Item=N82E16817139010 The 12V cables are ribbon cables which makes them very easy to run and minimizes the air flow impedance. With only 2 inches to work with between the fans and disks, I need all the help I can get. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sun Jul 18 02:30:34 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 18 Jul 2010 11:30:34 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Message-ID: Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From garykjos at gmail.com Sun Jul 18 10:09:29 2010 From: garykjos at gmail.com (Gary Kjos) Date: Sun, 18 Jul 2010 10:09:29 -0500 Subject: [dba-VB] [dba-SQLServer] disk drive temps for the Norco 4020 In-Reply-To: <4C427CA0.4040400@colbyconsulting.com> References: <4C427CA0.4040400@colbyconsulting.com> Message-ID: I was reading some of the reviews posted on the Newegg site when you first posted the link to your new server case and it seemed like other people who purchased it were concerned about the heat the disks would be creating due to lack of space between the drives etc. Nice that you can monitor them. Continued good luck with your new server. GK On Sat, Jul 17, 2010 at 11:01 PM, jwcolby wrote: > I bought the Norco 4020 to build a server with. > > http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product > > I am impressed with the case, though it is consumer grade. ?It is tough to work with however. ?It > has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and > the disk backplanes. ?Obviously it is impossible to leave the wall in place and get all of the > cables in, but removing the fan wall is a job for a safe cracker. > > -- Gary Kjos garykjos at gmail.com From jwcolby at colbyconsulting.com Sun Jul 18 10:21:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 18 Jul 2010 11:21:39 -0400 Subject: [dba-VB] [dba-SQLServer] disk drive temps for the Norco 4020 In-Reply-To: References: <4C427CA0.4040400@colbyconsulting.com> Message-ID: <4C431C03.7020503@colbyconsulting.com> Yea, I am one of those concerned. The bottom of the drive sled touches the top of the drive underneath it. Not a lot of room for drawing air through the drive area. One of the things that people are doing (me included) is to duct tape the holes on the bottom of the fan wall to prevent air from circulating in a big circle, and force the maximum air possible to be pulled through the front past the disks. Other than that I am loving the case. It is easy to find cases for lots of disks... if you don't mind paying $2000. I don't have that kind of money so this case is one alternative. If anyone else knows of lost cost cases like this speak up. John W. Colby www.ColbyConsulting.com Gary Kjos wrote: > I was reading some of the reviews posted on the Newegg site when you > first posted the link to your new server case and it seemed like other > people who purchased it were concerned about the heat the disks would > be creating due to lack of space between the drives etc. Nice that you > can monitor them. > > Continued good luck with your new server. > > GK > > On Sat, Jul 17, 2010 at 11:01 PM, jwcolby wrote: >> I bought the Norco 4020 to build a server with. >> >> http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product >> >> I am impressed with the case, though it is consumer grade. It is tough to work with however. It >> has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and >> the disk backplanes. Obviously it is impossible to leave the wall in place and get all of the >> cables in, but removing the fan wall is a job for a safe cracker. >> >> > From dw-murphy at cox.net Sun Jul 18 19:49:45 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Sun, 18 Jul 2010 17:49:45 -0700 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Message-ID: <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> Hello Shamil, It costs nothing to send through the web interface portal numbers. Each provider has a portal. You can not recieve with this method though. If you want to send and recieve possibly the best thing would be a cellular modem and a cheap cell plan for it. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, July 18, 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Jul 19 06:46:32 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 19 Jul 2010 15:46:32 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> Message-ID: <74D815DD703B45F8B957DE8C558934B6@nant> Thank you, Doug, Cellular modems can't be used there - just plain simple mobile phones to send a short SMS message once a day... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, July 19, 2010 4:50 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, It costs nothing to send through the web interface portal numbers. Each provider has a portal. You can not recieve with this method though. If you want to send and recieve possibly the best thing would be a cellular modem and a cheap cell plan for it. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, July 18, 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 19 22:32:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 19 Jul 2010 23:32:44 -0400 Subject: [dba-VB] SCO/Novell suit is over, SCO loses Message-ID: <4C4518DC.9090305@colbyconsulting.com> http://www.crunchgear.com/2010/06/11/sconovell-suit-is-over-sco-loses/ -- John W. Colby www.ColbyConsulting.com From accessd at shaw.ca Tue Jul 20 00:13:55 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 19 Jul 2010 22:13:55 -0700 Subject: [dba-VB] SCO/Novell suit is over, SCO loses In-Reply-To: <4C4518DC.9090305@colbyconsulting.com> References: <4C4518DC.9090305@colbyconsulting.com> Message-ID: That is truly sad. At one time it was the best UNIX Company out there. I was even a certified installers and reseller and made a good coin with their products. The trouble with the UNIX market is that they were all a bunch of warring camps and they were too busy fighting each other while a small company like Microsoft slide out of nowhere and effectively wiped them all out. It did not matter to anyone that UNIX was a superior operating system, it was always much more important to have a good user friendly interface. Presentation has always been more important than functionality. After the great UNIX wars, the intransient companies continued fighting until their own oblivion and to make themselves little more than a foot note in history. You have to go no further your dictionary and look up the word intransient and you will find the SCO icon clearly displayed. UNIX still exists in the mini and main frame but little else. Microsoft did not even fire a shot and watched their only challengers wipe them selves out. But before Microsoft could claim complete world dominance another flavour of UNIX or Linux appeared; stable, powerful and free. Microsoft has claimed that Linux is the single greatest threat to free enterprise system and maybe it is. Fifteen years later and now Microsoft is watching its empire slowly eroding. Its competitors are using a flavour of Linux UNIX like Mac, using Linux to control the internet like Google or moving to their own desktop, like Ubuntu. Will Linux ever dominate the market? No; but neither or ever again will Microsoft. Some say that Linux is not ready for prime time but when your 10 or 12 year old son or daughter can easily install it, the old fears are just that; old fears. SCO Unix on the other hand is an old and dying product, the epitome and poster boy of the UNIX wars. The only SCO I think of now is the producer of a very fine brand of non alcoholic ginger beer of which I would highly recommend to anyone. For you Unix buffs who want to see the turbulent UNIX/Linux world check out the following: http://www.quicklycode.com/wp-content/files/unix_history.png Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 19, 2010 8:33 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] SCO/Novell suit is over, SCO loses http://www.crunchgear.com/2010/06/11/sconovell-suit-is-over-sco-loses/ -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 20 13:28:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 14:28:55 -0400 Subject: [dba-VB] Has anyone used this? Message-ID: <4C45EAE7.4050203@colbyconsulting.com> http://www.dofactory.com/Framework/Framework.aspx -- John W. Colby www.ColbyConsulting.com From ha at phulse.com Tue Jul 20 13:53:50 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Tue, 20 Jul 2010 19:53:50 +0100 Subject: [dba-VB] Has anyone used this? In-Reply-To: <4C45EAE7.4050203@colbyconsulting.com> References: <4C45EAE7.4050203@colbyconsulting.com> Message-ID: This is a joke, right? Hans-Christian Web Application Development, London, UK e: hans.andersen at phulse.com t: +44 (0)782 894 5456 w: http://nokenode.com l: http://uk.linkedin.com/in/andersenhc ------------------------------------------------------ Unique Gifts, Collectables, Artwork ------------------------------------------------------ Come one Come all to www.corinnajasmine.com ------------------------------------------------------ On 20 July 2010 19:28, jwcolby wrote: > http://www.dofactory.com/Framework/Framework.aspx > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jul 20 14:16:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 15:16:48 -0400 Subject: [dba-VB] C# Sysvars Message-ID: <4C45F620.6010807@colbyconsulting.com> In Access I had a system for handling what I call SysVars, which are program global variables, stored in a table, cached as the program opens. SysVar VarID - Int - surrogate key VarName - Str - name of the variable VarVal - Str - Value of the variable VarDescr - Str - description of how the variable is used VarRefresh - Bool - needs to be refreshed before use. This essentially replaces what many developers use, a single record in a table where you add a new field every time you need a new variable (yuk). Just as an example... I have an asynchronous process where I: 1) Send 2 million record chunks of data to files on disk. 2) Ship the chunk files over to a VM input directory for processing 3) Process each file, placing the processed result files in an output directory. 4) Watch the output directory for processed files and ship back to the server 5) Import the chunks back in to SQL Server. The problem is that step 3 takes about 1 hour per file. If I run this process on a large table I can export 30 files to the VM which translates into 30 hours before it finishes processing. If I get a rush order, I need to delete the files in the VM so that they are not clogging up the works and not automatically send those files back to the VM until I say so. I have a SysVar called VMHold which is a true / false, true if hold files going to the vm and false if not. I can set / reset this sysvar through a sysvars class, and it reads / writes the value to the sql server tlbSysVars, caching them in memory as the program opens, refreshing them before use ONLY if the varRefresh is true. That is what I call SysVars and how / why I use them. It seems like everyone would use these for any moderately complex asynchronous or multi-user program. I am looking for feedback on how others implement this functionality. I will write a second email regarding some of the issues I am running into. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 20 14:18:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 15:18:09 -0400 Subject: [dba-VB] Has anyone used this? In-Reply-To: References: <4C45EAE7.4050203@colbyconsulting.com> Message-ID: <4C45F671.5050505@colbyconsulting.com> LOL, they don't think so. Am I missing something? John W. Colby www.ColbyConsulting.com Hans-Christian Andersen wrote: > This is a joke, right? > > Hans-Christian > Web Application Development, London, UK > > e: hans.andersen at phulse.com > t: +44 (0)782 894 5456 > w: http://nokenode.com > l: http://uk.linkedin.com/in/andersenhc > > ------------------------------------------------------ > Unique Gifts, Collectables, Artwork > ------------------------------------------------------ > Come one > Come all to > www.corinnajasmine.com > ------------------------------------------------------ > > > > On 20 July 2010 19:28, jwcolby wrote: > >> http://www.dofactory.com/Framework/Framework.aspx >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From ha at phulse.com Tue Jul 20 16:00:52 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Tue, 20 Jul 2010 22:00:52 +0100 Subject: [dba-VB] Has anyone used this? In-Reply-To: <4C45F671.5050505@colbyconsulting.com> References: <4C45EAE7.4050203@colbyconsulting.com> <4C45F671.5050505@colbyconsulting.com> Message-ID: Perhaps I am the one missing something, but it seems to me that they are selling their code as if it were plug-able modules, when, in reality, design patterns are concepts. Concepts you need to understand before you can use them, in which case, you should be able to write them yourself. Just feels a bit snake oil-ish to me. But that could just be their marketing department advertising it wrong. Hans-Christian Web Application Development, London, UK e: hans.andersen at phulse.com t: +44 (0)782 894 5456 w: http://nokenode.com l: http://uk.linkedin.com/in/andersenhc ------------------------------------------------------ Unique Gifts, Collectables, Artwork ------------------------------------------------------ Come one Come all to www.corinnajasmine.com ------------------------------------------------------ On 20 July 2010 20:18, jwcolby wrote: > LOL, they don't think so. > > Am I missing something? > > John W. Colby > www.ColbyConsulting.com > > > Hans-Christian Andersen wrote: > > This is a joke, right? > > > > Hans-Christian > > Web Application Development, London, UK > > > > e: hans.andersen at phulse.com > > t: +44 (0)782 894 5456 > > w: http://nokenode.com > > l: http://uk.linkedin.com/in/andersenhc > > > > ------------------------------------------------------ > > Unique Gifts, Collectables, Artwork > > ------------------------------------------------------ > > Come one > > Come all to > > www.corinnajasmine.com > > ------------------------------------------------------ > > > > > > > > On 20 July 2010 19:28, jwcolby wrote: > > > >> http://www.dofactory.com/Framework/Framework.aspx > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jul 20 18:10:35 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 19:10:35 -0400 Subject: [dba-VB] Has anyone used this? In-Reply-To: References: <4C45EAE7.4050203@colbyconsulting.com> <4C45F671.5050505@colbyconsulting.com> Message-ID: <4C462CEB.6080305@colbyconsulting.com> >when, in reality, design patterns are concepts. Concepts you need to understand before you can use them in which case, you should be able to write them yourself. I can understand SQL Server but I don't want to write a database. >Just feels a bit snake oil-ish to me. But that could just be their marketing department advertising it wrong. And so I ask... is anyone actually using this... John W. Colby www.ColbyConsulting.com Hans-Christian Andersen wrote: > Perhaps I am the one missing something, but it seems to me that they are > selling their code as if it were plug-able modules, when, in reality, design > patterns are concepts. Concepts you need to understand before you can use > them, in which case, you should be able to write them yourself. Just feels a > bit snake oil-ish to me. But that could just be their marketing department > advertising it wrong. > > > Hans-Christian > Web Application Development, London, UK > > e: hans.andersen at phulse.com > t: +44 (0)782 894 5456 > w: http://nokenode.com > l: http://uk.linkedin.com/in/andersenhc > > ------------------------------------------------------ > Unique Gifts, Collectables, Artwork > ------------------------------------------------------ > Come one > Come all to > www.corinnajasmine.com > ------------------------------------------------------ > > > > On 20 July 2010 20:18, jwcolby wrote: > >> LOL, they don't think so. >> >> Am I missing something? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Hans-Christian Andersen wrote: >>> This is a joke, right? >>> >>> Hans-Christian >>> Web Application Development, London, UK >>> >>> e: hans.andersen at phulse.com >>> t: +44 (0)782 894 5456 >>> w: http://nokenode.com >>> l: http://uk.linkedin.com/in/andersenhc >>> >>> ------------------------------------------------------ >>> Unique Gifts, Collectables, Artwork >>> ------------------------------------------------------ >>> Come one >>> Come all to >>> www.corinnajasmine.com >>> ------------------------------------------------------ >>> >>> >>> >>> On 20 July 2010 19:28, jwcolby wrote: >>> >>>> http://www.dofactory.com/Framework/Framework.aspx >>>> >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-VB mailing list >>>> dba-VB at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From gustav at cactus.dk Wed Jul 21 01:10:12 2010 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 21 Jul 2010 08:10:12 +0200 Subject: [dba-VB] Low Cost Worldwide SMS providers Message-ID: Hi Shamil Skype? Would require the Skype client to be installed though. /gustav >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil From pcs.accessd at gmail.com Wed Jul 21 01:20:30 2010 From: pcs.accessd at gmail.com (Borge Hansen) Date: Wed, 21 Jul 2010 16:20:30 +1000 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: Hi Shamil, www.exetel.com.au is an australian communications company. They currently offer sms to local (Australian) numbers for A$0.05 per sms International sms is A$.088 (8.8 cents) They have an api so you can incorporate sending sms into your application. check it out.... Their order form for (residential) low cost sms is https://www.exetel.com.au/sms/sms_order1.php This is for a pre-paid account - pay A$10 and test it out.... I am currently testing it out myself. Regards Borge Hansen, Gold Coast, Australia On Wed, Jul 21, 2010 at 4:10 PM, Gustav Brock wrote: > Hi Shamil > > Skype? > Would require the Skype client to be installed though. > > /gustav > > >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> > Hi All -- > > I'm looking for a low cost worldwide two-way SMS provider to be integrated > in my customer's application: > > Google search: > > http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide > rs&aq=f&aqi=&aql=&oq=&gs_rfai= > > > has returned the following links: > > 1. http://www.clickatell.com/products/two_way.php > 2. http://www.ficall.com/english/#/ficall/about > 3. http://www.animatele.com/index.html > > > The first one - Clickatell - seems to be a good option. Do you have any > experience in working with Clickatell? Do you know and successfully used > any > other low cost worldwide SMS providers in your applications? > > > Thank you. > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Jul 21 07:42:05 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Jul 2010 08:42:05 -0400 Subject: [dba-VB] Friday Humor Message-ID: <4C46EB1D.40605@colbyconsulting.com> One year, I decided to buy my mother-in-law a cemetery plot as a Christmas gift... The next year, I didn't buy her a gift. When she asked me why, I replied, "Well, you still haven't used the gift I bought you last year!" And that's how the fight started..... ______________________________ My wife and I were watching Who Wants To Be A Millionaire while we were in bed. I turned to her and said, 'Do you want to have Sex?' 'No,' she answered. I then said, 'Is that your final answer?' She didn't even look at me this time, simply saying, 'Yes..' So I said, "Then I'd like to phone a friend." And that's when the fight started... ________________________________ I took my wife to a restaurant. The waiter, for some reason, took my order first. "I'll have the rump steak, rare, please." He said, "Aren't you worried about the mad cow?" "Nah, she can order for herself." And that's when the fight started..... ________________________________ My wife and I were sitting at a table at her high school reunion, and she kept staring at a drunken man swigging his drink as he sat alone at a nearby table. I asked her, "Do you know him?" "Yes", she sighed, "He's my old boyfriend.... I understand he took to drinking right after we split up those many years ago, and I hear he hasn't been sober since." "My God!" I said, "Who would think a person could go on celebrating that long?" And then the fight started... ________________________________ When our lawn mower broke and wouldn't run, my wife kept hinting to me that I should get it fixed. But, somehow I always had something else to take care of first, the shed, the boat, making beer.. Always something more important to me. Finally she thought of a clever way to make her point. When I arrived home one day, I found her seated in the tall grass, busily snipping away with a tiny pair of sewing scissors. I watched silently for a short time and then went into the house.. I was gone only a minute, and when I came out again I handed her a toothbrush. I said, "When you finish cutting the grass, you might as well sweep the driveway." The doctors say I will walk again, but I will always have a limp. ________________________________ My wife sat down next to me as I was flipping channels. She asked, "What's on TV?" I said, "Dust." And then the fight started... ________________________________ Saturday morning I got up early, quietly dressed, made my lunch, and slipped quietly into the garage. I hooked up the boat up to the van, and proceeded to back out into a torrential downpour. The wind was blowing 50 mph, so I pulled back into the garage, turned on the radio, and discovered that the weather would be bad all day. I went back into the house, quietly undressed, and slipped back into bed.. I cuddled up to my wife's back, now with a different anticipation, and whispered, "The weather out there is terrible." My loving wife of 5 years replied, "And, can you believe my stupid husband is out fishing in that?" And that's how the fight started... ________________________________ My wife was hinting about what she wanted for our upcoming anniversary. She said, "I want something shiny that goes from 0 to 150 in about 3 seconds." I bought her a bathroom scale. And then the fight started...... ________________________________ After retiring, I went to the Social Security office to apply for Social Security. The woman behind the counter asked me for my driver's License to verify my age. I looked in my pockets and realized I had left my wallet at home. I told the woman that I was very sorry, but I would have to go home and come back later. The woman said, 'Unbutton your shirt'. So I opened my shirt revealing my curly silver hair. She said, 'That silver hair on your chest is proof enough for me' and she processed my Social Security application.. When I got home, I excitedly told my wife about my experience at the Social Security office... She said, 'You should have dropped your pants. You might have gotten disability, too.' And then the fight started... ________________________________ My wife was standing nude, looking in the bedroom mirror. She was not happy with what she saw and said to me, "I feel horrible; I look old, fat and ugly. I really need you to pay me a compliment.' I replied, "Your eyesight's damn near perfect." And then the fight started........ -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:43:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:43:25 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <11C05396010D46A7AA66094042A83C48@nant> Hi Gustav -- No, Skype can't be used AFAIU - "front-end" SMS sending device could be just a simple mobile phone... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 21, 2010 10:10 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hi Shamil Skype? Would require the Skype client to be installed though. /gustav >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:43:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:43:25 +0400 Subject: [dba-VB] C# Sysvars In-Reply-To: <4C45F620.6010807@colbyconsulting.com> References: <4C45F620.6010807@colbyconsulting.com> Message-ID: <2D6B3569445A4B7F8DE277D5B0FC87F7@nant> Hi John -- You probably mean handling "Locking and Thread Safety" http://www.albahari.com/threading/part2.aspx#_Locking or "best practices" in implementing of Singleton pattern http://www.yoda.arachsys.com/csharp/singleton.html while using your Sysvars ? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 20, 2010 11:17 PM To: VBA Subject: [dba-VB] C# Sysvars In Access I had a system for handling what I call SysVars, which are program global variables, stored in a table, cached as the program opens. SysVar VarID - Int - surrogate key VarName - Str - name of the variable VarVal - Str - Value of the variable VarDescr - Str - description of how the variable is used VarRefresh - Bool - needs to be refreshed before use. This essentially replaces what many developers use, a single record in a table where you add a new field every time you need a new variable (yuk). Just as an example... I have an asynchronous process where I: 1) Send 2 million record chunks of data to files on disk. 2) Ship the chunk files over to a VM input directory for processing 3) Process each file, placing the processed result files in an output directory. 4) Watch the output directory for processed files and ship back to the server 5) Import the chunks back in to SQL Server. The problem is that step 3 takes about 1 hour per file. If I run this process on a large table I can export 30 files to the VM which translates into 30 hours before it finishes processing. If I get a rush order, I need to delete the files in the VM so that they are not clogging up the works and not automatically send those files back to the VM until I say so. I have a SysVar called VMHold which is a true / false, true if hold files going to the vm and false if not. I can set / reset this sysvar through a sysvars class, and it reads / writes the value to the sql server tlbSysVars, caching them in memory as the program opens, refreshing them before use ONLY if the varRefresh is true. That is what I call SysVars and how / why I use them. It seems like everyone would use these for any moderately complex asynchronous or multi-user program. I am looking for feedback on how others implement this functionality. I will write a second email regarding some of the issues I am running into. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:46:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:46:39 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <6EC65E2729FD472AA1A5AC2B5534B318@nant> Thank you, Borge. Yes, that seems to be a good option to send SMS from computers but as I noted here in my customer case "front-end" is a simple mobile phone they use once a day (every day) to send just one SMS message - and that "front-ends" can be located everywhere in this small world - and they wanted SMS sending costs to be as low as possible - the companies as Clickatel (http://www.clickatell.com/products/two_way.php ) AFAIU have special agreements with many countries SMS providers to get local SMS messages sent to special mobile numbers transferred to Clickatel servers where from they can be retrieved many ways - now using computers... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Wednesday, July 21, 2010 10:21 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hi Shamil, www.exetel.com.au is an australian communications company. They currently offer sms to local (Australian) numbers for A$0.05 per sms International sms is A$.088 (8.8 cents) They have an api so you can incorporate sending sms into your application. check it out.... Their order form for (residential) low cost sms is https://www.exetel.com.au/sms/sms_order1.php This is for a pre-paid account - pay A$10 and test it out.... I am currently testing it out myself. Regards Borge Hansen, Gold Coast, Australia On Wed, Jul 21, 2010 at 4:10 PM, Gustav Brock wrote: > Hi Shamil > > Skype? > Would require the Skype client to be installed though. > > /gustav > > >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> > Hi All -- > > I'm looking for a low cost worldwide two-way SMS provider to be integrated > in my customer's application: > > Google search: > > http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide > rs&aq=f&aqi=&aql=&oq=&gs_rfai= > > > has returned the following links: > > 1. http://www.clickatell.com/products/two_way.php > 2. http://www.ficall.com/english/#/ficall/about > 3. http://www.animatele.com/index.html > > > The first one - Clickatell - seems to be a good option. Do you have any > experience in working with Clickatell? Do you know and successfully used > any > other low cost worldwide SMS providers in your applications? > > > Thank you. > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:48:56 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:48:56 +0400 Subject: [dba-VB] Friday Humor In-Reply-To: <4C46EB1D.40605@colbyconsulting.com> References: <4C46EB1D.40605@colbyconsulting.com> Message-ID: <757355B821DE4FC3801B82FAA593A52C@nant> LOL. Is it Friday there already? :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 21, 2010 4:42 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] Friday Humor ... My wife sat down next to me as I was flipping channels. She asked, "What's on TV?" I said, "Dust." And then the fight started... ... -- John W. Colby www.ColbyConsulting.com _______________________________________________ From andy at minstersystems.co.uk Wed Jul 21 09:58:00 2010 From: andy at minstersystems.co.uk (Andrew Lacey) Date: Wed, 21 Jul 2010 15:58:00 +0100 (BST) Subject: [dba-VB] Friday Humor In-Reply-To: <757355B821DE4FC3801B82FAA593A52C@nant> References: <4C46EB1D.40605@colbyconsulting.com> <757355B821DE4FC3801B82FAA593A52C@nant> Message-ID: <1958596177.20915.1279724280879.JavaMail.open-xchange@oxltgw14.schlund.de> Nah, but it's quiet. Good one JC. ? Andy On 21 July 2010 at 16:48 Shamil Salakhetdinov wrote: > LOL. > > Is it Friday there already? :) > > -- Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, July 21, 2010 4:42 PM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] Friday Humor > > ... > > My wife sat down next to me as I was flipping channels. > She asked, "What's on TV?" > I said, "Dust." > And then the fight started... > > > ... > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Thu Jul 22 23:36:58 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 00:36:58 -0400 Subject: [dba-VB] C# custom exceptions Message-ID: <4C491C6A.7080306@colbyconsulting.com> I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 00:11:31 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 01:11:31 -0400 Subject: [dba-VB] try catch finally Message-ID: <4C492483.4020203@colbyconsulting.com> OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Fri Jul 23 00:19:57 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:19:57 +1000 Subject: [dba-VB] C# custom exceptions References: <4C491C6A.7080306@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> Hi John, Check out NLog for your logging requirements. It is comprehensive and free. http://nlog-project.org/ It will write logs to just about anywhere including SQL. My take on error handling in.net is to 1st Avoid exceptions ie test for null before using the object. 2nd Use supplied methods to avoid exceptions ie If !File.Exists("C:\test.txt") ... 3rd Use supplied object exceptions ie Catch ( FileNotFound e) You will know what errors you can recover from and what is fatal to your application. Unhandled exceptions bubble up to a handler, if there is no handler it will throw an error in your Main sub. You can catch unhandled errors there, including threading errors. This is how I handled unhandled thread exceptions, with logging, in a recent app. /// /// The main entry point for the application. /// [STAThread] static void Main ( ) { Application.ThreadException += new ThreadExceptionEventHandler ( Application_ThreadException ); bool createdNew = true; using ( Mutex mutex = new Mutex ( true, "EZHL7", out createdNew ) ) { if ( createdNew ) { Application.EnableVisualStyles ( ); Application.SetCompatibleTextRenderingDefault ( false ); Application.Run ( new FormMain ( ) ); } } } static void Application_ThreadException ( object sender, ThreadExceptionEventArgs e ) { Logger logger = MyLogManager.Instance.GetCurrentClassLogger ( ); logger.FatalException ( "Unhandled Thread Error!", e.Exception ); Application.Restart ( ); } HTH Cheers Michael M PS Looking at the subject line, yes you can create your own custom errors for your custom classes. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, 23 July 2010 2:37 PM To: VBA Subject: [dba-VB] C# custom exceptions I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 23 00:25:49 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:25:49 +1000 Subject: [dba-VB] try catch finally References: <4C492483.4020203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6F@ddi-01.DDI.local> Coding in Outlook so watch out :-) OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection --> Open connection --> if connection open { open a new reader -->If reader.hasrows(); { Do something with the reader close the reader close the connection } } } } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { -->I rarely use this } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 23 00:57:00 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:57:00 +1000 Subject: [dba-VB] try catch finally References: <4C492483.4020203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D70@ddi-01.DDI.local> BTW, The finally is executed before the error bubbles up to calling method. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, 23 July 2010 3:12 PM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 23 08:03:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 09:03:49 -0400 Subject: [dba-VB] C# custom exceptions In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> References: <4C491C6A.7080306@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> Message-ID: <4C499335.5010600@colbyconsulting.com> Oh my, studying this carefully! Moving all logging to this would be an awesome thing. Thanks. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Hi John, > > Check out NLog for your logging requirements. It is comprehensive and > free. > http://nlog-project.org/ > It will write logs to just about anywhere including SQL. > > My take on error handling in.net is to > 1st Avoid exceptions ie test for null before using the object. > 2nd Use supplied methods to avoid exceptions ie If > !File.Exists("C:\test.txt") ... > 3rd Use supplied object exceptions ie Catch ( FileNotFound e) > > You will know what errors you can recover from and what is fatal to your > application. > Unhandled exceptions bubble up to a handler, if there is no handler it > will throw an error in your Main sub. > You can catch unhandled errors there, including threading errors. > > This is how I handled unhandled thread exceptions, with logging, in a > recent app. > > /// > /// The main entry point for the application. > /// > [STAThread] > static void Main ( ) > { > Application.ThreadException += new > ThreadExceptionEventHandler ( Application_ThreadException ); > > bool createdNew = true; > using ( Mutex mutex = new Mutex ( true, "EZHL7", out > createdNew ) ) > { > if ( createdNew ) > { > Application.EnableVisualStyles ( ); > Application.SetCompatibleTextRenderingDefault ( > false ); > Application.Run ( new FormMain ( ) ); > } > } > } > > static void Application_ThreadException ( object sender, > ThreadExceptionEventArgs e ) > { > Logger logger = MyLogManager.Instance.GetCurrentClassLogger > ( ); > logger.FatalException ( "Unhandled Thread Error!", > e.Exception ); > Application.Restart ( ); > } > > HTH > > Cheers > > Michael M > > PS Looking at the subject line, yes you can create your own custom > errors for your custom classes. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, 23 July 2010 2:37 PM > To: VBA > Subject: [dba-VB] C# custom exceptions > > I am trying to find info on how and when where and why to use custom > exceptions and particularly how to log them. > > I am developing a system which uses four asynchronous processes. > > Stage 1) Export a SQL table or view to address validation. I have a > table that has records which tell stage 1 the name of the database, view > to export, date to process, directory on disk and a few other things. > > Stage 1 creates text files on disk in a staging directory, one file for > each 2 million records exported. This creates a record in a log table > with the PK of stage 1 table, name of the database, view exported, > directory on disk (output staging directory), file name, and some date > flags to monitor completion of the remaining stages. IOW one log file > per text file exported, all info needed for the remaining stages, date > fields for each remaining stage to log that it processed that file. > > Stage 2) Move the files in the staging directory to a virtual machine. > The log files created by stage 1 are read and used to move the files and > set a datetime flag in the log record saying that stage 2 completed (the > file moved to VM). The virtual machine may not be available, but if it > is the file moves and the log record is updated. If the file goes to the > VM, the VM will process the file and place it in an output directory. > This will take between 1/2 hour and 1 hour per file. > > Stage 3) Move the completed files from the VM back to a different > (input) staging directory. Again, the log file is used to determine > what files should be available on the VM and if found and moved, a > datetime flag is set saying that file was moved back from the VM back to > the Input Staging Directory. > > Stage 4) Import the files from the input staging directory back into SQL > server. The log record for any file moved back in is marked with a > datetime flag saying that the file was imported back in to SQL server. > > I have about a dozen or so "data" tables which have to be processed > monthly, rain or shine. By placing records in the stage 1 source table, > I can cause the system to process each of my data tables. As the > process finishes, it creates a new record adding a "number of days to > next process" > to the date so that it is queued to process again in X days. > > I also have orders that I run that will write one or more records into > this same table and cause their data to process. > > So... nicely divided, asynchronous process: Sql to Staging, Staging to > VM, VM to staging, Staging in to SQL Server. These things must be > asynchronous because the VM may or may not be available, and it is > critical that each file is processed through each stage and tracked. > > Records in the main table triggers the process (stage 1). Records in > the log table track stages 2-4 for each file created in stage 1. > > I want to run 4 threads to do these processes. IOW, a process just runs > on the server (or somewhere, but probably eventually on the server). > Each stage is entirely independent, and takes its input from a table, > and writes a datetime flag as it finishes. > > > OK, so back to exceptions... > > I am new to threads. I wrote the code from the bottom up, with working > processes for doing each of the 4 stages, but triggered by button > clicks. It all worked, except that it wasn't table driven (of course). > I even had each button click create a worker thread and that worked. > > I created a supervisor class, with four methods, one for each stage. I > moved the button click code to these methods. I fired each of them up, > and it mostly works... each stage is running in its own thread and > watching the tables, updating the records as each does its thing. > Except that I would get weird errors that were not handled by any > exception handler. > > I removed all traces of messagebox.show and I *think* I have caused that > to go away. Or maybe not, who knows. > > But now I really need to get errors logged. > > Again, I am new to threading, and new to custom exceptions. New to > exception logging. Do I sound like a nubee? ;) > > Anyway, I do not particularly want to use the Windows error log because > then the error logs would be scattered around on whatever machine the > parts run on. Remember that there is a user interface part which sets > up the records in stage 1 and monitors the process. > > This is potentially a nice little system but it has to be done right or > I will fight it for the rest of my career. So I need to learn > exceptions, and I need to log the exceptions, my preference is into SQL > Server, though there are of course some potential errors (SQL server > errors) which could not be logged there because SQL server isn't > available at the instant the log is created. > > Kinda messy. > > Any pointers, articles, books, or other sources of information I could > go to to learn this stuff. > Google is not my friend in this case because I am getting stuff from > 2003 to the present and I really want modern code. > > Help! > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Jul 23 12:19:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 13:19:36 -0400 Subject: [dba-VB] C# NLog setup Message-ID: <4C49CF28.3070801@colbyconsulting.com> Can anyone step me through setting NLog up to do logging. I don't care where the destination is (file or database) I just want to get it working and starting to use it and able to look at the files, then I will go back and tweak it later. I can be dense sometimes but the initial setup seems a little arcane. Any help appreciated -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Jul 23 12:21:58 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Jul 2010 21:21:58 +0400 Subject: [dba-VB] C# custom exceptions In-Reply-To: <4C491C6A.7080306@colbyconsulting.com> References: <4C491C6A.7080306@colbyconsulting.com> Message-ID: <04E9EE312E584A37B93EBA3B1A2BD23A@nant> Hi John -- Just follow KISS principle - I used to use that principle to profile/log applications with up to one hundred threads - and I never had any issues. I do just log to a simple text file log shared by all threads, and I put lock around log text record write operation: System.IO.File.AppendAllText(...) (If you expect that putting a lock on such a simple file write operation will somehow influence badly your multi-threaded application then you can develop a code for a special utility thread handling log writes using .NET Enqueue / Dequeue features (http://msdn.microsoft.com/en-us/library/1c8bzx97.aspx ) but do not introduce that complexity from the very beginning...) I must note that nor I nor my customers usually do not care about keeping logs history - so log file records are just getting lost after several days overwritten by the new ones: the code does make log backup into a .bak file after main log file gets several MB in size - we do use log in the cases of runtime errors/bugs/other issues and one day log is usually more than enough to find and fix the issues... In your case if you wanted to log into MS SQL DB - just do it if it's available (I do use simple SP in such cases), if it's not available do log into a text file, and if the latter isn't available (e.g. no disk space) - then do log into Windows System Application Events log - one can even try to send an e-mail message using SMTP or log into a Web Service or FTP site - all that is relatively simple to do in .NET but when simple text log works well why bother about advanced logging options? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 8:37 AM To: VBA Subject: [dba-VB] C# custom exceptions I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Jul 23 13:05:08 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Jul 2010 22:05:08 +0400 Subject: [dba-VB] try catch finally In-Reply-To: <4C492483.4020203@colbyconsulting.com> References: <4C492483.4020203@colbyconsulting.com> Message-ID: <29E411AB69F94BEAAD0F7CDC492E8D19@nant> Hi John, Yes, you can dimension connection and reader object variables outside the try/catch block - something like it is done by the code in P.S. of this posting. If you have unhandled exception in your worker thread then it completes abnormally but your main thread continues running OK, still you'd better have all your worker thread exceptions handled gracefully and returning some failing code to the main thread in the case of runtime errors... Throw call issued and executed in catch block does immediately return control/"bubles" to the nearest try/catch block in the call stack, and if there is no any then worker or main thread crash... HTH, -- Shamil P.S. static void Main(string[] args) { try { tryCatchFinally(); } catch (Exception ex) { System.Console.WriteLine("Runtime.Error: " + ex.Message); } } public static void tryCatchFinally() { string serverName = @"MyServer\MySQLServer"; string databaseName = "MyDb"; SqlConnection cnn = null; SqlCommand cmd = null; SqlDataReader rdr = null; string connectionString = string.Format( @"Data Source={0};Initial Catalog={1};Integrated Security=True", serverName, databaseName); try { string cmdText = "select * from [Users]"; cnn = new SqlConnection(connectionString); cnn.Open(); cmd = new SqlCommand(cmdText, cnn); rdr = cmd.ExecuteReader(); while (rdr.Read()) { System.Console.WriteLine("{0} {1} {2}", rdr[0], rdr[1], rdr[2]); } } catch (SqlException ex) { if (cnn != null) System.Console.WriteLine("tryCatchFinally.SQL: {0} {1} {2}", cnn.WorkstationId, cnn.State, ex.Message); throw; } catch (Exception ex) { if (cnn != null) System.Console.WriteLine("tryCatchFinally.Runtime: {0} {1} {2}", cnn.WorkstationId, cnn.State, ex.Message); throw; } finally { if (rdr != null) rdr.Close(); if (cnn != null) cnn.Close(); } } -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 9:12 AM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Fri Jul 23 13:13:32 2010 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 23 Jul 2010 14:13:32 -0400 Subject: [dba-VB] try catch finally In-Reply-To: <4C492483.4020203@colbyconsulting.com> References: <4C492483.4020203@colbyconsulting.com> Message-ID: John, You are correct that you do have to dimension the connection and reader before the try. The Finally block executes whether an error is encountered or not. A good developer always makes sure the garbage got taken care of on the way out the door. The suggestion of checking that the connection did get opened before you execute the rest of the code isn't a bad idea. However, things can still go wrong once the reader/connection are opened and I've personally seen cases where the server-side still sees the connection as open even though the client-side thinks it is gone. Instead of handling the error and then throwing the exception up to the calling block, why not use Functions instead of Procedures and pass back a Boolean indicating whether the operation was successful. Doris Manning Sr. Developer & Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 1:12 AM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 23 14:05:14 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:05:14 -0400 Subject: [dba-VB] C# - what am I doing wrong here? Message-ID: <4C49E7EA.2000609@colbyconsulting.com> OK so I want to do the right thing, I just don't know how. 8( In the following code, I want to declare the connection and command object outside the try, initialize the two objects inside of a try, catch any errors, and finally cleanup. The objects in the finally say that they were never initialized. If I put them inside of the try, it complains that the objects aren't valid in the scope of the finally. If I initialize them outside of the try it isn't using a try and errors will not be handled. It seems that I am damned any way I look at this. namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn; SqlCommand myCommand; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { myCommand.Dispose(); mCnn.Close(); } } } } -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 14:47:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:47:15 -0400 Subject: [dba-VB] Oh man, I love this piece Message-ID: <4C49F1C3.1030708@colbyconsulting.com> If it worked... but it doesn't. What a MESS! http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 14:51:13 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:51:13 -0400 Subject: [dba-VB] C# - but what happened to catch? Message-ID: <4C49F2B1.3060600@colbyconsulting.com> http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 15:07:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 16:07:55 -0400 Subject: [dba-VB] c# so FINALLY ? Message-ID: <4C49F69B.2030403@colbyconsulting.com> The version that seems to addre4ss all of the issues: namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } } } What do you do with the command object? Does it need cleanup handling at all? It doesn't have a close method, though it does have a dispose method. And finally (pun intended) what should I do with this method? Return a boolean true = worked? But WHERE? The finally will execute whether the function "worked" or not. AFTER the finally block? As I understand it that code would ONLY execute if the catch statements do not throw an error? A throw does exit the function never to return correct? Should I log (write to a log file) BEFORE the throw? This is "closest to the error" and I can pass additional info about the context. Or should I just continuously throw it all the way up to the top and log everything at the very top? (mutters under breath - "I will learn this stuff") -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Jul 24 00:16:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 09:16:12 +0400 Subject: [dba-VB] C# - but what happened to catch? In-Reply-To: <4C49F2B1.3060600@colbyconsulting.com> References: <4C49F2B1.3060600@colbyconsulting.com> Message-ID: John, You can make it like that also: using (reader = file.OpenText()) { reader.Read(source, 0, length); } Then 'finally' code block will not be needed as reader will be "automagically" closed by its IDispose call on exit of using code block... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 11:51 PM To: VBA Subject: [dba-VB] C# - but what happened to catch? http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Jul 24 00:16:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 09:16:12 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C49F69B.2030403@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com> Message-ID: <39CF9897AAF846D49115A5F2A38041F4@nant> Hi John -- Dispose does all the clean-up for SqlCommand object instance... It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside catch blocks... Such methods do usually return "RecordAffected" value if that needed by the callers, some other execution stats, or nothing... <<< Or should I just continuously throw it all the way up to the top and log everything at the very top? >>> Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; - return to the highest position in the call stack where you can gracefully continue your application execution, or quit your app with a user-friendly error message... Logging all the way up to the top of the call stack would be similar to On Error GoTo ... VB6/VBA approach - that one proved itself to be a professional approach for VB6/VBA but for C#/VB.NET it's usually considered as a timid, pavid, apprehensive and too expensive (in many areas) to be true approach, e.g. do you take into account that try/catch/finally do influence your code execution speed so putting them everywhere could degrade your code performance?... Code instrumentation/logging/profiling is usually done while going down to the call stack, and .NET has special instrumentation classes, which can be used to organize as detailed as needed logging depending on current application settings... After all - your application usually work or crash when deployed? - if the latter then whatever advanced logging/code instrumentation approach you'll use you'll anyway loose your customers (pun not intended)... Be courageous! Forget "VB6/VBA timidity", recall your best times when you've been a "code cowboy" but do use Unit Testing (at least) - then you'll make your coding style light, your code running lightning fast and still being "bullet-proof"... Thank you. :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 12:08 AM To: VBA Subject: [dba-VB] c# so FINALLY ? The version that seems to addre4ss all of the issues: namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } } } What do you do with the command object? Does it need cleanup handling at all? It doesn't have a close method, though it does have a dispose method. And finally (pun intended) what should I do with this method? Return a boolean true = worked? But WHERE? The finally will execute whether the function "worked" or not. AFTER the finally block? As I understand it that code would ONLY execute if the catch statements do not throw an error? A throw does exit the function never to return correct? Should I log (write to a log file) BEFORE the throw? This is "closest to the error" and I can pass additional info about the context. Or should I just continuously throw it all the way up to the top and log everything at the very top? (mutters under breath - "I will learn this stuff") -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 24 04:26:02 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 05:26:02 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <39CF9897AAF846D49115A5F2A38041F4@nant> References: <4C49F69B.2030403@colbyconsulting.com> <39CF9897AAF846D49115A5F2A38041F4@nant> Message-ID: <4C4AB1AA.2040100@colbyconsulting.com> Shamil, Thanks for your reply. C#, .Net and Visual Studio are very complex and I have so much to learn. And I have to make a living while I am learning, and I am trying to teach a young fellow that works for me what little I know as well. I need more information from you. I have two specific things I am trying to implement and make sure that I "cleanup" correctly. The first is that I have a ton of places in my code where I am using SQL Server records for table driven processes. As such I need to: 1) Work with data readers, looping through records. 2) Work with command objects doing .ExecuteNonQuery() to perform updates on flags. In both these scenarios I want to make sure that I open the connection, open the command object, do whatever the command object is going to do, close the connection, and cleanup the command object. And I want (am trying) to do this in a single place so that I get consistent object handling / cleanup. So, for example I use a static method of a class: public static bool ExecNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } return true; } > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? > It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside of catch blocks OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. And of course I need a reliable logger so that I can go see any errors. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Dispose does all the clean-up for SqlCommand object instance... > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has > > throw > > calls inside catch blocks... > > Such methods do usually return "RecordAffected" value if that needed by the > callers, some other execution stats, or nothing... > > <<< > Or should I just continuously throw > it all the way up to the top > and log everything at the very top? > Again follow KISS-principle: > - log exceptions as close as possible to the point where they appeared; > - return to the highest position in the call stack where you can gracefully > continue your application execution, or quit your app with a user-friendly > error message... > > Logging all the way up to the top of the call stack would be similar to > > On Error GoTo ... > > VB6/VBA approach - that one proved itself to be a professional approach for > VB6/VBA but for C#/VB.NET it's usually considered as a timid, pavid, > apprehensive and too expensive (in many areas) to be true approach, e.g. do > you take into account that try/catch/finally do influence your code > execution speed so putting them everywhere could degrade your code > performance?... > > Code instrumentation/logging/profiling is usually done while going down to > the call stack, and .NET has special instrumentation classes, which can be > used to organize as detailed as needed logging depending on current > application settings... > > After all - your application usually work or crash when deployed? - if the > latter then whatever advanced logging/code instrumentation approach you'll > use you'll anyway loose your customers (pun not intended)... > > Be courageous! Forget "VB6/VBA timidity", recall your best times when you've > been a "code cowboy" but do use Unit Testing (at least) - then you'll make > your coding style light, your code running lightning fast and still being > "bullet-proof"... > > Thank you. :) > > -- Shamil From jwcolby at colbyconsulting.com Sat Jul 24 06:33:26 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 07:33:26 -0400 Subject: [dba-VB] NLog assistance Message-ID: <4C4ACF86.6050707@colbyconsulting.com> I am still looking for anyone on the list that uses NLog that can help me get it sorking initially. My confusion is in how to set it up. The help discusses setting an XML file, and I have found about 40 different versions of that file out on Google, but I am not sure where I go to edit it. My solution has several projects, and I assume that I have to do an XML config file in each project? I would prefer ONE for the solution but I will do what it takes. This appears to be one of those "you can't use it until you know how to use it" things. Just a few words of advice might be enough to get me going. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 24 09:41:10 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 10:41:10 -0400 Subject: [dba-VB] NLog making progress Message-ID: <4C4AFB86.4030305@colbyconsulting.com> OK, so it appears that I am making progress. I found an online tutorial http://nlog-project.org/wiki/Tutorial#Installing_NLog which got me set up and working on one project. Basically after referencing in the project and using in the class, I insert something like: Logger nlog = LogManager.GetLogger("clsAZLog"); in the header of each class. My question is, is there any syntax that could give me the name of the class? IOW: Logger nlog = LogManager.GetLogger(SomeObject.Name); where SomeObject is the class itself. The objective to be just cutting and pasting a single identical line in the header of each class. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Jul 24 11:33:53 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 20:33:53 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C4AB1AA.2040100@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> Message-ID: <8A310364129E48FF9AFE923F44EFBAA0@nant> Hi John -- Thank you for your questions. <<< > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? >>> Yes, it's more than correct IMO :) - I must say I almost never use that much clean-up coding in my .NET development: - I do never clean-up SqlCommand and SqlDataReader explicitly; - I do never close/clean-up SqlConnection; - I do use try { using (SqlConnection cnn = new SqlConnection(connectionString) { // SqlCommand and SqlDataReader etc. are in } } catch (SqlException ex) { // log exception throw ex; } catch (Exception ex) { // log exception throw ex; } Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be not so good (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several years in db intensive multi-user web apps - and it works well - no "memory leakage" - and I must say I have used my logging just a few times and it was informative enough to find and fix the bugs... "Excessive clean-up" is not needed in .NET as CLR's garbage collector does do good job for the code as above... <<<<<< If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. >>>>>> John, IMO there is no generic/common answer to your question - it depends on your app what to do with handled exception - "log and buble it up" or "log and suppress it" returning boolean failure code to the caller method: - logging and using Boolean is what is called "defensive" programming AFAIU - and it's "heavy good old professional style"; - logging and throwing and exception up to the higest level caller is what is called "modern lightweight programming style" - in my opinion :) - and it's the most recommended nowadays AFAIS... Of course in the latter case of "modern lightweight programming style" there should be something(/some code) on the upper call stack levels to take care of the exception (to make some more logging and) to: - continue application execution gracefully; - quit the application... <<< And of course I need a reliable logger so that I can go see any errors. >>> I do not use any besides some custom simple coding I outlined in this thread: - I just log into a simple text file; - I log into MS SQL, if that fails, log into text file, if that fails log into MS Windows application log. You can plan to use some existing logging frameworks but for the time beeing just write simple custom wrapper class, and then you can add advanced logging later... <<< And I have to make a living while I am learning, >>> Yes, that's our destiny - the same story here, moreever... <<< and I am trying to teach a young fellow that works for me what little I know as well. >>> If this young fellow is from a good IT college then they can teach you a lot (myself included) - I mean they usually know well all the modern approaches/methods of application programming - yes, more in theory than in practice but they often have a good overview we (seasoned developers) might lack because of the lack of time to study the theory - "fighting" everyday for living - just talk to the "kid programmer" - and you'll together will find your "proper" way of programming together... I suppose that for your case there are two proven sources: - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer to Programmer) (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 642) - it has real life sample web site/code solution with multi-layer "framework" - I did quote "framework" because it has just a few classes - you can "grab and use them" (sources are available free on WROX site)... - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge framework - and I personally do not use it - I'd recommend to just get its sources (they are free) and to investigate the part of code belonging to the DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this framework immediately - it would be very time consuming to learn it in details... I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + custom SPs mapping to your ADO.NET EF DataModel would be "what doctor ordered" but again it could take a lot of time to learn that "super modern" stuff - you can use simpler and time proven approaches referred above while learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if any).... Thank you. -- Shamil P.S: Disclaimer: All the above my opinions are coming from my own everyday .NET development experience, and are also gathered on Web, including Access-D/dba-VB and from technical books - they can be my own "misinterpretation or real world" sometimes - but they work well for me and for my customers :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 1:26 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# so FINALLY ? Shamil, Thanks for your reply. C#, .Net and Visual Studio are very complex and I have so much to learn. And I have to make a living while I am learning, and I am trying to teach a young fellow that works for me what little I know as well. I need more information from you. I have two specific things I am trying to implement and make sure that I "cleanup" correctly. The first is that I have a ton of places in my code where I am using SQL Server records for table driven processes. As such I need to: 1) Work with data readers, looping through records. 2) Work with command objects doing .ExecuteNonQuery() to perform updates on flags. In both these scenarios I want to make sure that I open the connection, open the command object, do whatever the command object is going to do, close the connection, and cleanup the command object. And I want (am trying) to do this in a single place so that I get consistent object handling / cleanup. So, for example I use a static method of a class: public static bool ExecNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } return true; } > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? > It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside of catch blocks OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. And of course I need a reliable logger so that I can go see any errors. John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 24 11:45:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 12:45:15 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <8A310364129E48FF9AFE923F44EFBAA0@nant> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> <8A310364129E48FF9AFE923F44EFBAA0@nant> Message-ID: <4C4B189B.6080504@colbyconsulting.com> Thanks Shamil. Interesting stuff all of this. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Jul 24 11:53:57 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 12:53:57 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <8A310364129E48FF9AFE923F44EFBAA0@nant> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> <8A310364129E48FF9AFE923F44EFBAA0@nant> Message-ID: <4C4B1AA5.4070802@colbyconsulting.com> I have NLog running very basic, just logging to a log file in my bin directory. NLog appears to be capable of logging to multiple places and do all kinds of sophisticated things like log to email, sql server etc. We shall see. It is going to be a bit of work to retrofit my app to use logging since I have none in it ATM but I have been wanting to do this for a long time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jul 24 13:11:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 22:11:21 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C4B1AA5.4070802@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com><8A310364129E48FF9AFE923F44EFBAA0@nant> <4C4B1AA5.4070802@colbyconsulting.com> Message-ID: <67F1EC9B1A864250B342838202B33875@nant> Hi John -- Yes, NLog seems to be a good choice for multi-threaded apps also http://nlog-project.org/wiki/File_target... I will probably try to use it in one of my applications... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 8:54 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# so FINALLY ? I have NLog running very basic, just logging to a log file in my bin directory. NLog appears to be capable of logging to multiple places and do all kinds of sophisticated things like log to email, sql server etc. We shall see. It is going to be a bit of work to retrofit my app to use logging since I have none in it ATM but I have been wanting to do this for a long time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 25 14:30:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 15:30:11 -0400 Subject: [dba-VB] C# - what does this mean Message-ID: <4C4C90C3.8070901@colbyconsulting.com> From: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx Closing the DataReader You should always call the Close method when you have finished using the DataReader object. If your Command contains output parameters or return values, they will not be available until the DataReader is closed. Note that while a DataReader is open, the Connection is in use exclusively by that DataReader. You will not be able to execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed. Note Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection. NOTICE the Note above. Why would you NOT call close at the very least. I understand Dispose - that is the garbage collector's job to do that when it decides it needs to but close? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Jul 25 15:08:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 16:08:17 -0400 Subject: [dba-VB] C# - rigorous programming Message-ID: <4C4C99B1.7040804@colbyconsulting.com> I had a bunch of code to open connections, command objects and a reader, do something with the reader and then close it all. it is not a trivial amount of code if you are going to try and wrap it in a try / catch and properly close the stuff. So I wrote the following code: public static SqlDataReader GetDataReader(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; SqlDataReader myDR; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myDR = myCommand.ExecuteReader(); return myDR; } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } Which basically just took the three pieces and wrapped them. Unfortunately it doesn't work because the reader closes if the connection closes. It seems that the reader only holds one record at a time and when the next record is asked for goes and gets it on demand. But look at all of the code required to get around the C# syntax police. The objects have to be dimensioned before the try, the try has to wrap the object opens in case they fail (the point of the try) and the finally has to close everything back down correctly, but now have to be checked against null because they might in fact be null which would trigger another error trying to close an object that isn't opened. So what's a poor boy to do? I decided to build a class to do this and then use a property to expose the reader. The class correctly cleans up when it is destroyed. That seems to work. -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Sun Jul 25 18:32:52 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 26 Jul 2010 09:32:52 +1000 Subject: [dba-VB] C# - rigorous programming References: <4C4C99B1.7040804@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> Hi John, I see you have made a lot of progress over the weekend. Now that you have moved this method into its own class, make sure you don't ... ' call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class' which is what I think MS was saying in you previous message. I think the reason is that the finalizer is indeterminate. So the 'close it when you no longer need it' rule still applies. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, 26 July 2010 6:08 AM To: VBA Subject: [dba-VB] C# - rigorous programming I had a bunch of code to open connections, command objects and a reader, do something with the reader and then close it all. it is not a trivial amount of code if you are going to try and wrap it in a try / catch and properly close the stuff. So I wrote the following code: public static SqlDataReader GetDataReader(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; SqlDataReader myDR; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myDR = myCommand.ExecuteReader(); return myDR; } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } Which basically just took the three pieces and wrapped them. Unfortunately it doesn't work because the reader closes if the connection closes. It seems that the reader only holds one record at a time and when the next record is asked for goes and gets it on demand. But look at all of the code required to get around the C# syntax police. The objects have to be dimensioned before the try, the try has to wrap the object opens in case they fail (the point of the try) and the finally has to close everything back down correctly, but now have to be checked against null because they might in fact be null which would trigger another error trying to close an object that isn't opened. So what's a poor boy to do? I decided to build a class to do this and then use a property to expose the reader. The class correctly cleans up when it is destroyed. That seems to work. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 25 21:08:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 22:08:33 -0400 Subject: [dba-VB] C# - rigorous programming In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> References: <4C4C99B1.7040804@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> Message-ID: <4C4CEE21.4050203@colbyconsulting.com> Michael, > I see you have made a lot of progress over the weekend. I made awesome progress on two different fronts. I got NLog working (to a file, not to SQL Server) and I got some stuff figured out on C# cleanup. I believe in logging, both errors and progress. I haven't had logging though, only specific application control stuff. > I think the reason is that the finalizer is indeterminate. So the 'close it when you no longer need it' rule still applies. I understand "close when you no longer need it". I did think that the the Dispose method forced the garbage collector to take care of that specific object right then and there. I thought that in the case of SQL Server or other database objects, that immediate cleanup would be a good thing. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Hi John, > > I see you have made a lot of progress over the weekend. > > Now that you have moved this method into its own class, make sure you > don't ... > ' call Close or Dispose on a Connection, a DataReader, or any other > managed object > in the Finalize method of your class' which is what I think MS was > saying in you previous message. > I think the reason is that the finalizer is indeterminate. So the 'close > it when you no longer need it' rule still applies. > > Cheers > > Michael M > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, 26 July 2010 6:08 AM > To: VBA > Subject: [dba-VB] C# - rigorous programming > > I had a bunch of code to open connections, command objects and a reader, > do something with the reader and then close it all. it is not a trivial > amount of code if you are going to try and wrap it in a try / catch and > properly close the stuff. So I wrote the following code: > > public static SqlDataReader GetDataReader(string strCnn, string > strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > SqlDataReader myDR; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myDR = myCommand.ExecuteReader(); > return myDR; > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > } > > > Which basically just took the three pieces and wrapped them. > > Unfortunately it doesn't work because the reader closes if the > connection closes. It seems that the reader only holds one record at a > time and when the next record is asked for goes and gets it on demand. > > But look at all of the code required to get around the C# syntax police. > The objects have to be dimensioned before the try, the try has to wrap > the object opens in case they fail (the point of the > try) and the finally has to close everything back down correctly, but > now have to be checked against null because they might in fact be null > which would trigger another error trying to close an object that isn't > opened. > > So what's a poor boy to do? > > I decided to build a class to do this and then use a property to expose > the reader. The class correctly cleans up when it is destroyed. That > seems to work. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sun Jul 25 22:11:52 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 23:11:52 -0400 Subject: [dba-VB] C# - NLog to SQL Server Message-ID: <4C4CFCF8.8050505@colbyconsulting.com> Is anyone doing this? I am using the following as a config: INSERT INTO LogTable(time_stamp, [level], logger, [message]) VALUES (@time_stamp, at level, at logger, at message) I have a server Azul, I am using integrated security, I created a database _NLogDatabase and a table NLog with fields of those names. Data types: Time_Stamp: DateTime Level: Varchar(50) Logger: VarChar(50) Message: Varchar(max) So far the logs are going to file but not to the table. -- John W. Colby www.ColbyConsulting.com From marklbreen at gmail.com Mon Jul 26 05:43:53 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 26 Jul 2010 11:43:53 +0100 Subject: [dba-VB] NLog making progress In-Reply-To: <4C4AFB86.4030305@colbyconsulting.com> References: <4C4AFB86.4030305@colbyconsulting.com> Message-ID: Hello John, When I read this email, I recalled the hazy, easy days of Glen Grubb and the ggCC error handler. Oh, how life was easy back then :) Mark On 24 July 2010 15:41, jwcolby wrote: > OK, so it appears that I am making progress. I found an online tutorial > > http://nlog-project.org/wiki/Tutorial#Installing_NLog > > which got me set up and working on one project. > > Basically after referencing in the project and using in the class, I insert > something like: > > Logger nlog = LogManager.GetLogger("clsAZLog"); > > in the header of each class. > > My question is, is there any syntax that could give me the name of the > class? IOW: > > Logger nlog = LogManager.GetLogger(SomeObject.Name); > > where SomeObject is the class itself. The objective to be just cutting and > pasting a single > identical line in the header of each class. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Jul 26 07:22:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Jul 2010 08:22:15 -0400 Subject: [dba-VB] NLog making progress In-Reply-To: References: <4C4AFB86.4030305@colbyconsulting.com> Message-ID: <4C4D7DF7.3090007@colbyconsulting.com> Mark, LOL. Yea, the good ole days. ;) I have to say that, being a programmer at heart, I just truly enjoy the C# language and the .Net environment. There is so much to learn, and so much power. Life is not easy yet in C#, and because of the sheer complexity may never be, but I anticipate the day when, like VBA and DAO in Access, I can pretty much just type away as fast as my fingers can move, writing code. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > When I read this email, I recalled the hazy, easy days of Glen Grubb and the > ggCC error handler. Oh, how life was easy back then :) > > Mark From jwcolby at colbyconsulting.com Wed Jul 28 00:35:18 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 01:35:18 -0400 Subject: [dba-VB] C# - NLog Message-ID: <4C4FC196.5050709@colbyconsulting.com> Wow! I must say that NLog is doing everything I need. Well... other than logging to SQL Server which I have not figured out yet. As I wrote in a previous post, I am designing an asynchronous process, consisting of 4 steps where 1) Tables are exported to text files (csv) 2) The files are moved to a vm for processing by a third party application 3) The resulting files (csv) are brought back from the vm 4) The files are imported back in to SQL Server. The objective is to have these 4 steps able to process completely autonomously, completely table driven. I am trying to run each stage on a thread so that each can do it's thing as it sees fit. This brings a large degree of interaction and I need to be able to see where exceptions are thrown, stack traces and all of that. NLog is handling this beautifully. I am not done by any stretch of the imagination but I would be completely unable to figure this out without the exception logging that NLog enables me to do. Very nice stuff. -- John W. Colby www.ColbyConsulting.com From bheid at sc.rr.com Wed Jul 28 11:08:16 2010 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 28 Jul 2010 12:08:16 -0400 Subject: [dba-VB] C# - what does this mean In-Reply-To: <4C4C90C3.8070901@colbyconsulting.com> References: <4C4C90C3.8070901@colbyconsulting.com> Message-ID: <003c01cb2e6f$168e6770$43ab3650$@rr.com> I think they are talking about calling close in an overridden Finalize method on a class. That would only be if you implement your own dispose/finalize methods in a class. You do want to close the reader and all if you are just using ado.net to connect to and read from a SQL/OLEdb connection. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 25, 2010 3:30 PM To: VBA Subject: [dba-VB] C# - what does this mean From: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx Closing the DataReader You should always call the Close method when you have finished using the DataReader object. If your Command contains output parameters or return values, they will not be available until the DataReader is closed. Note that while a DataReader is open, the Connection is in use exclusively by that DataReader. You will not be able to execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed. Note Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection. NOTICE the Note above. Why would you NOT call close at the very least. I understand Dispose - that is the garbage collector's job to do that when it decides it needs to but close? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From bheid at sc.rr.com Wed Jul 28 11:10:44 2010 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 28 Jul 2010 12:10:44 -0400 Subject: [dba-VB] C# - but what happened to catch? In-Reply-To: References: <4C49F2B1.3060600@colbyconsulting.com> Message-ID: <003d01cb2e6f$6eb19350$4c14b9f0$@rr.com> In the example in John's email, they are going to let the exception "bubble up". But they still want to close the reader whether or not there is an exception. SO in the example, the try is only so they can have a finally. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 24, 2010 1:16 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - but what happened to catch? John, You can make it like that also: using (reader = file.OpenText()) { reader.Read(source, 0, length); } Then 'finally' code block will not be needed as reader will be "automagically" closed by its IDispose call on exit of using code block... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 11:51 PM To: VBA Subject: [dba-VB] C# - but what happened to catch? http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 28 18:41:54 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 19:41:54 -0400 Subject: [dba-VB] C# - Cleanup Message-ID: <4C50C042.7020309@colbyconsulting.com> I have been reading up on the proper way to cleanup unmanaged code. Basically what this entails is inheriting CriticalFinalizerObject and IDisposable, and then adding stuff to the class. The finalizer is used to dispose of unmanaged ubjects "deterministically", IOW when I say to, not when the garbage collector decides to. This becomes an issue when you open a lot of connections. The garbage collector does not understand that the connections exist and so performs it's cleanup when it gets around to it. At least that is what I am understanding. Doing a massive rewrite to add this finalizer code to all my classes that use such code has dropped my errors DRASTICALLY! The code looks like this: #region Dispose ~clsSPAccuzipExportTo() { Dispose(true); } public void Close() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Implement IDisposable. // Do not make this method virtual. // A derived class should not be able to override this method. public void Dispose() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { if (mCnn != null) { try { mCnn.Close(); } catch (Exception) { } mCnn.Dispose(); } } } disposed = true; } #endregion -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Wed Jul 28 19:09:07 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 29 Jul 2010 10:09:07 +1000 Subject: [dba-VB] C# - Cleanup References: <4C50C042.7020309@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> Looks like a good candidate for adding to your base data access class. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, 29 July 2010 9:42 AM To: VBA Subject: [dba-VB] C# - Cleanup I have been reading up on the proper way to cleanup unmanaged code. Basically what this entails is inheriting CriticalFinalizerObject and IDisposable, and then adding stuff to the class. The finalizer is used to dispose of unmanaged ubjects "deterministically", IOW when I say to, not when the garbage collector decides to. This becomes an issue when you open a lot of connections. The garbage collector does not understand that the connections exist and so performs it's cleanup when it gets around to it. At least that is what I am understanding. Doing a massive rewrite to add this finalizer code to all my classes that use such code has dropped my errors DRASTICALLY! The code looks like this: #region Dispose ~clsSPAccuzipExportTo() { Dispose(true); } public void Close() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Implement IDisposable. // Do not make this method virtual. // A derived class should not be able to override this method. public void Dispose() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { if (mCnn != null) { try { mCnn.Close(); } catch (Exception) { } mCnn.Dispose(); } } } disposed = true; } #endregion -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 28 21:29:20 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 22:29:20 -0400 Subject: [dba-VB] C# - Cleanup In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> References: <4C50C042.7020309@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> Message-ID: <4C50E780.1080006@colbyconsulting.com> Yep. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Looks like a good candidate for adding to your base data access class. > > Cheers > > Michael M > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, 29 July 2010 9:42 AM > To: VBA > Subject: [dba-VB] C# - Cleanup > > I have been reading up on the proper way to cleanup unmanaged code. > Basically what this entails is inheriting CriticalFinalizerObject and > IDisposable, and then adding stuff to the class. The finalizer is used > to dispose of unmanaged ubjects "deterministically", IOW when I say to, > not when the garbage collector decides to. > > This becomes an issue when you open a lot of connections. The garbage > collector does not understand that the connections exist and so performs > it's cleanup when it gets around to it. > > At least that is what I am understanding. Doing a massive rewrite to > add this finalizer code to all my classes that use such code has dropped > my errors DRASTICALLY! > > The code looks like this: > > #region Dispose > > ~clsSPAccuzipExportTo() > { > Dispose(true); > } > public void Close() > { > Dispose(true); > // This object will be cleaned up by the Dispose method. > // Therefore, you should call GC.SupressFinalize to > // take this object off the finalization queue > // and prevent finalization code for this object > // from executing a second time. > GC.SuppressFinalize(this); > } > // Implement IDisposable. > // Do not make this method virtual. > // A derived class should not be able to override this method. > public void Dispose() > { > Dispose(true); > // This object will be cleaned up by the Dispose method. > // Therefore, you should call GC.SupressFinalize to > // take this object off the finalization queue > // and prevent finalization code for this object > // from executing a second time. > GC.SuppressFinalize(this); > } > // Dispose(bool disposing) executes in two distinct scenarios. > // If disposing equals true, the method has been called > directly > // or indirectly by a user's code. Managed and unmanaged > resources > // can be disposed. > // If disposing equals false, the method has been called by the > // runtime from inside the finalizer and you should not > reference > // other objects. Only unmanaged resources can be disposed. > private void Dispose(bool disposing) > { > // Check to see if Dispose has already been called. > if (!this.disposed) > { > // If disposing equals true, dispose all managed > // and unmanaged resources. > if (disposing) > { > if (mCnn != null) > { > try > { > mCnn.Close(); > } > catch (Exception) > { > } > mCnn.Dispose(); > } > } > > } > disposed = true; > } > #endregion > > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Jul 29 19:35:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 Jul 2010 20:35:49 -0400 Subject: [dba-VB] BCP out, records affected Message-ID: <4C521E65.8070707@colbyconsulting.com> I am running a stored procedure to BCP out a chunk of records. The stored procedure uses exec master..xp_cmdshell @sql to perform the BCP out. Is it possible to get a "records affected" back from command shell ofr the SQL statement executed? If not is there another way to do this? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue Jul 6 04:54:07 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 Jul 2010 11:54:07 +0200 Subject: [dba-VB] Silverlight PivotViewer Message-ID: Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav From shamil at smsconsulting.spb.ru Tue Jul 6 05:17:49 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Jul 2010 14:17:49 +0400 Subject: [dba-VB] Silverlight PivotViewer In-Reply-To: References: Message-ID: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jul 6 18:25:11 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 7 Jul 2010 09:25:11 +1000 Subject: [dba-VB] Silverlight PivotViewer References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Jul 6 23:45:52 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Jul 2010 08:45:52 +0400 Subject: [dba-VB] Silverlight PivotViewer In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: Hi Michael -- Thank you for sharing your experience with AJAX controls - do you mean controls from "ASP.NET AJAX Control Toolkit"? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Jul 7 01:35:32 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 7 Jul 2010 16:35:32 +1000 Subject: [dba-VB] Silverlight PivotViewer References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant><59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5C9D@ddi-01.DDI.local> Yes, that's them. Can't argue with the price... Cheers Michael Hi Michael -- Thank you for sharing your experience with AJAX controls - do you mean controls from "ASP.NET AJAX Control Toolkit"? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Jul 7 10:36:58 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Jul 2010 17:36:58 +0200 Subject: [dba-VB] Silverlight for Symbian Message-ID: Hi all This was new to me: http://www.silverlight.net/getstarted/devices/symbian/ Silverlight, a cross-browser, cross-platform implementation of the .NET Framework for building media experiences and rich interactive applications for the Web on desktop computers, is also available for Nokia S60 5th Edition devices such as Nokia 5800 XpressMusic, Nokia N97 and Nokia N97 Mini. /gustav From accessd at shaw.ca Wed Jul 7 19:37:36 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 7 Jul 2010 17:37:36 -0700 Subject: [dba-VB] Microsoft is supporting HTML 5 via their now F# In-Reply-To: References: Message-ID: HTML 5 has another friend... http://blogs.msdn.com/b/dsyme/archive/2010/06/04/html5-programming-with-f.as px Jim From jwcolby at colbyconsulting.com Fri Jul 9 14:06:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Jul 2010 15:06:48 -0400 Subject: [dba-VB] Suddenly I can see Message-ID: <4C377348.9030103@colbyconsulting.com> I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am building. The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat little light pipe system to display the power and activity on each disk. The disk sleds plug in to a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic light pipes along the side of the sled which pipes the light to the front so it can be seen. Really cool I thought. What this means to me is that for the first time I can actually see which disks are in use. The server "lights up like a Christmas tree" when stuff is actually written to disk. I am now able to actually compare the screen as I run processes, and watch the lights and I'm here to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a burst of disk activity a half second long, then many seconds of crunching, then a half second of disk activity. -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Fri Jul 9 16:40:45 2010 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 09 Jul 2010 23:40:45 +0200 Subject: [dba-VB] Suddenly I can see Message-ID: Hi John Links please? How noisy is this beauty? /gustav >>> jwcolby at colbyconsulting.com 09-07-2010 21:06 >>> I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am building. The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat little light pipe system to display the power and activity on each disk. The disk sleds plug in to a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic light pipes along the side of the sled which pipes the light to the front so it can be seen. Really cool I thought. What this means to me is that for the first time I can actually see which disks are in use. The server "lights up like a Christmas tree" when stuff is actually written to disk. I am now able to actually compare the screen as I run processes, and watch the lights and I'm here to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a burst of disk activity a half second long, then many seconds of crunching, then a half second of disk activity. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 9 17:53:34 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Jul 2010 18:53:34 -0400 Subject: [dba-VB] Suddenly I can see In-Reply-To: References: Message-ID: <4C37A86E.6000200@colbyconsulting.com> Sorry, I thought I did. http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Links please? > How noisy is this beauty? > > /gustav > > >>>> jwcolby at colbyconsulting.com 09-07-2010 21:06 >>> > I bought a nice little (big actually) 4U rack mount case for my SQL Server, the new widget I am > building. > > The cool thing about this case is that it uses 20 hot swap disk sleds, and they have a very neat > little light pipe system to display the power and activity on each disk. The disk sleds plug in to > a backplane, and on that backplane are a green power and blue data LED. There are two clear plastic > light pipes along the side of the sled which pipes the light to the front so it can be seen. Really > cool I thought. > > What this means to me is that for the first time I can actually see which disks are in use. The > server "lights up like a Christmas tree" when stuff is actually written to disk. > > I am now able to actually compare the screen as I run processes, and watch the lights and I'm here > to tell you, my disks are not the bottleneck. SQL Server will process for many seconds and then a > burst of disk activity a half second long, then many seconds of crunching, then a half second of > disk activity. > From shamil at smsconsulting.spb.ru Sat Jul 10 05:18:10 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Jul 2010 14:18:10 +0400 Subject: [dba-VB] AJAX Control Toolkit - Was: RE: Silverlight PivotViewer In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> References: <6B9D7BCE270340EDB9C1A89BE376BDD0@nant> <59A61174B1F5B54B97FD4ADDE71E7D016B5C8C@ddi-01.DDI.local> Message-ID: <33E3D90D14B54B94BB495B3F1BCF1B8C@nant> Hi All -- FYI: (if you do not have that info yet) I have just downloaded and played with AJAX Control Toolkit http://www.asp.net/ajaxlibrary/act.ashx - and it worked very well for me - all 40 controls - the download from CodePlex has a sample ASP.NET project with all that controls: downloading, setting-up and quick playing with AJAX Control Toolkit samples within VS2008 SP1 took less than an hour - everything did work well as described/expected... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Wednesday, July 07, 2010 3:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight PivotViewer Hi Shamil, I'm using some of the ajax controls in an intranet web app upgrade I'm working on now. Tabcontrol, Accordian, popup and modal popups, water marks. As a novice I think they are easy to use. I'm also including some jquery bits as well. I have to support IE 6 and they seem to work fine in that environment. Cheers Michael Hello Gustav -- >From the page pointed by your URL I have got to another one: A2 Framework http://www.componentone.com/SuperProducts/StudioASPNET/A2+Framework/ That seems to be an advanced modern set of ASP.NET controls with AJAX and jQuery support - does anybody uses it? (it's not free - standard edition is USD800). And there is a free: ASP.NET AJAX Control Toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx Does anybody use the latter set of controls? The latter set of controls isn't as complete as the first one but it's getting developed actively and it has MS support - so it may happen it will become standard set of VS controls in the next VS release? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, July 06, 2010 1:54 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight PivotViewer Hi all This is a very capable new (free) control from MS for visualizing large amounts of data: www.silverlight.net/learn/pivotviewer /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sun Jul 11 08:19:46 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 11 Jul 2010 17:19:46 +0400 Subject: [dba-VB] OT: XP, SCRUM etc. - Sunday watch: "Kent Beck: Ease at Work..." Message-ID: Hi All -- I'm watching now Kent Beck's "Ease at Work..." year 2006 recorded webinar, and I like it, so I decided to share its link with you: http://video.google.com/videoplay?docid=7830246530742207581# Kent Beck is "thinking aloud" about a broad set of issues: When was the last time you were comfortable in your "skin" as a programmer ? When was the last time you were comfortable in your "skin" as a programmer *at work* ? Why should I to "turn off" parts of myself to work here? Something is profoundly wrong with a workplace? Something is missing in my personal worldview? Why should I do "magical things" to feel OK as a programmer? Why should I sacrifice myself to the "altar" of technological progress? Why the sense of "ease and comfort" isn't the part of my everyday work as a programmer? ... Thank you. -- Shamil From jwcolby at colbyconsulting.com Tue Jul 13 15:35:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Jul 2010 16:35:33 -0400 Subject: [dba-VB] Access source control Message-ID: <4C3CCE15.6090200@colbyconsulting.com> I am wondering whether we could put together subversion and Access to do source control. Max's eatbloat will export and import most things Access into a directory structure. Subversion could be used to move that stuff into version control. Once in subversion, we might be able to do differencing etc. Whaddayathink? -- John W. Colby www.ColbyConsulting.com From paul.hartland at googlemail.com Thu Jul 15 06:02:19 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 15 Jul 2010 12:02:19 +0100 Subject: [dba-VB] Using VBTablet.dll With vb.net Message-ID: To all, I have a wacom signature tablet, and we have a piece of code that allows our employees to make digital signatures, but dont seem to be able to get it working. The application looks for a flag file (just empty text file called Update.flg) and if it doesn't exist the application runs a bat file copying & registering the VBTablet.dll and WinTab32.dll into their windows\system32 directory, then asks the user to close the application and re-run it. However when anyone tried to run it, they get the message that no tablet devices are detected on the system. I have been working with our helpdesk, using clean laptop images and still cant get it to work for some reason. Has anyone out their had experience of using the VBTablet.dll with a vb.net application, if so could you give me some pointers on what I may be doing wrong etc. Thanks in advance for any help on this, as it is becoming a real headache. -- Paul Hartland paul.hartland at googlemail.com From dw-murphy at cox.net Thu Jul 15 13:23:37 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 15 Jul 2010 11:23:37 -0700 Subject: [dba-VB] Using VBTablet.dll With vb.net In-Reply-To: References: Message-ID: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> Paul, A tablet running Windows tablet PC have the dll's installed natively. There are lots of examples of using the ImageEdit and ImagePicture controls on the internet. In fact if you download the TabletPC SDK there are many examples of using it with .NET apps. Have not heard of the .flg file, it must have something to do with the application installer. For a start look at http://msdn2.microsoft.com/en-us/library/aa813329.aspx. I know this doesn't answer your question, but it may give you a leed on where to look. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Thursday, July 15, 2010 4:02 AM To: VisualBasicList Subject: [dba-VB] Using VBTablet.dll With vb.net To all, I have a wacom signature tablet, and we have a piece of code that allows our employees to make digital signatures, but dont seem to be able to get it working. The application looks for a flag file (just empty text file called Update.flg) and if it doesn't exist the application runs a bat file copying & registering the VBTablet.dll and WinTab32.dll into their windows\system32 directory, then asks the user to close the application and re-run it. However when anyone tried to run it, they get the message that no tablet devices are detected on the system. I have been working with our helpdesk, using clean laptop images and still cant get it to work for some reason. Has anyone out their had experience of using the VBTablet.dll with a vb.net application, if so could you give me some pointers on what I may be doing wrong etc. Thanks in advance for any help on this, as it is becoming a real headache. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From paul.hartland at googlemail.com Fri Jul 16 02:44:54 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 16 Jul 2010 08:44:54 +0100 Subject: [dba-VB] Using VBTablet.dll With vb.net In-Reply-To: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> References: <6B0AC4E8241D4693AD7035EF573458AA@murphy3234aaf1> Message-ID: Thanks Doug, any help is very much appreciated, it also gave me a couple more different ideas. On 15 July 2010 19:23, Doug Murphy wrote: > Paul, > > A tablet running Windows tablet PC have the dll's installed natively. There > are lots of examples of using the ImageEdit and ImagePicture controls on > the > internet. In fact if you download the TabletPC SDK there are many examples > of using it with .NET apps. Have not heard of the .flg file, it must have > something to do with the application installer. For a start look at > http://msdn2.microsoft.com/en-us/library/aa813329.aspx. I know this > doesn't > answer your question, but it may give you a leed on where to look. > > Doug > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland > Sent: Thursday, July 15, 2010 4:02 AM > To: VisualBasicList > Subject: [dba-VB] Using VBTablet.dll With vb.net > > To all, > > I have a wacom signature tablet, and we have a piece of code that allows > our > employees to make digital signatures, but dont seem to be able to get it > working. > > The application looks for a flag file (just empty text file called > Update.flg) and if it doesn't exist the application runs a bat file copying > & registering the VBTablet.dll and WinTab32.dll into their windows\system32 > directory, then asks the user to close the application and re-run it. > > However when anyone tried to run it, they get the message that no tablet > devices are detected on the system. > > I have been working with our helpdesk, using clean laptop images and still > cant get it to work for some reason. Has anyone out their had experience > of > using the VBTablet.dll with a vb.net application, if so could you give me > some pointers on what I may be doing wrong etc. > > Thanks in advance for any help on this, as it is becoming a real headache. > > -- > Paul Hartland > paul.hartland at googlemail.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From shamil at smsconsulting.spb.ru Sat Jul 17 05:19:48 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 17 Jul 2010 14:19:48 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers Message-ID: Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil From dw-murphy at cox.net Sat Jul 17 13:19:49 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Sat, 17 Jul 2010 11:19:49 -0700 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 17 17:46:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 17 Jul 2010 18:46:33 -0400 Subject: [dba-VB] =?windows-1252?q?Google=92s_Disk_Failure_Experience?= Message-ID: <4C4232C9.9090608@colbyconsulting.com> http://storagemojo.com/2007/02/19/googles-disk-failure-experience/ I had seen this before but it is an interesting read. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 17 22:31:28 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 17 Jul 2010 23:31:28 -0400 Subject: [dba-VB] FAQ: What is MTBF? Message-ID: <4C427590.2000303@colbyconsulting.com> http://www.t-cubed.com/faq_mtbf.htm -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 17 23:01:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 18 Jul 2010 00:01:36 -0400 Subject: [dba-VB] disk drive temps for the Norco 4020 Message-ID: <4C427CA0.4040400@colbyconsulting.com> I bought the Norco 4020 to build a server with. http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product I am impressed with the case, though it is consumer grade. It is tough to work with however. It has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and the disk backplanes. Obviously it is impossible to leave the wall in place and get all of the cables in, but removing the fan wall is a job for a safe cracker. None the less I did so, got 20 disks in and cabled up, then reinserted the fan wall, and then threaded the cables through the holes in the BOTTOM of the fan wall. Why on earth they didn't leave the holes on the top of the fan wall is beyond me but they didn't. Anyway, for the first time tonight I tested temps with all 20 drives inserted and power applied, and the fan wall operating. I ran a defrag on every volume simultaneously in order to cause the disks to work and generate as much heat as I could cause. Below are the temps. CPU Temperature 55 ?C Ctrl Temperature 49 ?C Power +12V 12.099 V Power +5V 5.053 V Power +3.3V 3.328 V SATA PHY +2.5V 2.528 V DDR-II +1.8V 1.872 V PCI-E +1.8V 1.872 V CPU +1.8V 1.856 V CPU +1.2V 1.232 V DDR-II +0.9V 0.928 V Hdd#1 Temperature 37 ?C Hdd#2 Temperature 40 ?C Hdd#3 Temperature 42 ?C Hdd#4 Temperature 39 ?C Hdd#5 Temperature 47 ?C Hdd#6 Temperature 51 ?C Hdd#7 Temperature 49 ?C Hdd#8 Temperature 46 ?C Hdd#9 Temperature 37 ?C Hdd#10 Temperature 49 ?C Hdd#11 Temperature 44 ?C Hdd#12 Temperature 47 ?C Hdd#13 Temperature 45 ?C Hdd#14 Temperature 50 ?C Hdd#15 Temperature 49 ?C Hdd#16 Temperature 42 ?C There are only 16 drives showing because these 16 are cabled up to my Areca raid co-processor card which is a 16 port card, and that card provides a utility to watch these numbers. The other disks are not being driven but do have power applied. I am satisfied with the temps. Several disks actually hit 53 degrees C under max stress but that is acceptable to me. I would like lower temps but I can live with these. BTW I am using the Corsair 750W modular PS which is a NICE PS. http://www.newegg.com/Product/Product.aspx?Item=N82E16817139010 The 12V cables are ribbon cables which makes them very easy to run and minimizes the air flow impedance. With only 2 inches to work with between the fans and disks, I need all the help I can get. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sun Jul 18 02:30:34 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 18 Jul 2010 11:30:34 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Message-ID: Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From garykjos at gmail.com Sun Jul 18 10:09:29 2010 From: garykjos at gmail.com (Gary Kjos) Date: Sun, 18 Jul 2010 10:09:29 -0500 Subject: [dba-VB] [dba-SQLServer] disk drive temps for the Norco 4020 In-Reply-To: <4C427CA0.4040400@colbyconsulting.com> References: <4C427CA0.4040400@colbyconsulting.com> Message-ID: I was reading some of the reviews posted on the Newegg site when you first posted the link to your new server case and it seemed like other people who purchased it were concerned about the heat the disks would be creating due to lack of space between the drives etc. Nice that you can monitor them. Continued good luck with your new server. GK On Sat, Jul 17, 2010 at 11:01 PM, jwcolby wrote: > I bought the Norco 4020 to build a server with. > > http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product > > I am impressed with the case, though it is consumer grade. ?It is tough to work with however. ?It > has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and > the disk backplanes. ?Obviously it is impossible to leave the wall in place and get all of the > cables in, but removing the fan wall is a job for a safe cracker. > > -- Gary Kjos garykjos at gmail.com From jwcolby at colbyconsulting.com Sun Jul 18 10:21:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 18 Jul 2010 11:21:39 -0400 Subject: [dba-VB] [dba-SQLServer] disk drive temps for the Norco 4020 In-Reply-To: References: <4C427CA0.4040400@colbyconsulting.com> Message-ID: <4C431C03.7020503@colbyconsulting.com> Yea, I am one of those concerned. The bottom of the drive sled touches the top of the drive underneath it. Not a lot of room for drawing air through the drive area. One of the things that people are doing (me included) is to duct tape the holes on the bottom of the fan wall to prevent air from circulating in a big circle, and force the maximum air possible to be pulled through the front past the disks. Other than that I am loving the case. It is easy to find cases for lots of disks... if you don't mind paying $2000. I don't have that kind of money so this case is one alternative. If anyone else knows of lost cost cases like this speak up. John W. Colby www.ColbyConsulting.com Gary Kjos wrote: > I was reading some of the reviews posted on the Newegg site when you > first posted the link to your new server case and it seemed like other > people who purchased it were concerned about the heat the disks would > be creating due to lack of space between the drives etc. Nice that you > can monitor them. > > Continued good luck with your new server. > > GK > > On Sat, Jul 17, 2010 at 11:01 PM, jwcolby wrote: >> I bought the Norco 4020 to build a server with. >> >> http://www.newegg.com/Product/Product.aspx?Item=N82E16811219021&cm_re=4u_rackmount_case-_-11-219-021-_-Product >> >> I am impressed with the case, though it is consumer grade. It is tough to work with however. It >> has a fan wall just behind the disk drive cage which leaves exactly two inches between the fans and >> the disk backplanes. Obviously it is impossible to leave the wall in place and get all of the >> cables in, but removing the fan wall is a job for a safe cracker. >> >> > From dw-murphy at cox.net Sun Jul 18 19:49:45 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Sun, 18 Jul 2010 17:49:45 -0700 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> Message-ID: <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> Hello Shamil, It costs nothing to send through the web interface portal numbers. Each provider has a portal. You can not recieve with this method though. If you want to send and recieve possibly the best thing would be a cellular modem and a cheap cell plan for it. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, July 18, 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Jul 19 06:46:32 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 19 Jul 2010 15:46:32 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> References: <6600CA2765D041C89904C9F5D8B49311@murphy3234aaf1> <99F2343C089D41B0B2447DD9B8E30DC5@murphy3234aaf1> Message-ID: <74D815DD703B45F8B957DE8C558934B6@nant> Thank you, Doug, Cellular modems can't be used there - just plain simple mobile phones to send a short SMS message once a day... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, July 19, 2010 4:50 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, It costs nothing to send through the web interface portal numbers. Each provider has a portal. You can not recieve with this method though. If you want to send and recieve possibly the best thing would be a cellular modem and a cheap cell plan for it. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, July 18, 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Doug, Thank you for your information. But to send SMS messages "through each providers sms interface" you have to pay for that "sms interface" web access or it is free there? Or I'm missing the way you use it there? First of all I have to find a way how to *receive* SMS messages from "field force automation" users/employees who will work worldwide, and who will have only SMS messaging option using their mobile phones, no GPRS, no 3rd or 4th-generation web access from their mobile phones - "stone age" you know :) And that sending SMS messages' costs should be as low as possible optimally equal to the costs of sending SMS message locally in each country. As the messages should be sent every day then I'd expect there should be satisfactory low cost (batch) option available from providers as http://www.clickatell.com/products/two_way.php ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Saturday, July 17, 2010 10:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hello Shamil, I looked at providers for a messeging application for an organization we work with. They all charged on a per message basis and we are low/no budget so that wasn't feasible. What I did was to create our messaging database with each persons provider. That way the messages could be sent through each providers sms interface, e.g. AT&T is @txt.att.net. I then use that and the users number to send the messages as I would sending an email from access. I found a web site that had all the providers portal addresses, but for some reason didn't capture the url or can't find where I stored it. My brain does not have a very good search function and what is there only degrades with time. CellProviderID Provider ProviderTextPortal 1 T-Mobile @tmomail.net 2 Virgin Mobile @vmobl.com 3 Cingular @cingularme.com 4 Sprint @messaging.sprintpcs.com 5 Verizon @vtext.com 6 Nextel @messaging.nextel.com 7 US Cellular @email.uscc.net 8 SunCom @tms.suncom.com 9 Powertel @ptel.net 10 AT&T @txt.att.net 11 Alltel @message.alltel 12 PCS @MyMetroPcs.com Hope this helps to some extent. This may not be a satisfactory solution for a business application. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 17, 2010 3:20 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Low Cost Worldwide SMS providers Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 19 22:32:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 19 Jul 2010 23:32:44 -0400 Subject: [dba-VB] SCO/Novell suit is over, SCO loses Message-ID: <4C4518DC.9090305@colbyconsulting.com> http://www.crunchgear.com/2010/06/11/sconovell-suit-is-over-sco-loses/ -- John W. Colby www.ColbyConsulting.com From accessd at shaw.ca Tue Jul 20 00:13:55 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 19 Jul 2010 22:13:55 -0700 Subject: [dba-VB] SCO/Novell suit is over, SCO loses In-Reply-To: <4C4518DC.9090305@colbyconsulting.com> References: <4C4518DC.9090305@colbyconsulting.com> Message-ID: That is truly sad. At one time it was the best UNIX Company out there. I was even a certified installers and reseller and made a good coin with their products. The trouble with the UNIX market is that they were all a bunch of warring camps and they were too busy fighting each other while a small company like Microsoft slide out of nowhere and effectively wiped them all out. It did not matter to anyone that UNIX was a superior operating system, it was always much more important to have a good user friendly interface. Presentation has always been more important than functionality. After the great UNIX wars, the intransient companies continued fighting until their own oblivion and to make themselves little more than a foot note in history. You have to go no further your dictionary and look up the word intransient and you will find the SCO icon clearly displayed. UNIX still exists in the mini and main frame but little else. Microsoft did not even fire a shot and watched their only challengers wipe them selves out. But before Microsoft could claim complete world dominance another flavour of UNIX or Linux appeared; stable, powerful and free. Microsoft has claimed that Linux is the single greatest threat to free enterprise system and maybe it is. Fifteen years later and now Microsoft is watching its empire slowly eroding. Its competitors are using a flavour of Linux UNIX like Mac, using Linux to control the internet like Google or moving to their own desktop, like Ubuntu. Will Linux ever dominate the market? No; but neither or ever again will Microsoft. Some say that Linux is not ready for prime time but when your 10 or 12 year old son or daughter can easily install it, the old fears are just that; old fears. SCO Unix on the other hand is an old and dying product, the epitome and poster boy of the UNIX wars. The only SCO I think of now is the producer of a very fine brand of non alcoholic ginger beer of which I would highly recommend to anyone. For you Unix buffs who want to see the turbulent UNIX/Linux world check out the following: http://www.quicklycode.com/wp-content/files/unix_history.png Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 19, 2010 8:33 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] SCO/Novell suit is over, SCO loses http://www.crunchgear.com/2010/06/11/sconovell-suit-is-over-sco-loses/ -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 20 13:28:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 14:28:55 -0400 Subject: [dba-VB] Has anyone used this? Message-ID: <4C45EAE7.4050203@colbyconsulting.com> http://www.dofactory.com/Framework/Framework.aspx -- John W. Colby www.ColbyConsulting.com From ha at phulse.com Tue Jul 20 13:53:50 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Tue, 20 Jul 2010 19:53:50 +0100 Subject: [dba-VB] Has anyone used this? In-Reply-To: <4C45EAE7.4050203@colbyconsulting.com> References: <4C45EAE7.4050203@colbyconsulting.com> Message-ID: This is a joke, right? Hans-Christian Web Application Development, London, UK e: hans.andersen at phulse.com t: +44 (0)782 894 5456 w: http://nokenode.com l: http://uk.linkedin.com/in/andersenhc ------------------------------------------------------ Unique Gifts, Collectables, Artwork ------------------------------------------------------ Come one Come all to www.corinnajasmine.com ------------------------------------------------------ On 20 July 2010 19:28, jwcolby wrote: > http://www.dofactory.com/Framework/Framework.aspx > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jul 20 14:16:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 15:16:48 -0400 Subject: [dba-VB] C# Sysvars Message-ID: <4C45F620.6010807@colbyconsulting.com> In Access I had a system for handling what I call SysVars, which are program global variables, stored in a table, cached as the program opens. SysVar VarID - Int - surrogate key VarName - Str - name of the variable VarVal - Str - Value of the variable VarDescr - Str - description of how the variable is used VarRefresh - Bool - needs to be refreshed before use. This essentially replaces what many developers use, a single record in a table where you add a new field every time you need a new variable (yuk). Just as an example... I have an asynchronous process where I: 1) Send 2 million record chunks of data to files on disk. 2) Ship the chunk files over to a VM input directory for processing 3) Process each file, placing the processed result files in an output directory. 4) Watch the output directory for processed files and ship back to the server 5) Import the chunks back in to SQL Server. The problem is that step 3 takes about 1 hour per file. If I run this process on a large table I can export 30 files to the VM which translates into 30 hours before it finishes processing. If I get a rush order, I need to delete the files in the VM so that they are not clogging up the works and not automatically send those files back to the VM until I say so. I have a SysVar called VMHold which is a true / false, true if hold files going to the vm and false if not. I can set / reset this sysvar through a sysvars class, and it reads / writes the value to the sql server tlbSysVars, caching them in memory as the program opens, refreshing them before use ONLY if the varRefresh is true. That is what I call SysVars and how / why I use them. It seems like everyone would use these for any moderately complex asynchronous or multi-user program. I am looking for feedback on how others implement this functionality. I will write a second email regarding some of the issues I am running into. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 20 14:18:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 15:18:09 -0400 Subject: [dba-VB] Has anyone used this? In-Reply-To: References: <4C45EAE7.4050203@colbyconsulting.com> Message-ID: <4C45F671.5050505@colbyconsulting.com> LOL, they don't think so. Am I missing something? John W. Colby www.ColbyConsulting.com Hans-Christian Andersen wrote: > This is a joke, right? > > Hans-Christian > Web Application Development, London, UK > > e: hans.andersen at phulse.com > t: +44 (0)782 894 5456 > w: http://nokenode.com > l: http://uk.linkedin.com/in/andersenhc > > ------------------------------------------------------ > Unique Gifts, Collectables, Artwork > ------------------------------------------------------ > Come one > Come all to > www.corinnajasmine.com > ------------------------------------------------------ > > > > On 20 July 2010 19:28, jwcolby wrote: > >> http://www.dofactory.com/Framework/Framework.aspx >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From ha at phulse.com Tue Jul 20 16:00:52 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Tue, 20 Jul 2010 22:00:52 +0100 Subject: [dba-VB] Has anyone used this? In-Reply-To: <4C45F671.5050505@colbyconsulting.com> References: <4C45EAE7.4050203@colbyconsulting.com> <4C45F671.5050505@colbyconsulting.com> Message-ID: Perhaps I am the one missing something, but it seems to me that they are selling their code as if it were plug-able modules, when, in reality, design patterns are concepts. Concepts you need to understand before you can use them, in which case, you should be able to write them yourself. Just feels a bit snake oil-ish to me. But that could just be their marketing department advertising it wrong. Hans-Christian Web Application Development, London, UK e: hans.andersen at phulse.com t: +44 (0)782 894 5456 w: http://nokenode.com l: http://uk.linkedin.com/in/andersenhc ------------------------------------------------------ Unique Gifts, Collectables, Artwork ------------------------------------------------------ Come one Come all to www.corinnajasmine.com ------------------------------------------------------ On 20 July 2010 20:18, jwcolby wrote: > LOL, they don't think so. > > Am I missing something? > > John W. Colby > www.ColbyConsulting.com > > > Hans-Christian Andersen wrote: > > This is a joke, right? > > > > Hans-Christian > > Web Application Development, London, UK > > > > e: hans.andersen at phulse.com > > t: +44 (0)782 894 5456 > > w: http://nokenode.com > > l: http://uk.linkedin.com/in/andersenhc > > > > ------------------------------------------------------ > > Unique Gifts, Collectables, Artwork > > ------------------------------------------------------ > > Come one > > Come all to > > www.corinnajasmine.com > > ------------------------------------------------------ > > > > > > > > On 20 July 2010 19:28, jwcolby wrote: > > > >> http://www.dofactory.com/Framework/Framework.aspx > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jul 20 18:10:35 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Jul 2010 19:10:35 -0400 Subject: [dba-VB] Has anyone used this? In-Reply-To: References: <4C45EAE7.4050203@colbyconsulting.com> <4C45F671.5050505@colbyconsulting.com> Message-ID: <4C462CEB.6080305@colbyconsulting.com> >when, in reality, design patterns are concepts. Concepts you need to understand before you can use them in which case, you should be able to write them yourself. I can understand SQL Server but I don't want to write a database. >Just feels a bit snake oil-ish to me. But that could just be their marketing department advertising it wrong. And so I ask... is anyone actually using this... John W. Colby www.ColbyConsulting.com Hans-Christian Andersen wrote: > Perhaps I am the one missing something, but it seems to me that they are > selling their code as if it were plug-able modules, when, in reality, design > patterns are concepts. Concepts you need to understand before you can use > them, in which case, you should be able to write them yourself. Just feels a > bit snake oil-ish to me. But that could just be their marketing department > advertising it wrong. > > > Hans-Christian > Web Application Development, London, UK > > e: hans.andersen at phulse.com > t: +44 (0)782 894 5456 > w: http://nokenode.com > l: http://uk.linkedin.com/in/andersenhc > > ------------------------------------------------------ > Unique Gifts, Collectables, Artwork > ------------------------------------------------------ > Come one > Come all to > www.corinnajasmine.com > ------------------------------------------------------ > > > > On 20 July 2010 20:18, jwcolby wrote: > >> LOL, they don't think so. >> >> Am I missing something? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Hans-Christian Andersen wrote: >>> This is a joke, right? >>> >>> Hans-Christian >>> Web Application Development, London, UK >>> >>> e: hans.andersen at phulse.com >>> t: +44 (0)782 894 5456 >>> w: http://nokenode.com >>> l: http://uk.linkedin.com/in/andersenhc >>> >>> ------------------------------------------------------ >>> Unique Gifts, Collectables, Artwork >>> ------------------------------------------------------ >>> Come one >>> Come all to >>> www.corinnajasmine.com >>> ------------------------------------------------------ >>> >>> >>> >>> On 20 July 2010 19:28, jwcolby wrote: >>> >>>> http://www.dofactory.com/Framework/Framework.aspx >>>> >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-VB mailing list >>>> dba-VB at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From gustav at cactus.dk Wed Jul 21 01:10:12 2010 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 21 Jul 2010 08:10:12 +0200 Subject: [dba-VB] Low Cost Worldwide SMS providers Message-ID: Hi Shamil Skype? Would require the Skype client to be installed though. /gustav >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil From pcs.accessd at gmail.com Wed Jul 21 01:20:30 2010 From: pcs.accessd at gmail.com (Borge Hansen) Date: Wed, 21 Jul 2010 16:20:30 +1000 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: Hi Shamil, www.exetel.com.au is an australian communications company. They currently offer sms to local (Australian) numbers for A$0.05 per sms International sms is A$.088 (8.8 cents) They have an api so you can incorporate sending sms into your application. check it out.... Their order form for (residential) low cost sms is https://www.exetel.com.au/sms/sms_order1.php This is for a pre-paid account - pay A$10 and test it out.... I am currently testing it out myself. Regards Borge Hansen, Gold Coast, Australia On Wed, Jul 21, 2010 at 4:10 PM, Gustav Brock wrote: > Hi Shamil > > Skype? > Would require the Skype client to be installed though. > > /gustav > > >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> > Hi All -- > > I'm looking for a low cost worldwide two-way SMS provider to be integrated > in my customer's application: > > Google search: > > http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide > rs&aq=f&aqi=&aql=&oq=&gs_rfai= > > > has returned the following links: > > 1. http://www.clickatell.com/products/two_way.php > 2. http://www.ficall.com/english/#/ficall/about > 3. http://www.animatele.com/index.html > > > The first one - Clickatell - seems to be a good option. Do you have any > experience in working with Clickatell? Do you know and successfully used > any > other low cost worldwide SMS providers in your applications? > > > Thank you. > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Jul 21 07:42:05 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Jul 2010 08:42:05 -0400 Subject: [dba-VB] Friday Humor Message-ID: <4C46EB1D.40605@colbyconsulting.com> One year, I decided to buy my mother-in-law a cemetery plot as a Christmas gift... The next year, I didn't buy her a gift. When she asked me why, I replied, "Well, you still haven't used the gift I bought you last year!" And that's how the fight started..... ______________________________ My wife and I were watching Who Wants To Be A Millionaire while we were in bed. I turned to her and said, 'Do you want to have Sex?' 'No,' she answered. I then said, 'Is that your final answer?' She didn't even look at me this time, simply saying, 'Yes..' So I said, "Then I'd like to phone a friend." And that's when the fight started... ________________________________ I took my wife to a restaurant. The waiter, for some reason, took my order first. "I'll have the rump steak, rare, please." He said, "Aren't you worried about the mad cow?" "Nah, she can order for herself." And that's when the fight started..... ________________________________ My wife and I were sitting at a table at her high school reunion, and she kept staring at a drunken man swigging his drink as he sat alone at a nearby table. I asked her, "Do you know him?" "Yes", she sighed, "He's my old boyfriend.... I understand he took to drinking right after we split up those many years ago, and I hear he hasn't been sober since." "My God!" I said, "Who would think a person could go on celebrating that long?" And then the fight started... ________________________________ When our lawn mower broke and wouldn't run, my wife kept hinting to me that I should get it fixed. But, somehow I always had something else to take care of first, the shed, the boat, making beer.. Always something more important to me. Finally she thought of a clever way to make her point. When I arrived home one day, I found her seated in the tall grass, busily snipping away with a tiny pair of sewing scissors. I watched silently for a short time and then went into the house.. I was gone only a minute, and when I came out again I handed her a toothbrush. I said, "When you finish cutting the grass, you might as well sweep the driveway." The doctors say I will walk again, but I will always have a limp. ________________________________ My wife sat down next to me as I was flipping channels. She asked, "What's on TV?" I said, "Dust." And then the fight started... ________________________________ Saturday morning I got up early, quietly dressed, made my lunch, and slipped quietly into the garage. I hooked up the boat up to the van, and proceeded to back out into a torrential downpour. The wind was blowing 50 mph, so I pulled back into the garage, turned on the radio, and discovered that the weather would be bad all day. I went back into the house, quietly undressed, and slipped back into bed.. I cuddled up to my wife's back, now with a different anticipation, and whispered, "The weather out there is terrible." My loving wife of 5 years replied, "And, can you believe my stupid husband is out fishing in that?" And that's how the fight started... ________________________________ My wife was hinting about what she wanted for our upcoming anniversary. She said, "I want something shiny that goes from 0 to 150 in about 3 seconds." I bought her a bathroom scale. And then the fight started...... ________________________________ After retiring, I went to the Social Security office to apply for Social Security. The woman behind the counter asked me for my driver's License to verify my age. I looked in my pockets and realized I had left my wallet at home. I told the woman that I was very sorry, but I would have to go home and come back later. The woman said, 'Unbutton your shirt'. So I opened my shirt revealing my curly silver hair. She said, 'That silver hair on your chest is proof enough for me' and she processed my Social Security application.. When I got home, I excitedly told my wife about my experience at the Social Security office... She said, 'You should have dropped your pants. You might have gotten disability, too.' And then the fight started... ________________________________ My wife was standing nude, looking in the bedroom mirror. She was not happy with what she saw and said to me, "I feel horrible; I look old, fat and ugly. I really need you to pay me a compliment.' I replied, "Your eyesight's damn near perfect." And then the fight started........ -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:43:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:43:25 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <11C05396010D46A7AA66094042A83C48@nant> Hi Gustav -- No, Skype can't be used AFAIU - "front-end" SMS sending device could be just a simple mobile phone... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 21, 2010 10:10 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hi Shamil Skype? Would require the Skype client to be installed though. /gustav >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> Hi All -- I'm looking for a low cost worldwide two-way SMS provider to be integrated in my customer's application: Google search: http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide rs&aq=f&aqi=&aql=&oq=&gs_rfai= has returned the following links: 1. http://www.clickatell.com/products/two_way.php 2. http://www.ficall.com/english/#/ficall/about 3. http://www.animatele.com/index.html The first one - Clickatell - seems to be a good option. Do you have any experience in working with Clickatell? Do you know and successfully used any other low cost worldwide SMS providers in your applications? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:43:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:43:25 +0400 Subject: [dba-VB] C# Sysvars In-Reply-To: <4C45F620.6010807@colbyconsulting.com> References: <4C45F620.6010807@colbyconsulting.com> Message-ID: <2D6B3569445A4B7F8DE277D5B0FC87F7@nant> Hi John -- You probably mean handling "Locking and Thread Safety" http://www.albahari.com/threading/part2.aspx#_Locking or "best practices" in implementing of Singleton pattern http://www.yoda.arachsys.com/csharp/singleton.html while using your Sysvars ? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 20, 2010 11:17 PM To: VBA Subject: [dba-VB] C# Sysvars In Access I had a system for handling what I call SysVars, which are program global variables, stored in a table, cached as the program opens. SysVar VarID - Int - surrogate key VarName - Str - name of the variable VarVal - Str - Value of the variable VarDescr - Str - description of how the variable is used VarRefresh - Bool - needs to be refreshed before use. This essentially replaces what many developers use, a single record in a table where you add a new field every time you need a new variable (yuk). Just as an example... I have an asynchronous process where I: 1) Send 2 million record chunks of data to files on disk. 2) Ship the chunk files over to a VM input directory for processing 3) Process each file, placing the processed result files in an output directory. 4) Watch the output directory for processed files and ship back to the server 5) Import the chunks back in to SQL Server. The problem is that step 3 takes about 1 hour per file. If I run this process on a large table I can export 30 files to the VM which translates into 30 hours before it finishes processing. If I get a rush order, I need to delete the files in the VM so that they are not clogging up the works and not automatically send those files back to the VM until I say so. I have a SysVar called VMHold which is a true / false, true if hold files going to the vm and false if not. I can set / reset this sysvar through a sysvars class, and it reads / writes the value to the sql server tlbSysVars, caching them in memory as the program opens, refreshing them before use ONLY if the varRefresh is true. That is what I call SysVars and how / why I use them. It seems like everyone would use these for any moderately complex asynchronous or multi-user program. I am looking for feedback on how others implement this functionality. I will write a second email regarding some of the issues I am running into. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:46:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:46:39 +0400 Subject: [dba-VB] Low Cost Worldwide SMS providers In-Reply-To: References: Message-ID: <6EC65E2729FD472AA1A5AC2B5534B318@nant> Thank you, Borge. Yes, that seems to be a good option to send SMS from computers but as I noted here in my customer case "front-end" is a simple mobile phone they use once a day (every day) to send just one SMS message - and that "front-ends" can be located everywhere in this small world - and they wanted SMS sending costs to be as low as possible - the companies as Clickatel (http://www.clickatell.com/products/two_way.php ) AFAIU have special agreements with many countries SMS providers to get local SMS messages sent to special mobile numbers transferred to Clickatel servers where from they can be retrieved many ways - now using computers... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Wednesday, July 21, 2010 10:21 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Low Cost Worldwide SMS providers Hi Shamil, www.exetel.com.au is an australian communications company. They currently offer sms to local (Australian) numbers for A$0.05 per sms International sms is A$.088 (8.8 cents) They have an api so you can incorporate sending sms into your application. check it out.... Their order form for (residential) low cost sms is https://www.exetel.com.au/sms/sms_order1.php This is for a pre-paid account - pay A$10 and test it out.... I am currently testing it out myself. Regards Borge Hansen, Gold Coast, Australia On Wed, Jul 21, 2010 at 4:10 PM, Gustav Brock wrote: > Hi Shamil > > Skype? > Would require the Skype client to be installed though. > > /gustav > > >>> shamil at smsconsulting.spb.ru 17-07-10 12:19 >>> > Hi All -- > > I'm looking for a low cost worldwide two-way SMS provider to be integrated > in my customer's application: > > Google search: > > http://www.google.ru/search?hl=ru&source=hp&q=low+cost+worldwide+SMS+provide > rs&aq=f&aqi=&aql=&oq=&gs_rfai= > > > has returned the following links: > > 1. http://www.clickatell.com/products/two_way.php > 2. http://www.ficall.com/english/#/ficall/about > 3. http://www.animatele.com/index.html > > > The first one - Clickatell - seems to be a good option. Do you have any > experience in working with Clickatell? Do you know and successfully used > any > other low cost worldwide SMS providers in your applications? > > > Thank you. > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Jul 21 09:48:56 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 21 Jul 2010 18:48:56 +0400 Subject: [dba-VB] Friday Humor In-Reply-To: <4C46EB1D.40605@colbyconsulting.com> References: <4C46EB1D.40605@colbyconsulting.com> Message-ID: <757355B821DE4FC3801B82FAA593A52C@nant> LOL. Is it Friday there already? :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 21, 2010 4:42 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] Friday Humor ... My wife sat down next to me as I was flipping channels. She asked, "What's on TV?" I said, "Dust." And then the fight started... ... -- John W. Colby www.ColbyConsulting.com _______________________________________________ From andy at minstersystems.co.uk Wed Jul 21 09:58:00 2010 From: andy at minstersystems.co.uk (Andrew Lacey) Date: Wed, 21 Jul 2010 15:58:00 +0100 (BST) Subject: [dba-VB] Friday Humor In-Reply-To: <757355B821DE4FC3801B82FAA593A52C@nant> References: <4C46EB1D.40605@colbyconsulting.com> <757355B821DE4FC3801B82FAA593A52C@nant> Message-ID: <1958596177.20915.1279724280879.JavaMail.open-xchange@oxltgw14.schlund.de> Nah, but it's quiet. Good one JC. ? Andy On 21 July 2010 at 16:48 Shamil Salakhetdinov wrote: > LOL. > > Is it Friday there already? :) > > -- Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, July 21, 2010 4:42 PM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] Friday Humor > > ... > > My wife sat down next to me as I was flipping channels. > She asked, "What's on TV?" > I said, "Dust." > And then the fight started... > > > ... > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Thu Jul 22 23:36:58 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 00:36:58 -0400 Subject: [dba-VB] C# custom exceptions Message-ID: <4C491C6A.7080306@colbyconsulting.com> I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 00:11:31 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 01:11:31 -0400 Subject: [dba-VB] try catch finally Message-ID: <4C492483.4020203@colbyconsulting.com> OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Fri Jul 23 00:19:57 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:19:57 +1000 Subject: [dba-VB] C# custom exceptions References: <4C491C6A.7080306@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> Hi John, Check out NLog for your logging requirements. It is comprehensive and free. http://nlog-project.org/ It will write logs to just about anywhere including SQL. My take on error handling in.net is to 1st Avoid exceptions ie test for null before using the object. 2nd Use supplied methods to avoid exceptions ie If !File.Exists("C:\test.txt") ... 3rd Use supplied object exceptions ie Catch ( FileNotFound e) You will know what errors you can recover from and what is fatal to your application. Unhandled exceptions bubble up to a handler, if there is no handler it will throw an error in your Main sub. You can catch unhandled errors there, including threading errors. This is how I handled unhandled thread exceptions, with logging, in a recent app. /// /// The main entry point for the application. /// [STAThread] static void Main ( ) { Application.ThreadException += new ThreadExceptionEventHandler ( Application_ThreadException ); bool createdNew = true; using ( Mutex mutex = new Mutex ( true, "EZHL7", out createdNew ) ) { if ( createdNew ) { Application.EnableVisualStyles ( ); Application.SetCompatibleTextRenderingDefault ( false ); Application.Run ( new FormMain ( ) ); } } } static void Application_ThreadException ( object sender, ThreadExceptionEventArgs e ) { Logger logger = MyLogManager.Instance.GetCurrentClassLogger ( ); logger.FatalException ( "Unhandled Thread Error!", e.Exception ); Application.Restart ( ); } HTH Cheers Michael M PS Looking at the subject line, yes you can create your own custom errors for your custom classes. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, 23 July 2010 2:37 PM To: VBA Subject: [dba-VB] C# custom exceptions I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 23 00:25:49 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:25:49 +1000 Subject: [dba-VB] try catch finally References: <4C492483.4020203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6F@ddi-01.DDI.local> Coding in Outlook so watch out :-) OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection --> Open connection --> if connection open { open a new reader -->If reader.hasrows(); { Do something with the reader close the reader close the connection } } } } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { -->I rarely use this } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 23 00:57:00 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 23 Jul 2010 15:57:00 +1000 Subject: [dba-VB] try catch finally References: <4C492483.4020203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D70@ddi-01.DDI.local> BTW, The finally is executed before the error bubbles up to calling method. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, 23 July 2010 3:12 PM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 23 08:03:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 09:03:49 -0400 Subject: [dba-VB] C# custom exceptions In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> References: <4C491C6A.7080306@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D6E@ddi-01.DDI.local> Message-ID: <4C499335.5010600@colbyconsulting.com> Oh my, studying this carefully! Moving all logging to this would be an awesome thing. Thanks. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Hi John, > > Check out NLog for your logging requirements. It is comprehensive and > free. > http://nlog-project.org/ > It will write logs to just about anywhere including SQL. > > My take on error handling in.net is to > 1st Avoid exceptions ie test for null before using the object. > 2nd Use supplied methods to avoid exceptions ie If > !File.Exists("C:\test.txt") ... > 3rd Use supplied object exceptions ie Catch ( FileNotFound e) > > You will know what errors you can recover from and what is fatal to your > application. > Unhandled exceptions bubble up to a handler, if there is no handler it > will throw an error in your Main sub. > You can catch unhandled errors there, including threading errors. > > This is how I handled unhandled thread exceptions, with logging, in a > recent app. > > /// > /// The main entry point for the application. > /// > [STAThread] > static void Main ( ) > { > Application.ThreadException += new > ThreadExceptionEventHandler ( Application_ThreadException ); > > bool createdNew = true; > using ( Mutex mutex = new Mutex ( true, "EZHL7", out > createdNew ) ) > { > if ( createdNew ) > { > Application.EnableVisualStyles ( ); > Application.SetCompatibleTextRenderingDefault ( > false ); > Application.Run ( new FormMain ( ) ); > } > } > } > > static void Application_ThreadException ( object sender, > ThreadExceptionEventArgs e ) > { > Logger logger = MyLogManager.Instance.GetCurrentClassLogger > ( ); > logger.FatalException ( "Unhandled Thread Error!", > e.Exception ); > Application.Restart ( ); > } > > HTH > > Cheers > > Michael M > > PS Looking at the subject line, yes you can create your own custom > errors for your custom classes. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, 23 July 2010 2:37 PM > To: VBA > Subject: [dba-VB] C# custom exceptions > > I am trying to find info on how and when where and why to use custom > exceptions and particularly how to log them. > > I am developing a system which uses four asynchronous processes. > > Stage 1) Export a SQL table or view to address validation. I have a > table that has records which tell stage 1 the name of the database, view > to export, date to process, directory on disk and a few other things. > > Stage 1 creates text files on disk in a staging directory, one file for > each 2 million records exported. This creates a record in a log table > with the PK of stage 1 table, name of the database, view exported, > directory on disk (output staging directory), file name, and some date > flags to monitor completion of the remaining stages. IOW one log file > per text file exported, all info needed for the remaining stages, date > fields for each remaining stage to log that it processed that file. > > Stage 2) Move the files in the staging directory to a virtual machine. > The log files created by stage 1 are read and used to move the files and > set a datetime flag in the log record saying that stage 2 completed (the > file moved to VM). The virtual machine may not be available, but if it > is the file moves and the log record is updated. If the file goes to the > VM, the VM will process the file and place it in an output directory. > This will take between 1/2 hour and 1 hour per file. > > Stage 3) Move the completed files from the VM back to a different > (input) staging directory. Again, the log file is used to determine > what files should be available on the VM and if found and moved, a > datetime flag is set saying that file was moved back from the VM back to > the Input Staging Directory. > > Stage 4) Import the files from the input staging directory back into SQL > server. The log record for any file moved back in is marked with a > datetime flag saying that the file was imported back in to SQL server. > > I have about a dozen or so "data" tables which have to be processed > monthly, rain or shine. By placing records in the stage 1 source table, > I can cause the system to process each of my data tables. As the > process finishes, it creates a new record adding a "number of days to > next process" > to the date so that it is queued to process again in X days. > > I also have orders that I run that will write one or more records into > this same table and cause their data to process. > > So... nicely divided, asynchronous process: Sql to Staging, Staging to > VM, VM to staging, Staging in to SQL Server. These things must be > asynchronous because the VM may or may not be available, and it is > critical that each file is processed through each stage and tracked. > > Records in the main table triggers the process (stage 1). Records in > the log table track stages 2-4 for each file created in stage 1. > > I want to run 4 threads to do these processes. IOW, a process just runs > on the server (or somewhere, but probably eventually on the server). > Each stage is entirely independent, and takes its input from a table, > and writes a datetime flag as it finishes. > > > OK, so back to exceptions... > > I am new to threads. I wrote the code from the bottom up, with working > processes for doing each of the 4 stages, but triggered by button > clicks. It all worked, except that it wasn't table driven (of course). > I even had each button click create a worker thread and that worked. > > I created a supervisor class, with four methods, one for each stage. I > moved the button click code to these methods. I fired each of them up, > and it mostly works... each stage is running in its own thread and > watching the tables, updating the records as each does its thing. > Except that I would get weird errors that were not handled by any > exception handler. > > I removed all traces of messagebox.show and I *think* I have caused that > to go away. Or maybe not, who knows. > > But now I really need to get errors logged. > > Again, I am new to threading, and new to custom exceptions. New to > exception logging. Do I sound like a nubee? ;) > > Anyway, I do not particularly want to use the Windows error log because > then the error logs would be scattered around on whatever machine the > parts run on. Remember that there is a user interface part which sets > up the records in stage 1 and monitors the process. > > This is potentially a nice little system but it has to be done right or > I will fight it for the rest of my career. So I need to learn > exceptions, and I need to log the exceptions, my preference is into SQL > Server, though there are of course some potential errors (SQL server > errors) which could not be logged there because SQL server isn't > available at the instant the log is created. > > Kinda messy. > > Any pointers, articles, books, or other sources of information I could > go to to learn this stuff. > Google is not my friend in this case because I am getting stuff from > 2003 to the present and I really want modern code. > > Help! > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Jul 23 12:19:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 13:19:36 -0400 Subject: [dba-VB] C# NLog setup Message-ID: <4C49CF28.3070801@colbyconsulting.com> Can anyone step me through setting NLog up to do logging. I don't care where the destination is (file or database) I just want to get it working and starting to use it and able to look at the files, then I will go back and tweak it later. I can be dense sometimes but the initial setup seems a little arcane. Any help appreciated -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Jul 23 12:21:58 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Jul 2010 21:21:58 +0400 Subject: [dba-VB] C# custom exceptions In-Reply-To: <4C491C6A.7080306@colbyconsulting.com> References: <4C491C6A.7080306@colbyconsulting.com> Message-ID: <04E9EE312E584A37B93EBA3B1A2BD23A@nant> Hi John -- Just follow KISS principle - I used to use that principle to profile/log applications with up to one hundred threads - and I never had any issues. I do just log to a simple text file log shared by all threads, and I put lock around log text record write operation: System.IO.File.AppendAllText(...) (If you expect that putting a lock on such a simple file write operation will somehow influence badly your multi-threaded application then you can develop a code for a special utility thread handling log writes using .NET Enqueue / Dequeue features (http://msdn.microsoft.com/en-us/library/1c8bzx97.aspx ) but do not introduce that complexity from the very beginning...) I must note that nor I nor my customers usually do not care about keeping logs history - so log file records are just getting lost after several days overwritten by the new ones: the code does make log backup into a .bak file after main log file gets several MB in size - we do use log in the cases of runtime errors/bugs/other issues and one day log is usually more than enough to find and fix the issues... In your case if you wanted to log into MS SQL DB - just do it if it's available (I do use simple SP in such cases), if it's not available do log into a text file, and if the latter isn't available (e.g. no disk space) - then do log into Windows System Application Events log - one can even try to send an e-mail message using SMTP or log into a Web Service or FTP site - all that is relatively simple to do in .NET but when simple text log works well why bother about advanced logging options? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 8:37 AM To: VBA Subject: [dba-VB] C# custom exceptions I am trying to find info on how and when where and why to use custom exceptions and particularly how to log them. I am developing a system which uses four asynchronous processes. Stage 1) Export a SQL table or view to address validation. I have a table that has records which tell stage 1 the name of the database, view to export, date to process, directory on disk and a few other things. Stage 1 creates text files on disk in a staging directory, one file for each 2 million records exported. This creates a record in a log table with the PK of stage 1 table, name of the database, view exported, directory on disk (output staging directory), file name, and some date flags to monitor completion of the remaining stages. IOW one log file per text file exported, all info needed for the remaining stages, date fields for each remaining stage to log that it processed that file. Stage 2) Move the files in the staging directory to a virtual machine. The log files created by stage 1 are read and used to move the files and set a datetime flag in the log record saying that stage 2 completed (the file moved to VM). The virtual machine may not be available, but if it is the file moves and the log record is updated. If the file goes to the VM, the VM will process the file and place it in an output directory. This will take between 1/2 hour and 1 hour per file. Stage 3) Move the completed files from the VM back to a different (input) staging directory. Again, the log file is used to determine what files should be available on the VM and if found and moved, a datetime flag is set saying that file was moved back from the VM back to the Input Staging Directory. Stage 4) Import the files from the input staging directory back into SQL server. The log record for any file moved back in is marked with a datetime flag saying that the file was imported back in to SQL server. I have about a dozen or so "data" tables which have to be processed monthly, rain or shine. By placing records in the stage 1 source table, I can cause the system to process each of my data tables. As the process finishes, it creates a new record adding a "number of days to next process" to the date so that it is queued to process again in X days. I also have orders that I run that will write one or more records into this same table and cause their data to process. So... nicely divided, asynchronous process: Sql to Staging, Staging to VM, VM to staging, Staging in to SQL Server. These things must be asynchronous because the VM may or may not be available, and it is critical that each file is processed through each stage and tracked. Records in the main table triggers the process (stage 1). Records in the log table track stages 2-4 for each file created in stage 1. I want to run 4 threads to do these processes. IOW, a process just runs on the server (or somewhere, but probably eventually on the server). Each stage is entirely independent, and takes its input from a table, and writes a datetime flag as it finishes. OK, so back to exceptions... I am new to threads. I wrote the code from the bottom up, with working processes for doing each of the 4 stages, but triggered by button clicks. It all worked, except that it wasn't table driven (of course). I even had each button click create a worker thread and that worked. I created a supervisor class, with four methods, one for each stage. I moved the button click code to these methods. I fired each of them up, and it mostly works... each stage is running in its own thread and watching the tables, updating the records as each does its thing. Except that I would get weird errors that were not handled by any exception handler. I removed all traces of messagebox.show and I *think* I have caused that to go away. Or maybe not, who knows. But now I really need to get errors logged. Again, I am new to threading, and new to custom exceptions. New to exception logging. Do I sound like a nubee? ;) Anyway, I do not particularly want to use the Windows error log because then the error logs would be scattered around on whatever machine the parts run on. Remember that there is a user interface part which sets up the records in stage 1 and monitors the process. This is potentially a nice little system but it has to be done right or I will fight it for the rest of my career. So I need to learn exceptions, and I need to log the exceptions, my preference is into SQL Server, though there are of course some potential errors (SQL server errors) which could not be logged there because SQL server isn't available at the instant the log is created. Kinda messy. Any pointers, articles, books, or other sources of information I could go to to learn this stuff. Google is not my friend in this case because I am getting stuff from 2003 to the present and I really want modern code. Help! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Jul 23 13:05:08 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Jul 2010 22:05:08 +0400 Subject: [dba-VB] try catch finally In-Reply-To: <4C492483.4020203@colbyconsulting.com> References: <4C492483.4020203@colbyconsulting.com> Message-ID: <29E411AB69F94BEAAD0F7CDC492E8D19@nant> Hi John, Yes, you can dimension connection and reader object variables outside the try/catch block - something like it is done by the code in P.S. of this posting. If you have unhandled exception in your worker thread then it completes abnormally but your main thread continues running OK, still you'd better have all your worker thread exceptions handled gracefully and returning some failing code to the main thread in the case of runtime errors... Throw call issued and executed in catch block does immediately return control/"bubles" to the nearest try/catch block in the call stack, and if there is no any then worker or main thread crash... HTH, -- Shamil P.S. static void Main(string[] args) { try { tryCatchFinally(); } catch (Exception ex) { System.Console.WriteLine("Runtime.Error: " + ex.Message); } } public static void tryCatchFinally() { string serverName = @"MyServer\MySQLServer"; string databaseName = "MyDb"; SqlConnection cnn = null; SqlCommand cmd = null; SqlDataReader rdr = null; string connectionString = string.Format( @"Data Source={0};Initial Catalog={1};Integrated Security=True", serverName, databaseName); try { string cmdText = "select * from [Users]"; cnn = new SqlConnection(connectionString); cnn.Open(); cmd = new SqlCommand(cmdText, cnn); rdr = cmd.ExecuteReader(); while (rdr.Read()) { System.Console.WriteLine("{0} {1} {2}", rdr[0], rdr[1], rdr[2]); } } catch (SqlException ex) { if (cnn != null) System.Console.WriteLine("tryCatchFinally.SQL: {0} {1} {2}", cnn.WorkstationId, cnn.State, ex.Message); throw; } catch (Exception ex) { if (cnn != null) System.Console.WriteLine("tryCatchFinally.Runtime: {0} {1} {2}", cnn.WorkstationId, cnn.State, ex.Message); throw; } finally { if (rdr != null) rdr.Close(); if (cnn != null) cnn.Close(); } } -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 9:12 AM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Fri Jul 23 13:13:32 2010 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 23 Jul 2010 14:13:32 -0400 Subject: [dba-VB] try catch finally In-Reply-To: <4C492483.4020203@colbyconsulting.com> References: <4C492483.4020203@colbyconsulting.com> Message-ID: John, You are correct that you do have to dimension the connection and reader before the try. The Finally block executes whether an error is encountered or not. A good developer always makes sure the garbage got taken care of on the way out the door. The suggestion of checking that the connection did get opened before you execute the rest of the code isn't a bad idea. However, things can still go wrong once the reader/connection are opened and I've personally seen cases where the server-side still sees the connection as open even though the client-side thinks it is gone. Instead of handling the error and then throwing the exception up to the calling block, why not use Functions instead of Procedures and pass back a Boolean indicating whether the operation was successful. Doris Manning Sr. Developer & Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 1:12 AM To: VBA Subject: [dba-VB] try catch finally OK, so I am trying to learn exception handling. One of the things I am reading is to make heavy use of finally to do cleanup. Fine, except I am ending up with scope issues. for example: Try { set a new connection open a new reader Do something with the reader close the reader close the connection } catch(sqlexception) { handle the sql errors throw; } catch (exception) { handle the nonsql errors throw; } finally { } Logically the close of the reader and connection should go in the finally, with the catch catching any issues actually opening the connection or reader. That doesn't work however because the connection and reader are not in scope in the finally block. It appears that the dimensioning of the connection and reader have to go before the try in order for the finally to see the scope? I assume that the finally block executes after the throw? What happens to the execution thread on a throw? Does the thread execute code up in any sink up above? Does execution return back into this block of code after the code up in the the parent sink finishes executing? I am so confused. ;) -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 23 14:05:14 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:05:14 -0400 Subject: [dba-VB] C# - what am I doing wrong here? Message-ID: <4C49E7EA.2000609@colbyconsulting.com> OK so I want to do the right thing, I just don't know how. 8( In the following code, I want to declare the connection and command object outside the try, initialize the two objects inside of a try, catch any errors, and finally cleanup. The objects in the finally say that they were never initialized. If I put them inside of the try, it complains that the objects aren't valid in the scope of the finally. If I initialize them outside of the try it isn't using a try and errors will not be handled. It seems that I am damned any way I look at this. namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn; SqlCommand myCommand; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { myCommand.Dispose(); mCnn.Close(); } } } } -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 14:47:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:47:15 -0400 Subject: [dba-VB] Oh man, I love this piece Message-ID: <4C49F1C3.1030708@colbyconsulting.com> If it worked... but it doesn't. What a MESS! http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 14:51:13 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 15:51:13 -0400 Subject: [dba-VB] C# - but what happened to catch? Message-ID: <4C49F2B1.3060600@colbyconsulting.com> http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Jul 23 15:07:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Jul 2010 16:07:55 -0400 Subject: [dba-VB] c# so FINALLY ? Message-ID: <4C49F69B.2030403@colbyconsulting.com> The version that seems to addre4ss all of the issues: namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } } } What do you do with the command object? Does it need cleanup handling at all? It doesn't have a close method, though it does have a dispose method. And finally (pun intended) what should I do with this method? Return a boolean true = worked? But WHERE? The finally will execute whether the function "worked" or not. AFTER the finally block? As I understand it that code would ONLY execute if the catch statements do not throw an error? A throw does exit the function never to return correct? Should I log (write to a log file) BEFORE the throw? This is "closest to the error" and I can pass additional info about the context. Or should I just continuously throw it all the way up to the top and log everything at the very top? (mutters under breath - "I will learn this stuff") -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Jul 24 00:16:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 09:16:12 +0400 Subject: [dba-VB] C# - but what happened to catch? In-Reply-To: <4C49F2B1.3060600@colbyconsulting.com> References: <4C49F2B1.3060600@colbyconsulting.com> Message-ID: John, You can make it like that also: using (reader = file.OpenText()) { reader.Read(source, 0, length); } Then 'finally' code block will not be needed as reader will be "automagically" closed by its IDispose call on exit of using code block... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 11:51 PM To: VBA Subject: [dba-VB] C# - but what happened to catch? http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Jul 24 00:16:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 09:16:12 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C49F69B.2030403@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com> Message-ID: <39CF9897AAF846D49115A5F2A38041F4@nant> Hi John -- Dispose does all the clean-up for SqlCommand object instance... It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside catch blocks... Such methods do usually return "RecordAffected" value if that needed by the callers, some other execution stats, or nothing... <<< Or should I just continuously throw it all the way up to the top and log everything at the very top? >>> Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; - return to the highest position in the call stack where you can gracefully continue your application execution, or quit your app with a user-friendly error message... Logging all the way up to the top of the call stack would be similar to On Error GoTo ... VB6/VBA approach - that one proved itself to be a professional approach for VB6/VBA but for C#/VB.NET it's usually considered as a timid, pavid, apprehensive and too expensive (in many areas) to be true approach, e.g. do you take into account that try/catch/finally do influence your code execution speed so putting them everywhere could degrade your code performance?... Code instrumentation/logging/profiling is usually done while going down to the call stack, and .NET has special instrumentation classes, which can be used to organize as detailed as needed logging depending on current application settings... After all - your application usually work or crash when deployed? - if the latter then whatever advanced logging/code instrumentation approach you'll use you'll anyway loose your customers (pun not intended)... Be courageous! Forget "VB6/VBA timidity", recall your best times when you've been a "code cowboy" but do use Unit Testing (at least) - then you'll make your coding style light, your code running lightning fast and still being "bullet-proof"... Thank you. :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 12:08 AM To: VBA Subject: [dba-VB] c# so FINALLY ? The version that seems to addre4ss all of the issues: namespace projBaseObjects { class clsSQLReadWrite { public static void ExecuteNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } } } What do you do with the command object? Does it need cleanup handling at all? It doesn't have a close method, though it does have a dispose method. And finally (pun intended) what should I do with this method? Return a boolean true = worked? But WHERE? The finally will execute whether the function "worked" or not. AFTER the finally block? As I understand it that code would ONLY execute if the catch statements do not throw an error? A throw does exit the function never to return correct? Should I log (write to a log file) BEFORE the throw? This is "closest to the error" and I can pass additional info about the context. Or should I just continuously throw it all the way up to the top and log everything at the very top? (mutters under breath - "I will learn this stuff") -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 24 04:26:02 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 05:26:02 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <39CF9897AAF846D49115A5F2A38041F4@nant> References: <4C49F69B.2030403@colbyconsulting.com> <39CF9897AAF846D49115A5F2A38041F4@nant> Message-ID: <4C4AB1AA.2040100@colbyconsulting.com> Shamil, Thanks for your reply. C#, .Net and Visual Studio are very complex and I have so much to learn. And I have to make a living while I am learning, and I am trying to teach a young fellow that works for me what little I know as well. I need more information from you. I have two specific things I am trying to implement and make sure that I "cleanup" correctly. The first is that I have a ton of places in my code where I am using SQL Server records for table driven processes. As such I need to: 1) Work with data readers, looping through records. 2) Work with command objects doing .ExecuteNonQuery() to perform updates on flags. In both these scenarios I want to make sure that I open the connection, open the command object, do whatever the command object is going to do, close the connection, and cleanup the command object. And I want (am trying) to do this in a single place so that I get consistent object handling / cleanup. So, for example I use a static method of a class: public static bool ExecNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } return true; } > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? > It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside of catch blocks OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. And of course I need a reliable logger so that I can go see any errors. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Dispose does all the clean-up for SqlCommand object instance... > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has > > throw > > calls inside catch blocks... > > Such methods do usually return "RecordAffected" value if that needed by the > callers, some other execution stats, or nothing... > > <<< > Or should I just continuously throw > it all the way up to the top > and log everything at the very top? > Again follow KISS-principle: > - log exceptions as close as possible to the point where they appeared; > - return to the highest position in the call stack where you can gracefully > continue your application execution, or quit your app with a user-friendly > error message... > > Logging all the way up to the top of the call stack would be similar to > > On Error GoTo ... > > VB6/VBA approach - that one proved itself to be a professional approach for > VB6/VBA but for C#/VB.NET it's usually considered as a timid, pavid, > apprehensive and too expensive (in many areas) to be true approach, e.g. do > you take into account that try/catch/finally do influence your code > execution speed so putting them everywhere could degrade your code > performance?... > > Code instrumentation/logging/profiling is usually done while going down to > the call stack, and .NET has special instrumentation classes, which can be > used to organize as detailed as needed logging depending on current > application settings... > > After all - your application usually work or crash when deployed? - if the > latter then whatever advanced logging/code instrumentation approach you'll > use you'll anyway loose your customers (pun not intended)... > > Be courageous! Forget "VB6/VBA timidity", recall your best times when you've > been a "code cowboy" but do use Unit Testing (at least) - then you'll make > your coding style light, your code running lightning fast and still being > "bullet-proof"... > > Thank you. :) > > -- Shamil From jwcolby at colbyconsulting.com Sat Jul 24 06:33:26 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 07:33:26 -0400 Subject: [dba-VB] NLog assistance Message-ID: <4C4ACF86.6050707@colbyconsulting.com> I am still looking for anyone on the list that uses NLog that can help me get it sorking initially. My confusion is in how to set it up. The help discusses setting an XML file, and I have found about 40 different versions of that file out on Google, but I am not sure where I go to edit it. My solution has several projects, and I assume that I have to do an XML config file in each project? I would prefer ONE for the solution but I will do what it takes. This appears to be one of those "you can't use it until you know how to use it" things. Just a few words of advice might be enough to get me going. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 24 09:41:10 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 10:41:10 -0400 Subject: [dba-VB] NLog making progress Message-ID: <4C4AFB86.4030305@colbyconsulting.com> OK, so it appears that I am making progress. I found an online tutorial http://nlog-project.org/wiki/Tutorial#Installing_NLog which got me set up and working on one project. Basically after referencing in the project and using in the class, I insert something like: Logger nlog = LogManager.GetLogger("clsAZLog"); in the header of each class. My question is, is there any syntax that could give me the name of the class? IOW: Logger nlog = LogManager.GetLogger(SomeObject.Name); where SomeObject is the class itself. The objective to be just cutting and pasting a single identical line in the header of each class. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Jul 24 11:33:53 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 20:33:53 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C4AB1AA.2040100@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> Message-ID: <8A310364129E48FF9AFE923F44EFBAA0@nant> Hi John -- Thank you for your questions. <<< > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? >>> Yes, it's more than correct IMO :) - I must say I almost never use that much clean-up coding in my .NET development: - I do never clean-up SqlCommand and SqlDataReader explicitly; - I do never close/clean-up SqlConnection; - I do use try { using (SqlConnection cnn = new SqlConnection(connectionString) { // SqlCommand and SqlDataReader etc. are in } } catch (SqlException ex) { // log exception throw ex; } catch (Exception ex) { // log exception throw ex; } Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be not so good (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several years in db intensive multi-user web apps - and it works well - no "memory leakage" - and I must say I have used my logging just a few times and it was informative enough to find and fix the bugs... "Excessive clean-up" is not needed in .NET as CLR's garbage collector does do good job for the code as above... <<<<<< If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. >>>>>> John, IMO there is no generic/common answer to your question - it depends on your app what to do with handled exception - "log and buble it up" or "log and suppress it" returning boolean failure code to the caller method: - logging and using Boolean is what is called "defensive" programming AFAIU - and it's "heavy good old professional style"; - logging and throwing and exception up to the higest level caller is what is called "modern lightweight programming style" - in my opinion :) - and it's the most recommended nowadays AFAIS... Of course in the latter case of "modern lightweight programming style" there should be something(/some code) on the upper call stack levels to take care of the exception (to make some more logging and) to: - continue application execution gracefully; - quit the application... <<< And of course I need a reliable logger so that I can go see any errors. >>> I do not use any besides some custom simple coding I outlined in this thread: - I just log into a simple text file; - I log into MS SQL, if that fails, log into text file, if that fails log into MS Windows application log. You can plan to use some existing logging frameworks but for the time beeing just write simple custom wrapper class, and then you can add advanced logging later... <<< And I have to make a living while I am learning, >>> Yes, that's our destiny - the same story here, moreever... <<< and I am trying to teach a young fellow that works for me what little I know as well. >>> If this young fellow is from a good IT college then they can teach you a lot (myself included) - I mean they usually know well all the modern approaches/methods of application programming - yes, more in theory than in practice but they often have a good overview we (seasoned developers) might lack because of the lack of time to study the theory - "fighting" everyday for living - just talk to the "kid programmer" - and you'll together will find your "proper" way of programming together... I suppose that for your case there are two proven sources: - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer to Programmer) (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 642) - it has real life sample web site/code solution with multi-layer "framework" - I did quote "framework" because it has just a few classes - you can "grab and use them" (sources are available free on WROX site)... - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge framework - and I personally do not use it - I'd recommend to just get its sources (they are free) and to investigate the part of code belonging to the DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this framework immediately - it would be very time consuming to learn it in details... I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + custom SPs mapping to your ADO.NET EF DataModel would be "what doctor ordered" but again it could take a lot of time to learn that "super modern" stuff - you can use simpler and time proven approaches referred above while learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if any).... Thank you. -- Shamil P.S: Disclaimer: All the above my opinions are coming from my own everyday .NET development experience, and are also gathered on Web, including Access-D/dba-VB and from technical books - they can be my own "misinterpretation or real world" sometimes - but they work well for me and for my customers :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 1:26 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# so FINALLY ? Shamil, Thanks for your reply. C#, .Net and Visual Studio are very complex and I have so much to learn. And I have to make a living while I am learning, and I am trying to teach a young fellow that works for me what little I know as well. I need more information from you. I have two specific things I am trying to implement and make sure that I "cleanup" correctly. The first is that I have a ton of places in my code where I am using SQL Server records for table driven processes. As such I need to: 1) Work with data readers, looping through records. 2) Work with command objects doing .ExecuteNonQuery() to perform updates on flags. In both these scenarios I want to make sure that I open the connection, open the command object, do whatever the command object is going to do, close the connection, and cleanup the command object. And I want (am trying) to do this in a single place so that I get consistent object handling / cleanup. So, for example I use a static method of a class: public static bool ExecNonQuery(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myCommand.ExecuteNonQuery(); } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } return true; } > Dispose does all the clean-up for SqlCommand object instance... Is my code above correct then? > It doesn't make sense to have any SUCCESS/FAILURE return values from this method as it has throw calls inside of catch blocks OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > Again follow KISS-principle: - log exceptions as close as possible to the point where they appeared; If I log in the catch block do I really want to then throw the error? What is the calling procedure going to do with that? It seems logical to me to do the logging in the catch block and then NOT throw the error, but rather simply return a boolean false saying that the process failed. The calling procedure can then use the boolean to decide what to do. My understanding is that if I throw the error up to the caller then it ends up in its catch block, which may throw the error etc. I am good with handling the error close to the source but it just seems that implies NOT throwing the error on up. And of course I need a reliable logger so that I can go see any errors. John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Jul 24 11:45:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 12:45:15 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <8A310364129E48FF9AFE923F44EFBAA0@nant> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> <8A310364129E48FF9AFE923F44EFBAA0@nant> Message-ID: <4C4B189B.6080504@colbyconsulting.com> Thanks Shamil. Interesting stuff all of this. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Jul 24 11:53:57 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 24 Jul 2010 12:53:57 -0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <8A310364129E48FF9AFE923F44EFBAA0@nant> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com> <8A310364129E48FF9AFE923F44EFBAA0@nant> Message-ID: <4C4B1AA5.4070802@colbyconsulting.com> I have NLog running very basic, just logging to a log file in my bin directory. NLog appears to be capable of logging to multiple places and do all kinds of sophisticated things like log to email, sql server etc. We shall see. It is going to be a bit of work to retrofit my app to use logging since I have none in it ATM but I have been wanting to do this for a long time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jul 24 13:11:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Jul 2010 22:11:21 +0400 Subject: [dba-VB] c# so FINALLY ? In-Reply-To: <4C4B1AA5.4070802@colbyconsulting.com> References: <4C49F69B.2030403@colbyconsulting.com><39CF9897AAF846D49115A5F2A38041F4@nant> <4C4AB1AA.2040100@colbyconsulting.com><8A310364129E48FF9AFE923F44EFBAA0@nant> <4C4B1AA5.4070802@colbyconsulting.com> Message-ID: <67F1EC9B1A864250B342838202B33875@nant> Hi John -- Yes, NLog seems to be a good choice for multi-threaded apps also http://nlog-project.org/wiki/File_target... I will probably try to use it in one of my applications... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 24, 2010 8:54 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# so FINALLY ? I have NLog running very basic, just logging to a log file in my bin directory. NLog appears to be capable of logging to multiple places and do all kinds of sophisticated things like log to email, sql server etc. We shall see. It is going to be a bit of work to retrofit my app to use logging since I have none in it ATM but I have been wanting to do this for a long time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your questions. > > <<< >> Dispose does all the clean-up for SqlCommand object instance... > Is my code above correct then? > Yes, it's more than correct IMO :) - I must say I almost never use that much > clean-up coding in my .NET development: > > - I do never clean-up SqlCommand and SqlDataReader explicitly; > - I do never close/clean-up SqlConnection; > - I do use > > try { > using (SqlConnection cnn = new SqlConnection(connectionString) > { > // SqlCommand and SqlDataReader etc. are in > } > } > catch (SqlException ex) > { > // log exception > throw ex; > } > catch (Exception ex) > { > // log exception > throw ex; > } > > Yes, I do use 'throw ex' not just 'throw' - and that my "approach" could be > not so good > (http://geekswithblogs.net/sdorman/archive/2007/08/20/Difference-between-quo > tthrowquot-and-quotthrow-exquot-in-.NET.aspx ) but I do use it for several > years in db intensive multi-user web apps - and it works well - no "memory > leakage" - and I must say I have used my logging just a few times and it was > informative enough to find and fix the bugs... > > "Excessive clean-up" is not needed in .NET as CLR's garbage collector does > do good job for the code as above... > > <<<<<< > If I log in the catch block do I really want to then throw > the error? What is the calling procedure going to do with that? > It seems logical to me to do the logging in the catch block > and then NOT throw the error, but rather simply return > a boolean false saying that the process failed. > The calling procedure can then use > the boolean to decide what to do. My understanding is that > if I throw the error up to the caller > then it ends up in its catch block, which may throw the error etc. > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > John, IMO there is no generic/common answer to your question - it depends on > your app what to do with handled exception - "log and buble it up" or "log > and suppress it" returning boolean failure code to the caller method: > > - logging and using Boolean is what is called "defensive" programming AFAIU > - and it's "heavy good old professional style"; > - logging and throwing and exception up to the higest level caller is what > is called "modern lightweight programming style" - in my opinion :) - and > it's the most recommended nowadays AFAIS... > > Of course in the latter case of "modern lightweight programming style" there > should be something(/some code) on the upper call stack levels to take care > of the exception (to make some more logging and) to: > > - continue application execution gracefully; > - quit the application... > > <<< > And of course I need a reliable logger so that I can go see any errors. > I do not use any besides some custom simple coding I outlined in this > thread: > > - I just log into a simple text file; > - I log into MS SQL, if that fails, log into text file, if that fails log > into MS Windows application log. > > You can plan to use some existing logging frameworks but for the time beeing > just write simple custom wrapper class, and then you can add advanced > logging later... > > <<< > And I have to make a living while I am learning, > Yes, that's our destiny - the same story here, moreever... > > <<< > and I am trying to teach a young fellow that works for me > what little I know as well. > If this young fellow is from a good IT college then they can teach you a lot > (myself included) - I mean they usually know well all the modern > approaches/methods of application programming - yes, more in theory than in > practice but they often have a good overview we (seasoned developers) might > lack because of the lack of time to study the theory - "fighting" everyday > for living - just talk to the "kid programmer" - and you'll together will > find your "proper" way of programming together... > > I suppose that for your case there are two proven sources: > > - ASP.NET 2.0 Website Programming: Problem - Design - Solution (Programmer > to Programmer) > (http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584 > 642) - it has real life sample web site/code solution with multi-layer > "framework" - I did quote "framework" because it has just a few classes - > you can "grab and use them" (sources are available free on WROX site)... > > - CSLA .NET for Windows (http://www.lhotka.net/cslanet/ ) - it's a huge > framework - and I personally do not use it - I'd recommend to just get its > sources (they are free) and to investigate the part of code belonging to the > DataAccessLayer (DAL) - "suppress your temptation" (:)) to use this > framework immediately - it would be very time consuming to learn it in > details... > > I also suppose that nowadays combination of ADO.NET Entity Framework 4.0 + > custom SPs mapping to your ADO.NET EF DataModel would be "what doctor > ordered" but again it could take a lot of time to learn that "super modern" > stuff - you can use simpler and time proven approaches referred above while > learning/testing the latter (ADO.NET EF + custom SPs) in your spare time (if > any).... > > Thank you. > > -- Shamil > > P.S: Disclaimer: All the above my opinions are coming from my own everyday > .NET development experience, and are also gathered on Web, including > Access-D/dba-VB and from technical books - they can be my own > "misinterpretation or real world" sometimes - but they work well for me and > for my customers :) > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 24, 2010 1:26 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] c# so FINALLY ? > > Shamil, > > Thanks for your reply. C#, .Net and Visual Studio are very complex and I > have so much to learn. > And I have to make a living while I am learning, and I am trying to teach a > young fellow that works > for me what little I know as well. > > I need more information from you. > > I have two specific things I am trying to implement and make sure that I > "cleanup" correctly. The > first is that I have a ton of places in my code where I am using SQL Server > records for table driven > processes. As such I need to: > > 1) Work with data readers, looping through records. > 2) Work with command objects doing .ExecuteNonQuery() to perform updates on > flags. > > In both these scenarios I want to make sure that I open the connection, open > the command object, do > whatever the command object is going to do, close the connection, and > cleanup the command object. > And I want (am trying) to do this in a single place so that I get consistent > object handling / > cleanup. So, for example I use a static method of a class: > > public static bool ExecNonQuery(string strCnn, string strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myCommand.ExecuteNonQuery(); > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > return true; > } > > > Dispose does all the clean-up for SqlCommand object instance... > > Is my code above correct then? > > > It doesn't make sense to have any SUCCESS/FAILURE return values from this > method as it has throw > calls inside of catch blocks > > OK. So if the .ExecuteNonQuery fails to work, the throw happens but... > > > Again follow KISS-principle: - log exceptions as close as possible to the > point where they appeared; > > If I log in the catch block do I really want to then throw the error? What > is the calling procedure > going to do with that? > > It seems logical to me to do the logging in the catch block and then NOT > throw the error, but rather > simply return a boolean false saying that the process failed. The calling > procedure can then use > the boolean to decide what to do. My understanding is that if I throw the > error up to the caller > then it ends up in its catch block, which may throw the error etc. > > I am good with handling the error close to the source but it just seems that > implies NOT throwing > the error on up. > > And of course I need a reliable logger so that I can go see any errors. > > John W. Colby > www.ColbyConsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 25 14:30:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 15:30:11 -0400 Subject: [dba-VB] C# - what does this mean Message-ID: <4C4C90C3.8070901@colbyconsulting.com> From: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx Closing the DataReader You should always call the Close method when you have finished using the DataReader object. If your Command contains output parameters or return values, they will not be available until the DataReader is closed. Note that while a DataReader is open, the Connection is in use exclusively by that DataReader. You will not be able to execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed. Note Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection. NOTICE the Note above. Why would you NOT call close at the very least. I understand Dispose - that is the garbage collector's job to do that when it decides it needs to but close? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Jul 25 15:08:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 16:08:17 -0400 Subject: [dba-VB] C# - rigorous programming Message-ID: <4C4C99B1.7040804@colbyconsulting.com> I had a bunch of code to open connections, command objects and a reader, do something with the reader and then close it all. it is not a trivial amount of code if you are going to try and wrap it in a try / catch and properly close the stuff. So I wrote the following code: public static SqlDataReader GetDataReader(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; SqlDataReader myDR; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myDR = myCommand.ExecuteReader(); return myDR; } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } Which basically just took the three pieces and wrapped them. Unfortunately it doesn't work because the reader closes if the connection closes. It seems that the reader only holds one record at a time and when the next record is asked for goes and gets it on demand. But look at all of the code required to get around the C# syntax police. The objects have to be dimensioned before the try, the try has to wrap the object opens in case they fail (the point of the try) and the finally has to close everything back down correctly, but now have to be checked against null because they might in fact be null which would trigger another error trying to close an object that isn't opened. So what's a poor boy to do? I decided to build a class to do this and then use a property to expose the reader. The class correctly cleans up when it is destroyed. That seems to work. -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Sun Jul 25 18:32:52 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 26 Jul 2010 09:32:52 +1000 Subject: [dba-VB] C# - rigorous programming References: <4C4C99B1.7040804@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> Hi John, I see you have made a lot of progress over the weekend. Now that you have moved this method into its own class, make sure you don't ... ' call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class' which is what I think MS was saying in you previous message. I think the reason is that the finalizer is indeterminate. So the 'close it when you no longer need it' rule still applies. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, 26 July 2010 6:08 AM To: VBA Subject: [dba-VB] C# - rigorous programming I had a bunch of code to open connections, command objects and a reader, do something with the reader and then close it all. it is not a trivial amount of code if you are going to try and wrap it in a try / catch and properly close the stuff. So I wrote the following code: public static SqlDataReader GetDataReader(string strCnn, string strSQL) { SqlConnection mCnn = null; SqlCommand myCommand = null; SqlDataReader myDR; try { mCnn = new SqlConnection(strCnn); mCnn.Open(); myCommand = new SqlCommand(strSQL, mCnn); myDR = myCommand.ExecuteReader(); return myDR; } catch (SqlException) { throw; } catch (Exception) { throw; } finally { if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (mCnn != null) { mCnn.Close(); } } } Which basically just took the three pieces and wrapped them. Unfortunately it doesn't work because the reader closes if the connection closes. It seems that the reader only holds one record at a time and when the next record is asked for goes and gets it on demand. But look at all of the code required to get around the C# syntax police. The objects have to be dimensioned before the try, the try has to wrap the object opens in case they fail (the point of the try) and the finally has to close everything back down correctly, but now have to be checked against null because they might in fact be null which would trigger another error trying to close an object that isn't opened. So what's a poor boy to do? I decided to build a class to do this and then use a property to expose the reader. The class correctly cleans up when it is destroyed. That seems to work. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 25 21:08:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 22:08:33 -0400 Subject: [dba-VB] C# - rigorous programming In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> References: <4C4C99B1.7040804@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D74@ddi-01.DDI.local> Message-ID: <4C4CEE21.4050203@colbyconsulting.com> Michael, > I see you have made a lot of progress over the weekend. I made awesome progress on two different fronts. I got NLog working (to a file, not to SQL Server) and I got some stuff figured out on C# cleanup. I believe in logging, both errors and progress. I haven't had logging though, only specific application control stuff. > I think the reason is that the finalizer is indeterminate. So the 'close it when you no longer need it' rule still applies. I understand "close when you no longer need it". I did think that the the Dispose method forced the garbage collector to take care of that specific object right then and there. I thought that in the case of SQL Server or other database objects, that immediate cleanup would be a good thing. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Hi John, > > I see you have made a lot of progress over the weekend. > > Now that you have moved this method into its own class, make sure you > don't ... > ' call Close or Dispose on a Connection, a DataReader, or any other > managed object > in the Finalize method of your class' which is what I think MS was > saying in you previous message. > I think the reason is that the finalizer is indeterminate. So the 'close > it when you no longer need it' rule still applies. > > Cheers > > Michael M > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, 26 July 2010 6:08 AM > To: VBA > Subject: [dba-VB] C# - rigorous programming > > I had a bunch of code to open connections, command objects and a reader, > do something with the reader and then close it all. it is not a trivial > amount of code if you are going to try and wrap it in a try / catch and > properly close the stuff. So I wrote the following code: > > public static SqlDataReader GetDataReader(string strCnn, string > strSQL) > { > SqlConnection mCnn = null; > SqlCommand myCommand = null; > SqlDataReader myDR; > try > { > mCnn = new SqlConnection(strCnn); > mCnn.Open(); > myCommand = new SqlCommand(strSQL, mCnn); > myDR = myCommand.ExecuteReader(); > return myDR; > } > catch (SqlException) > { > throw; > } > catch (Exception) > { > throw; > } > finally > { > if (myCommand != null) > { > myCommand.Dispose(); > myCommand = null; > } > if (mCnn != null) > { > mCnn.Close(); > } > } > } > > > Which basically just took the three pieces and wrapped them. > > Unfortunately it doesn't work because the reader closes if the > connection closes. It seems that the reader only holds one record at a > time and when the next record is asked for goes and gets it on demand. > > But look at all of the code required to get around the C# syntax police. > The objects have to be dimensioned before the try, the try has to wrap > the object opens in case they fail (the point of the > try) and the finally has to close everything back down correctly, but > now have to be checked against null because they might in fact be null > which would trigger another error trying to close an object that isn't > opened. > > So what's a poor boy to do? > > I decided to build a class to do this and then use a property to expose > the reader. The class correctly cleans up when it is destroyed. That > seems to work. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sun Jul 25 22:11:52 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 25 Jul 2010 23:11:52 -0400 Subject: [dba-VB] C# - NLog to SQL Server Message-ID: <4C4CFCF8.8050505@colbyconsulting.com> Is anyone doing this? I am using the following as a config: INSERT INTO LogTable(time_stamp, [level], logger, [message]) VALUES (@time_stamp, at level, at logger, at message) I have a server Azul, I am using integrated security, I created a database _NLogDatabase and a table NLog with fields of those names. Data types: Time_Stamp: DateTime Level: Varchar(50) Logger: VarChar(50) Message: Varchar(max) So far the logs are going to file but not to the table. -- John W. Colby www.ColbyConsulting.com From marklbreen at gmail.com Mon Jul 26 05:43:53 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 26 Jul 2010 11:43:53 +0100 Subject: [dba-VB] NLog making progress In-Reply-To: <4C4AFB86.4030305@colbyconsulting.com> References: <4C4AFB86.4030305@colbyconsulting.com> Message-ID: Hello John, When I read this email, I recalled the hazy, easy days of Glen Grubb and the ggCC error handler. Oh, how life was easy back then :) Mark On 24 July 2010 15:41, jwcolby wrote: > OK, so it appears that I am making progress. I found an online tutorial > > http://nlog-project.org/wiki/Tutorial#Installing_NLog > > which got me set up and working on one project. > > Basically after referencing in the project and using in the class, I insert > something like: > > Logger nlog = LogManager.GetLogger("clsAZLog"); > > in the header of each class. > > My question is, is there any syntax that could give me the name of the > class? IOW: > > Logger nlog = LogManager.GetLogger(SomeObject.Name); > > where SomeObject is the class itself. The objective to be just cutting and > pasting a single > identical line in the header of each class. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Jul 26 07:22:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Jul 2010 08:22:15 -0400 Subject: [dba-VB] NLog making progress In-Reply-To: References: <4C4AFB86.4030305@colbyconsulting.com> Message-ID: <4C4D7DF7.3090007@colbyconsulting.com> Mark, LOL. Yea, the good ole days. ;) I have to say that, being a programmer at heart, I just truly enjoy the C# language and the .Net environment. There is so much to learn, and so much power. Life is not easy yet in C#, and because of the sheer complexity may never be, but I anticipate the day when, like VBA and DAO in Access, I can pretty much just type away as fast as my fingers can move, writing code. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > When I read this email, I recalled the hazy, easy days of Glen Grubb and the > ggCC error handler. Oh, how life was easy back then :) > > Mark From jwcolby at colbyconsulting.com Wed Jul 28 00:35:18 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 01:35:18 -0400 Subject: [dba-VB] C# - NLog Message-ID: <4C4FC196.5050709@colbyconsulting.com> Wow! I must say that NLog is doing everything I need. Well... other than logging to SQL Server which I have not figured out yet. As I wrote in a previous post, I am designing an asynchronous process, consisting of 4 steps where 1) Tables are exported to text files (csv) 2) The files are moved to a vm for processing by a third party application 3) The resulting files (csv) are brought back from the vm 4) The files are imported back in to SQL Server. The objective is to have these 4 steps able to process completely autonomously, completely table driven. I am trying to run each stage on a thread so that each can do it's thing as it sees fit. This brings a large degree of interaction and I need to be able to see where exceptions are thrown, stack traces and all of that. NLog is handling this beautifully. I am not done by any stretch of the imagination but I would be completely unable to figure this out without the exception logging that NLog enables me to do. Very nice stuff. -- John W. Colby www.ColbyConsulting.com From bheid at sc.rr.com Wed Jul 28 11:08:16 2010 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 28 Jul 2010 12:08:16 -0400 Subject: [dba-VB] C# - what does this mean In-Reply-To: <4C4C90C3.8070901@colbyconsulting.com> References: <4C4C90C3.8070901@colbyconsulting.com> Message-ID: <003c01cb2e6f$168e6770$43ab3650$@rr.com> I think they are talking about calling close in an overridden Finalize method on a class. That would only be if you implement your own dispose/finalize methods in a class. You do want to close the reader and all if you are just using ado.net to connect to and read from a SQL/OLEdb connection. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 25, 2010 3:30 PM To: VBA Subject: [dba-VB] C# - what does this mean From: http://msdn.microsoft.com/en-us/library/haa3afyz%28VS.71%29.aspx Closing the DataReader You should always call the Close method when you have finished using the DataReader object. If your Command contains output parameters or return values, they will not be available until the DataReader is closed. Note that while a DataReader is open, the Connection is in use exclusively by that DataReader. You will not be able to execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed. Note Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection. NOTICE the Note above. Why would you NOT call close at the very least. I understand Dispose - that is the garbage collector's job to do that when it decides it needs to but close? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From bheid at sc.rr.com Wed Jul 28 11:10:44 2010 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 28 Jul 2010 12:10:44 -0400 Subject: [dba-VB] C# - but what happened to catch? In-Reply-To: References: <4C49F2B1.3060600@colbyconsulting.com> Message-ID: <003d01cb2e6f$6eb19350$4c14b9f0$@rr.com> In the example in John's email, they are going to let the exception "bubble up". But they still want to close the reader whether or not there is an exception. SO in the example, the try is only so they can have a finally. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, July 24, 2010 1:16 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - but what happened to catch? John, You can make it like that also: using (reader = file.OpenText()) { reader.Read(source, 0, length); } Then 'finally' code block will not be needed as reader will be "automagically" closed by its IDispose call on exit of using code block... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 23, 2010 11:51 PM To: VBA Subject: [dba-VB] C# - but what happened to catch? http://www.jaggersoft.com/pubs/ExceptionHandlingInCSharp.htm So they work down through this thing and finally declare "it finally works" but where is the catch? I thought the whole point of a try was to do error handling in a catch? finally? One way to solve this problem is to guard the call to reader.Close(). A fourth attempt therefore might be: private static char[] ReadSource(string filename) { TextReader reader = null; char[] source; try { FileInfo file = new FileInfo(filename); int length = (int)file.Length; source = new char[length]; reader = file.OpenText(); reader.Read(source, 0, length); } finally { if (reader != null) { reader.Close(); } } return source; } Of course, the guard on reader.Close() isn't in the "ideal" version of ReadSource. But this is a reasonable version if only because it does, finally, work. Well.. except that there is no catch. Sigh! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 28 18:41:54 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 19:41:54 -0400 Subject: [dba-VB] C# - Cleanup Message-ID: <4C50C042.7020309@colbyconsulting.com> I have been reading up on the proper way to cleanup unmanaged code. Basically what this entails is inheriting CriticalFinalizerObject and IDisposable, and then adding stuff to the class. The finalizer is used to dispose of unmanaged ubjects "deterministically", IOW when I say to, not when the garbage collector decides to. This becomes an issue when you open a lot of connections. The garbage collector does not understand that the connections exist and so performs it's cleanup when it gets around to it. At least that is what I am understanding. Doing a massive rewrite to add this finalizer code to all my classes that use such code has dropped my errors DRASTICALLY! The code looks like this: #region Dispose ~clsSPAccuzipExportTo() { Dispose(true); } public void Close() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Implement IDisposable. // Do not make this method virtual. // A derived class should not be able to override this method. public void Dispose() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { if (mCnn != null) { try { mCnn.Close(); } catch (Exception) { } mCnn.Dispose(); } } } disposed = true; } #endregion -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Wed Jul 28 19:09:07 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 29 Jul 2010 10:09:07 +1000 Subject: [dba-VB] C# - Cleanup References: <4C50C042.7020309@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> Looks like a good candidate for adding to your base data access class. Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, 29 July 2010 9:42 AM To: VBA Subject: [dba-VB] C# - Cleanup I have been reading up on the proper way to cleanup unmanaged code. Basically what this entails is inheriting CriticalFinalizerObject and IDisposable, and then adding stuff to the class. The finalizer is used to dispose of unmanaged ubjects "deterministically", IOW when I say to, not when the garbage collector decides to. This becomes an issue when you open a lot of connections. The garbage collector does not understand that the connections exist and so performs it's cleanup when it gets around to it. At least that is what I am understanding. Doing a massive rewrite to add this finalizer code to all my classes that use such code has dropped my errors DRASTICALLY! The code looks like this: #region Dispose ~clsSPAccuzipExportTo() { Dispose(true); } public void Close() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Implement IDisposable. // Do not make this method virtual. // A derived class should not be able to override this method. public void Dispose() { Dispose(true); // This object will be cleaned up by the Dispose method. // Therefore, you should call GC.SupressFinalize to // take this object off the finalization queue // and prevent finalization code for this object // from executing a second time. GC.SuppressFinalize(this); } // Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { if (mCnn != null) { try { mCnn.Close(); } catch (Exception) { } mCnn.Dispose(); } } } disposed = true; } #endregion -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 28 21:29:20 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 28 Jul 2010 22:29:20 -0400 Subject: [dba-VB] C# - Cleanup In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> References: <4C50C042.7020309@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D016B5D8A@ddi-01.DDI.local> Message-ID: <4C50E780.1080006@colbyconsulting.com> Yep. John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Looks like a good candidate for adding to your base data access class. > > Cheers > > Michael M > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, 29 July 2010 9:42 AM > To: VBA > Subject: [dba-VB] C# - Cleanup > > I have been reading up on the proper way to cleanup unmanaged code. > Basically what this entails is inheriting CriticalFinalizerObject and > IDisposable, and then adding stuff to the class. The finalizer is used > to dispose of unmanaged ubjects "deterministically", IOW when I say to, > not when the garbage collector decides to. > > This becomes an issue when you open a lot of connections. The garbage > collector does not understand that the connections exist and so performs > it's cleanup when it gets around to it. > > At least that is what I am understanding. Doing a massive rewrite to > add this finalizer code to all my classes that use such code has dropped > my errors DRASTICALLY! > > The code looks like this: > > #region Dispose > > ~clsSPAccuzipExportTo() > { > Dispose(true); > } > public void Close() > { > Dispose(true); > // This object will be cleaned up by the Dispose method. > // Therefore, you should call GC.SupressFinalize to > // take this object off the finalization queue > // and prevent finalization code for this object > // from executing a second time. > GC.SuppressFinalize(this); > } > // Implement IDisposable. > // Do not make this method virtual. > // A derived class should not be able to override this method. > public void Dispose() > { > Dispose(true); > // This object will be cleaned up by the Dispose method. > // Therefore, you should call GC.SupressFinalize to > // take this object off the finalization queue > // and prevent finalization code for this object > // from executing a second time. > GC.SuppressFinalize(this); > } > // Dispose(bool disposing) executes in two distinct scenarios. > // If disposing equals true, the method has been called > directly > // or indirectly by a user's code. Managed and unmanaged > resources > // can be disposed. > // If disposing equals false, the method has been called by the > // runtime from inside the finalizer and you should not > reference > // other objects. Only unmanaged resources can be disposed. > private void Dispose(bool disposing) > { > // Check to see if Dispose has already been called. > if (!this.disposed) > { > // If disposing equals true, dispose all managed > // and unmanaged resources. > if (disposing) > { > if (mCnn != null) > { > try > { > mCnn.Close(); > } > catch (Exception) > { > } > mCnn.Dispose(); > } > } > > } > disposed = true; > } > #endregion > > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Jul 29 19:35:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 Jul 2010 20:35:49 -0400 Subject: [dba-VB] BCP out, records affected Message-ID: <4C521E65.8070707@colbyconsulting.com> I am running a stored procedure to BCP out a chunk of records. The stored procedure uses exec master..xp_cmdshell @sql to perform the BCP out. Is it possible to get a "records affected" back from command shell ofr the SQL statement executed? If not is there another way to do this? -- John W. Colby www.ColbyConsulting.com