From jwcolby at colbyconsulting.com Mon Nov 1 11:16:21 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 01 Nov 2010 12:16:21 -0400 Subject: [dba-VB] C# access to thunderbird Message-ID: <4CCEE7D5.9060007@colbyconsulting.com> Has anyone figured out accessing Thunderbird from C# / .Net? I did a 10 minute Google and am... uh... not encouraged. I am not finding a well written API or an object that can be referenced. Has anyone done this? I use Thunderbird exclusively here at my home / office and really don't want to go back to Outlook just so that I can program against a model. -- John W. Colby www.ColbyConsulting.com From accessd at shaw.ca Mon Nov 1 11:46:17 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 1 Nov 2010 09:46:17 -0700 Subject: [dba-VB] C# access to thunderbird In-Reply-To: <4CCEE7D5.9060007@colbyconsulting.com> References: <4CCEE7D5.9060007@colbyconsulting.com> Message-ID: <28D9C56616DA407AA50A108A97951C8E@creativesystemdesigns.com> I do not think there is any direct interface to Thunderbird via C#...there is a product called XUL which seems to be able to interface but I know nothing more than that. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, November 01, 2010 9:16 AM To: VBA Subject: [dba-VB] C# access to thunderbird Has anyone figured out accessing Thunderbird from C# / .Net? I did a 10 minute Google and am... uh... not encouraged. I am not finding a well written API or an object that can be referenced. Has anyone done this? I use Thunderbird exclusively here at my home / office and really don't want to go back to Outlook just so that I can program against a model. -- 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 Nov 3 20:22:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 03 Nov 2010 21:22:11 -0400 Subject: [dba-VB] Comparative timings Message-ID: <4CD20AC3.2020308@colbyconsulting.com> I am processing an order for the client that i built this server for. One of the steps is to count the available records. The task, select 640K records from two related tables, 65 million names / addresses joined to 50 million records of demographics (the database from hell). Filter down to (male, high income, young) and (has kids or mail order buyers). The selection views return full name / address plus selection fields. Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the clustered index). Cover indexes on the selection fields. The tables are in separate databases, both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection view. The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around 20% -25% of capacity. I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, averaging about 30-40% of capacity. The time to do the count was about 3:36. I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but a couple of the other cores not assigned also did something significant - 30-40%. The time to do the count was 2:06. I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% for much of the time, but the total time was 1:53. I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the total time was 2:01. Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to process the count. And finally back to 12 gigs and 3 procs. 2:00 So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating and disturbing). 3 cores and 24 gigs put on a very poor show. And of course this test did not have the server doing anything else. I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm did not perform as well as on the previous server. I believe it is probably a simple matter of clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single core and if the core is faster... So I will likely rebuild a server to just hold the vm. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu Nov 4 08:39:17 2010 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 4 Nov 2010 06:39:17 -0700 Subject: [dba-VB] [dba-SQLServer] Comparative timings In-Reply-To: <4CD20AC3.2020308@colbyconsulting.com> References: <4CD20AC3.2020308@colbyconsulting.com> Message-ID: John, Just curious but did you shut down the instance after each change or clear the buffers and cache to ensure proper benchmarking? You can clear the cache by running DBCC DROPCLEANBUFFERS, Then run DBCC FREEPROCCACHE, which clears the stored procedure cache. -Francisco http://bit.ly/sqlthis | Tsql and More... On Wed, Nov 3, 2010 at 6:22 PM, jwcolby wrote: > I am processing an order for the client that i built this server for. One > of the steps is to count > the available records. > > The task, select 640K records from two related tables, 65 million names / > addresses joined to 50 > million records of demographics (the database from hell). Filter down to > (male, high income, young) > and (has kids or mail order buyers). The selection views return full name > / address plus selection > fields. > > Both tables have a clustered index on integer PK. The tables are joined on > PK/FK (the key of the > clustered index). Cover indexes on the selection fields. The tables are > in separate databases, > both databases on the same SSD (2 drive raid 0). The count simply counts > the PKID of the selection > view. > > The server was configured with 6 of 8 cores available to SQL Server and 24 > gigs of RAM. The count > ran consistently around 0:1:55 (one minute 55 secs). The system was only > running the 6 cores around > 20% -25% of capacity. > > I cut the processors assigned to 3 of 8 and reran the same count. The > three assigned processors ran > about 80% of capacity, but several of the processors not assigned to SQL > Server also ran something, > averaging about 30-40% of capacity. The time to do the count was about > 3:36. > > I then cut the memory assigned to SQL Server to 12 gigs with 3 cores > assigned. Again, the > processors ran very similar to the last run, the three assigned to SQL > Server ran around 60-80% but > a couple of the other cores not assigned also did something significant - > 30-40%. The time to do > the count was 2:06. > > I then assigned 6 processors but 12 gigs of memory. The 6 processors > assigned averaged around 80% > for much of the time, but the total time was 1:53. > > I then jacked the memory back up to 24 gigs / 6 processors. Average core > utilization dropped, the > total time was 2:01. > > Just to see if it was an anomaly I dropped back down to 3 procs with 24 > gigs of memory. 4:00 to > process the count. > > And finally back to 12 gigs and 3 procs. 2:00 > > So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs > (which I find fascinating > and disturbing). 3 cores and 24 gigs put on a very poor show. > > And of course this test did not have the server doing anything else. > > I had intended to run a VM on the server though I am changing my mind. In > preliminary tests, the vm > did not perform as well as on the previous server. I believe it is > probably a simple matter of > clock speed. This server has 8 cores but they are clocked at 2 gigs. My > previous server had only 4 > cores but they were clocked at 3.2 gigs. The VM has always shown the best > results with a single > core and if the core is faster... > > So I will likely rebuild a server to just hold the vm. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Nov 6 15:15:18 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 16:15:18 -0400 Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs Message-ID: <4CD5B756.5050603@colbyconsulting.com> A fascinating article - modding Seagate disk drive. http://www.techwarelabs.com/seagate_1-5tb-mod Leaves you to wonder how big you could make it and still get that speed. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Nov 6 16:05:26 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:05:26 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs Message-ID: <4CD5C316.5050407@colbyconsulting.com> And another interesting one. http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Sat Nov 6 16:12:16 2010 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 6 Nov 2010 14:12:16 -0700 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: <4CD5C316.5050407@colbyconsulting.com> References: <4CD5C316.5050407@colbyconsulting.com> Message-ID: When you get this working, let us know how it went! Doug On Sat, Nov 6, 2010 at 2:05 PM, jwcolby wrote: > And another interesting one. > > > http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 > > -- > 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 Nov 6 16:25:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:25:08 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: References: <4CD5C316.5050407@colbyconsulting.com> Message-ID: <4CD5C7B4.3070409@colbyconsulting.com> LOL, I have no use for this. I just found it interesting enough to read. John W. Colby www.ColbyConsulting.com On 11/6/2010 5:12 PM, Doug Steele wrote: > When you get this working, let us know how it went! > > Doug > > On Sat, Nov 6, 2010 at 2:05 PM, jwcolby wrote: > >> And another interesting one. >> >> >> http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 >> >> -- >> 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 dbdoug at gmail.com Sat Nov 6 16:35:28 2010 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 6 Nov 2010 14:35:28 -0700 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: <4CD5C7B4.3070409@colbyconsulting.com> References: <4CD5C316.5050407@colbyconsulting.com> <4CD5C7B4.3070409@colbyconsulting.com> Message-ID: I figure it could give you something do do while you're waiting for your mega queries to run :) Doug On Sat, Nov 6, 2010 at 2:25 PM, jwcolby wrote: > LOL, I have no use for this. I just found it interesting enough to read. > > John W. Colby > www.ColbyConsulting.com > > On 11/6/2010 5:12 PM, Doug Steele wrote: > > When you get this working, let us know how it went! > > > > Doug > > > > On Sat, Nov 6, 2010 at 2:05 PM, jwcolby > wrote: > > > >> And another interesting one. > >> > >> > >> > http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 > >> > >> -- > >> 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 Sat Nov 6 16:42:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:42:08 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: References: <4CD5C316.5050407@colbyconsulting.com> <4CD5C7B4.3070409@colbyconsulting.com> Message-ID: <4CD5CBB0.2030000@colbyconsulting.com> I am waiting considerably less since the new server install. ;) John W. Colby www.ColbyConsulting.com On 11/6/2010 5:35 PM, Doug Steele wrote: > I figure it could give you something do do while you're waiting for your > mega queries to run :) > > Doug > > On Sat, Nov 6, 2010 at 2:25 PM, jwcolby wrote: > >> LOL, I have no use for this. I just found it interesting enough to read. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 11/6/2010 5:12 PM, Doug Steele wrote: >>> When you get this working, let us know how it went! >>> >>> Doug >>> >>> On Sat, Nov 6, 2010 at 2:05 PM, jwcolby >> wrote: >>> >>>> And another interesting one. >>>> >>>> >>>> >> http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 >>>> >>>> -- >>>> 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 accessd at shaw.ca Sat Nov 6 18:08:22 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 6 Nov 2010 16:08:22 -0700 Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs In-Reply-To: <4CD5B756.5050603@colbyconsulting.com> References: <4CD5B756.5050603@colbyconsulting.com> Message-ID: <531E3AF46E0E4863B287DC202FF81E86@creativesystemdesigns.com> That is real neat. A poorman's high speed boot drive. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, November 06, 2010 1:15 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs A fascinating article - modding Seagate disk drive. http://www.techwarelabs.com/seagate_1-5tb-mod Leaves you to wonder how big you could make it and still get that speed. -- 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 Nov 14 20:05:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 14 Nov 2010 21:05:44 -0500 Subject: [dba-VB] Rounding time Message-ID: <4CE09578.1010606@colbyconsulting.com> ' '1440 '____ = 5 minute round 'X Function RoundTime(vRoundTime As Date) As Date 'Const cintMult As Integer = 96 '15 minute round 'Const cintMult As Integer = 144 '10 minute round Const cintMult As Integer = 288 '5 minute round RoundTime = CVDate(Int(vRoundTime * cintMult + 0.5) / cintMult) End Function -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 19 10:04:14 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 19 Nov 2010 11:04:14 -0500 Subject: [dba-VB] What is EventArg? Message-ID: <4CE69FFE.7050105@colbyconsulting.com> The MS "convention" is that an event method raises an event and passes out two parameters, one of which is EventArg e. What is e? I need to pass back status from the object raising the event and EventArgs seems like what I should be using to send back the status, but e has not methods for directly adding status like information. Am I supposed to create a status class and have it inherit (descend from) EventArgs? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Nov 19 11:02:04 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 19 Nov 2010 18:02:04 +0100 Subject: [dba-VB] What is EventArg? Message-ID: Hi John As I've seen it, e returns a collection of properties (or values) from the event, but which is dependant on which object raised the event and what "type" the event was. I don't recall any methods, for example: private string _nodeSelected; private void TreeViewMenu_AfterSelect(object sender, TreeViewEventArgs e) { _nodeSelected = e.Node.Name; Console.WriteLine(e.Node.Handle.ToString()); } private void TreeViewMenu_KeyPress(object sender, KeyPressEventArgs e) { Console.WriteLine((string)"Key: " + _nodeSelected); TreeViewAction(); // Avoid speaker "beep" for not found keyboard entries. e.Handled = true; } I often use "sender" to obtain the object in question without specifying its name: private void dataTableEmployerDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) { DataGridView dataGridView = (DataGridView)sender; DataGridViewCell cell = dataGridView[e.ColumnIndex, e.RowIndex]; if (cell.ColumnIndex.Equals(_columnIndexPassword)) { // Check if the new password contains invalid chars. string password = cell.Value.ToString().Replace(" ", "").Replace("\'", "").Replace("\"", ""); if (password.Length == 0) { // Invalid chars found or password is of zero length. password = _password; } cell.Value = password; } } /gustav >>> jwcolby at colbyconsulting.com 19-11-2010 17:04:14 >>> The MS "convention" is that an event method raises an event and passes out two parameters, one of which is EventArg e. What is e? I need to pass back status from the object raising the event and EventArgs seems like what I should be using to send back the status, but e has not methods for directly adding status like information. Am I supposed to create a status class and have it inherit (descend from) EventArgs? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 19 12:58:42 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 19 Nov 2010 13:58:42 -0500 Subject: [dba-VB] What is EventArg? In-Reply-To: References: Message-ID: <4CE6C8E2.3030107@colbyconsulting.com> As it happens, we have solved this problem. The EventArgs class is used to create a new class which is descendant from this EventArgs class. You then add your own properties that you need to pass back. public class DbExpEventArgs : EventArgs { public int recCount; public Exception ex; public SqlException exSql; } RecCount, Ex and SQLEx are properties that I car about in this case. Now I can create an instance of this class and fill in any of the properties, then pass this back to the event handler. John W. Colby www.ColbyConsulting.com On 11/19/2010 12:02 PM, Gustav Brock wrote: > Hi John > > As I've seen it, e returns a collection of properties (or values) from the event, but which is dependant on which object raised the event and what "type" the event was. > I don't recall any methods, for example: > > private string _nodeSelected; > > > > private void TreeViewMenu_AfterSelect(object sender, TreeViewEventArgs e) > { > _nodeSelected = e.Node.Name; > Console.WriteLine(e.Node.Handle.ToString()); > } > > private void TreeViewMenu_KeyPress(object sender, KeyPressEventArgs e) > { > Console.WriteLine((string)"Key: " + _nodeSelected); > TreeViewAction(); > // Avoid speaker "beep" for not found keyboard entries. > e.Handled = true; > } > > I often use "sender" to obtain the object in question without specifying its name: > > private void dataTableEmployerDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) > { > DataGridView dataGridView = (DataGridView)sender; > DataGridViewCell cell = dataGridView[e.ColumnIndex, e.RowIndex]; > if (cell.ColumnIndex.Equals(_columnIndexPassword)) > { > // Check if the new password contains invalid chars. > string password = cell.Value.ToString().Replace(" ", "").Replace("\'", "").Replace("\"", ""); > if (password.Length == 0) > { > // Invalid chars found or password is of zero length. > password = _password; > } > cell.Value = password; > } > } > > /gustav > > >>>> jwcolby at colbyconsulting.com 19-11-2010 17:04:14>>> > The MS "convention" is that an event method raises an event and passes out two parameters, one of > which is EventArg e. > > What is e? > > I need to pass back status from the object raising the event and EventArgs seems like what I should > be using to send back the status, but e has not methods for directly adding status like information. > > Am I supposed to create a status class and have it inherit (descend from) EventArgs? > From jwcolby at colbyconsulting.com Mon Nov 22 11:53:54 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 22 Nov 2010 12:53:54 -0500 Subject: [dba-VB] OT: SAMSUNG Spinpoint F3 HD103SJ Message-ID: <4CEAAE32.2020809@colbyconsulting.com> Samsung 1 tb drive $55 with free shipping http://www.newegg.com/Product/Product.aspx?Item=N82E16822152185 -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Nov 25 23:42:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 26 Nov 2010 00:42:17 -0500 Subject: [dba-VB] Samsung 2 gb 5400 $80 Message-ID: <4CEF48B9.80204@colbyconsulting.com> For anyone doing an HTPC - this is a well liked, huge drive for a darned good price. I'm about to do this. http://www.newegg.com/Product/Product.aspx?Item=N82E16822152245 I just pulled the trigger on a 40" LCD for the bedroom and now I need an HTPC. I have a version 1 TIVO but that is getting long in the tooth, and doesn't really look very good on a high def TV. I think it is time to move on, though I am not sure whether I will convince my wife to give up the TIVO. The TIVO is probably the most reliable piece of electronics I have *ever* encountered and dead simple to use. The HTPC will cost more than the TV by quite a bit (or the TIVO, even with the lifetime subscription). OTOH I built one for the living room and it has been solid as a rock since I moved it to Windows 7. The HTPC can work with my Unraid media server to display not only ripped movies but photos, home video and music. My new low end cameras take stunningly good video in addition to photos. My daughter loves to sit and watch home videos of herself. Quite the little narcissist. -- John W. Colby www.ColbyConsulting.com From actebs at actebs.com.au Tue Nov 30 07:06:52 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 00:06:52 +1100 Subject: [dba-VB] Close DB Connection Message-ID: <001201cb908f$7512cac0$5f386040$@com.au> Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad From shamil at smsconsulting.spb.ru Tue Nov 30 07:31:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 30 Nov 2010 16:31:12 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001201cb908f$7512cac0$5f386040$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ 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 Nov 30 07:46:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 30 Nov 2010 08:46:49 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001201cb908f$7512cac0$5f386040$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: <4CF50049.6030803@colbyconsulting.com> I had a similar issue with connections to SQL Server. When I was investigating the problem I discovered that (in my case) the issue was that the garbage collector (GC) was taking its sweet time collecting the trash, and the connections were not released until the trash was taken out. Understand that in my case I was creating classes which created a collection, then I would destroy the class. Since the GC does its thing whenever it decides that it needs to free up memory, and since I had a lot of memory, the GC decided to take its sweet time. Once I discovered destructors and dispose, my problems went away. John W. Colby www.ColbyConsulting.com On 11/30/2010 8:06 AM, ACTEBS wrote: > Hi Everyone, > > > > I've got this issue with my app where the app keeps it's connection to the > Access DB open even after the application has finished it's task. I can't > figure out for the life of me where I've missed closing it in the various > Functions and Sub Routines. > > > > I've ensured that cn.Close and cn = Nothing, has been included in all the > code where the DB is opened. The only place I can't include cn = Nothing is > when the connection is encapsulated within a Using Statement where for some > reason this is not allowed. Could this be the problem? If so, how can I > release the connection? > > > > Also, is there any way of finding out which bit of code is keeping the > connection open? > > > > Many Thanks > > > > Vlad > > > > > > > > _______________________________________________ > 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 Nov 30 12:44:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 30 Nov 2010 21:44:57 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView header ( .TopLeftHeaderCell)? Message-ID: Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil From actebs at actebs.com.au Tue Nov 30 21:50:29 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 14:50:29 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ 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 actebs at actebs.com.au Tue Nov 30 21:53:10 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 14:53:10 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <4CF50049.6030803@colbyconsulting.com> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com> Message-ID: <001801cb910b$45a462e0$d0ed28a0$@com.au> Hi John, Would you please give me an example of how you use the destructor class to close an open db connection? I've researched it, but can't conceptualise how you'd set it up. Many thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, 1 December 2010 12:47 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Close DB Connection I had a similar issue with connections to SQL Server. When I was investigating the problem I discovered that (in my case) the issue was that the garbage collector (GC) was taking its sweet time collecting the trash, and the connections were not released until the trash was taken out. Understand that in my case I was creating classes which created a collection, then I would destroy the class. Since the GC does its thing whenever it decides that it needs to free up memory, and since I had a lot of memory, the GC decided to take its sweet time. Once I discovered destructors and dispose, my problems went away. John W. Colby www.ColbyConsulting.com On 11/30/2010 8:06 AM, ACTEBS wrote: > Hi Everyone, > > > > I've got this issue with my app where the app keeps it's connection to the > Access DB open even after the application has finished it's task. I can't > figure out for the life of me where I've missed closing it in the various > Functions and Sub Routines. > > > > I've ensured that cn.Close and cn = Nothing, has been included in all the > code where the DB is opened. The only place I can't include cn = Nothing is > when the connection is encapsulated within a Using Statement where for some > reason this is not allowed. Could this be the problem? If so, how can I > release the connection? > > > > Also, is there any way of finding out which bit of code is keeping the > connection open? > > > > Many Thanks > > > > Vlad > > > > > > > > _______________________________________________ > 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 Nov 1 11:16:21 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 01 Nov 2010 12:16:21 -0400 Subject: [dba-VB] C# access to thunderbird Message-ID: <4CCEE7D5.9060007@colbyconsulting.com> Has anyone figured out accessing Thunderbird from C# / .Net? I did a 10 minute Google and am... uh... not encouraged. I am not finding a well written API or an object that can be referenced. Has anyone done this? I use Thunderbird exclusively here at my home / office and really don't want to go back to Outlook just so that I can program against a model. -- John W. Colby www.ColbyConsulting.com From accessd at shaw.ca Mon Nov 1 11:46:17 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 1 Nov 2010 09:46:17 -0700 Subject: [dba-VB] C# access to thunderbird In-Reply-To: <4CCEE7D5.9060007@colbyconsulting.com> References: <4CCEE7D5.9060007@colbyconsulting.com> Message-ID: <28D9C56616DA407AA50A108A97951C8E@creativesystemdesigns.com> I do not think there is any direct interface to Thunderbird via C#...there is a product called XUL which seems to be able to interface but I know nothing more than that. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, November 01, 2010 9:16 AM To: VBA Subject: [dba-VB] C# access to thunderbird Has anyone figured out accessing Thunderbird from C# / .Net? I did a 10 minute Google and am... uh... not encouraged. I am not finding a well written API or an object that can be referenced. Has anyone done this? I use Thunderbird exclusively here at my home / office and really don't want to go back to Outlook just so that I can program against a model. -- 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 Nov 3 20:22:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 03 Nov 2010 21:22:11 -0400 Subject: [dba-VB] Comparative timings Message-ID: <4CD20AC3.2020308@colbyconsulting.com> I am processing an order for the client that i built this server for. One of the steps is to count the available records. The task, select 640K records from two related tables, 65 million names / addresses joined to 50 million records of demographics (the database from hell). Filter down to (male, high income, young) and (has kids or mail order buyers). The selection views return full name / address plus selection fields. Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the clustered index). Cover indexes on the selection fields. The tables are in separate databases, both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection view. The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around 20% -25% of capacity. I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, averaging about 30-40% of capacity. The time to do the count was about 3:36. I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but a couple of the other cores not assigned also did something significant - 30-40%. The time to do the count was 2:06. I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% for much of the time, but the total time was 1:53. I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the total time was 2:01. Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to process the count. And finally back to 12 gigs and 3 procs. 2:00 So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating and disturbing). 3 cores and 24 gigs put on a very poor show. And of course this test did not have the server doing anything else. I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm did not perform as well as on the previous server. I believe it is probably a simple matter of clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single core and if the core is faster... So I will likely rebuild a server to just hold the vm. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu Nov 4 08:39:17 2010 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 4 Nov 2010 06:39:17 -0700 Subject: [dba-VB] [dba-SQLServer] Comparative timings In-Reply-To: <4CD20AC3.2020308@colbyconsulting.com> References: <4CD20AC3.2020308@colbyconsulting.com> Message-ID: John, Just curious but did you shut down the instance after each change or clear the buffers and cache to ensure proper benchmarking? You can clear the cache by running DBCC DROPCLEANBUFFERS, Then run DBCC FREEPROCCACHE, which clears the stored procedure cache. -Francisco http://bit.ly/sqlthis | Tsql and More... On Wed, Nov 3, 2010 at 6:22 PM, jwcolby wrote: > I am processing an order for the client that i built this server for. One > of the steps is to count > the available records. > > The task, select 640K records from two related tables, 65 million names / > addresses joined to 50 > million records of demographics (the database from hell). Filter down to > (male, high income, young) > and (has kids or mail order buyers). The selection views return full name > / address plus selection > fields. > > Both tables have a clustered index on integer PK. The tables are joined on > PK/FK (the key of the > clustered index). Cover indexes on the selection fields. The tables are > in separate databases, > both databases on the same SSD (2 drive raid 0). The count simply counts > the PKID of the selection > view. > > The server was configured with 6 of 8 cores available to SQL Server and 24 > gigs of RAM. The count > ran consistently around 0:1:55 (one minute 55 secs). The system was only > running the 6 cores around > 20% -25% of capacity. > > I cut the processors assigned to 3 of 8 and reran the same count. The > three assigned processors ran > about 80% of capacity, but several of the processors not assigned to SQL > Server also ran something, > averaging about 30-40% of capacity. The time to do the count was about > 3:36. > > I then cut the memory assigned to SQL Server to 12 gigs with 3 cores > assigned. Again, the > processors ran very similar to the last run, the three assigned to SQL > Server ran around 60-80% but > a couple of the other cores not assigned also did something significant - > 30-40%. The time to do > the count was 2:06. > > I then assigned 6 processors but 12 gigs of memory. The 6 processors > assigned averaged around 80% > for much of the time, but the total time was 1:53. > > I then jacked the memory back up to 24 gigs / 6 processors. Average core > utilization dropped, the > total time was 2:01. > > Just to see if it was an anomaly I dropped back down to 3 procs with 24 > gigs of memory. 4:00 to > process the count. > > And finally back to 12 gigs and 3 procs. 2:00 > > So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs > (which I find fascinating > and disturbing). 3 cores and 24 gigs put on a very poor show. > > And of course this test did not have the server doing anything else. > > I had intended to run a VM on the server though I am changing my mind. In > preliminary tests, the vm > did not perform as well as on the previous server. I believe it is > probably a simple matter of > clock speed. This server has 8 cores but they are clocked at 2 gigs. My > previous server had only 4 > cores but they were clocked at 3.2 gigs. The VM has always shown the best > results with a single > core and if the core is faster... > > So I will likely rebuild a server to just hold the vm. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Nov 6 15:15:18 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 16:15:18 -0400 Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs Message-ID: <4CD5B756.5050603@colbyconsulting.com> A fascinating article - modding Seagate disk drive. http://www.techwarelabs.com/seagate_1-5tb-mod Leaves you to wonder how big you could make it and still get that speed. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Nov 6 16:05:26 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:05:26 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs Message-ID: <4CD5C316.5050407@colbyconsulting.com> And another interesting one. http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Sat Nov 6 16:12:16 2010 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 6 Nov 2010 14:12:16 -0700 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: <4CD5C316.5050407@colbyconsulting.com> References: <4CD5C316.5050407@colbyconsulting.com> Message-ID: When you get this working, let us know how it went! Doug On Sat, Nov 6, 2010 at 2:05 PM, jwcolby wrote: > And another interesting one. > > > http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 > > -- > 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 Nov 6 16:25:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:25:08 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: References: <4CD5C316.5050407@colbyconsulting.com> Message-ID: <4CD5C7B4.3070409@colbyconsulting.com> LOL, I have no use for this. I just found it interesting enough to read. John W. Colby www.ColbyConsulting.com On 11/6/2010 5:12 PM, Doug Steele wrote: > When you get this working, let us know how it went! > > Doug > > On Sat, Nov 6, 2010 at 2:05 PM, jwcolby wrote: > >> And another interesting one. >> >> >> http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 >> >> -- >> 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 dbdoug at gmail.com Sat Nov 6 16:35:28 2010 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 6 Nov 2010 14:35:28 -0700 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: <4CD5C7B4.3070409@colbyconsulting.com> References: <4CD5C316.5050407@colbyconsulting.com> <4CD5C7B4.3070409@colbyconsulting.com> Message-ID: I figure it could give you something do do while you're waiting for your mega queries to run :) Doug On Sat, Nov 6, 2010 at 2:25 PM, jwcolby wrote: > LOL, I have no use for this. I just found it interesting enough to read. > > John W. Colby > www.ColbyConsulting.com > > On 11/6/2010 5:12 PM, Doug Steele wrote: > > When you get this working, let us know how it went! > > > > Doug > > > > On Sat, Nov 6, 2010 at 2:05 PM, jwcolby > wrote: > > > >> And another interesting one. > >> > >> > >> > http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 > >> > >> -- > >> 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 Sat Nov 6 16:42:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:42:08 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: References: <4CD5C316.5050407@colbyconsulting.com> <4CD5C7B4.3070409@colbyconsulting.com> Message-ID: <4CD5CBB0.2030000@colbyconsulting.com> I am waiting considerably less since the new server install. ;) John W. Colby www.ColbyConsulting.com On 11/6/2010 5:35 PM, Doug Steele wrote: > I figure it could give you something do do while you're waiting for your > mega queries to run :) > > Doug > > On Sat, Nov 6, 2010 at 2:25 PM, jwcolby wrote: > >> LOL, I have no use for this. I just found it interesting enough to read. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 11/6/2010 5:12 PM, Doug Steele wrote: >>> When you get this working, let us know how it went! >>> >>> Doug >>> >>> On Sat, Nov 6, 2010 at 2:05 PM, jwcolby >> wrote: >>> >>>> And another interesting one. >>>> >>>> >>>> >> http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 >>>> >>>> -- >>>> 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 accessd at shaw.ca Sat Nov 6 18:08:22 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 6 Nov 2010 16:08:22 -0700 Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs In-Reply-To: <4CD5B756.5050603@colbyconsulting.com> References: <4CD5B756.5050603@colbyconsulting.com> Message-ID: <531E3AF46E0E4863B287DC202FF81E86@creativesystemdesigns.com> That is real neat. A poorman's high speed boot drive. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, November 06, 2010 1:15 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs A fascinating article - modding Seagate disk drive. http://www.techwarelabs.com/seagate_1-5tb-mod Leaves you to wonder how big you could make it and still get that speed. -- 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 Nov 14 20:05:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 14 Nov 2010 21:05:44 -0500 Subject: [dba-VB] Rounding time Message-ID: <4CE09578.1010606@colbyconsulting.com> ' '1440 '____ = 5 minute round 'X Function RoundTime(vRoundTime As Date) As Date 'Const cintMult As Integer = 96 '15 minute round 'Const cintMult As Integer = 144 '10 minute round Const cintMult As Integer = 288 '5 minute round RoundTime = CVDate(Int(vRoundTime * cintMult + 0.5) / cintMult) End Function -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 19 10:04:14 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 19 Nov 2010 11:04:14 -0500 Subject: [dba-VB] What is EventArg? Message-ID: <4CE69FFE.7050105@colbyconsulting.com> The MS "convention" is that an event method raises an event and passes out two parameters, one of which is EventArg e. What is e? I need to pass back status from the object raising the event and EventArgs seems like what I should be using to send back the status, but e has not methods for directly adding status like information. Am I supposed to create a status class and have it inherit (descend from) EventArgs? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Nov 19 11:02:04 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 19 Nov 2010 18:02:04 +0100 Subject: [dba-VB] What is EventArg? Message-ID: Hi John As I've seen it, e returns a collection of properties (or values) from the event, but which is dependant on which object raised the event and what "type" the event was. I don't recall any methods, for example: private string _nodeSelected; private void TreeViewMenu_AfterSelect(object sender, TreeViewEventArgs e) { _nodeSelected = e.Node.Name; Console.WriteLine(e.Node.Handle.ToString()); } private void TreeViewMenu_KeyPress(object sender, KeyPressEventArgs e) { Console.WriteLine((string)"Key: " + _nodeSelected); TreeViewAction(); // Avoid speaker "beep" for not found keyboard entries. e.Handled = true; } I often use "sender" to obtain the object in question without specifying its name: private void dataTableEmployerDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) { DataGridView dataGridView = (DataGridView)sender; DataGridViewCell cell = dataGridView[e.ColumnIndex, e.RowIndex]; if (cell.ColumnIndex.Equals(_columnIndexPassword)) { // Check if the new password contains invalid chars. string password = cell.Value.ToString().Replace(" ", "").Replace("\'", "").Replace("\"", ""); if (password.Length == 0) { // Invalid chars found or password is of zero length. password = _password; } cell.Value = password; } } /gustav >>> jwcolby at colbyconsulting.com 19-11-2010 17:04:14 >>> The MS "convention" is that an event method raises an event and passes out two parameters, one of which is EventArg e. What is e? I need to pass back status from the object raising the event and EventArgs seems like what I should be using to send back the status, but e has not methods for directly adding status like information. Am I supposed to create a status class and have it inherit (descend from) EventArgs? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 19 12:58:42 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 19 Nov 2010 13:58:42 -0500 Subject: [dba-VB] What is EventArg? In-Reply-To: References: Message-ID: <4CE6C8E2.3030107@colbyconsulting.com> As it happens, we have solved this problem. The EventArgs class is used to create a new class which is descendant from this EventArgs class. You then add your own properties that you need to pass back. public class DbExpEventArgs : EventArgs { public int recCount; public Exception ex; public SqlException exSql; } RecCount, Ex and SQLEx are properties that I car about in this case. Now I can create an instance of this class and fill in any of the properties, then pass this back to the event handler. John W. Colby www.ColbyConsulting.com On 11/19/2010 12:02 PM, Gustav Brock wrote: > Hi John > > As I've seen it, e returns a collection of properties (or values) from the event, but which is dependant on which object raised the event and what "type" the event was. > I don't recall any methods, for example: > > private string _nodeSelected; > > > > private void TreeViewMenu_AfterSelect(object sender, TreeViewEventArgs e) > { > _nodeSelected = e.Node.Name; > Console.WriteLine(e.Node.Handle.ToString()); > } > > private void TreeViewMenu_KeyPress(object sender, KeyPressEventArgs e) > { > Console.WriteLine((string)"Key: " + _nodeSelected); > TreeViewAction(); > // Avoid speaker "beep" for not found keyboard entries. > e.Handled = true; > } > > I often use "sender" to obtain the object in question without specifying its name: > > private void dataTableEmployerDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) > { > DataGridView dataGridView = (DataGridView)sender; > DataGridViewCell cell = dataGridView[e.ColumnIndex, e.RowIndex]; > if (cell.ColumnIndex.Equals(_columnIndexPassword)) > { > // Check if the new password contains invalid chars. > string password = cell.Value.ToString().Replace(" ", "").Replace("\'", "").Replace("\"", ""); > if (password.Length == 0) > { > // Invalid chars found or password is of zero length. > password = _password; > } > cell.Value = password; > } > } > > /gustav > > >>>> jwcolby at colbyconsulting.com 19-11-2010 17:04:14>>> > The MS "convention" is that an event method raises an event and passes out two parameters, one of > which is EventArg e. > > What is e? > > I need to pass back status from the object raising the event and EventArgs seems like what I should > be using to send back the status, but e has not methods for directly adding status like information. > > Am I supposed to create a status class and have it inherit (descend from) EventArgs? > From jwcolby at colbyconsulting.com Mon Nov 22 11:53:54 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 22 Nov 2010 12:53:54 -0500 Subject: [dba-VB] OT: SAMSUNG Spinpoint F3 HD103SJ Message-ID: <4CEAAE32.2020809@colbyconsulting.com> Samsung 1 tb drive $55 with free shipping http://www.newegg.com/Product/Product.aspx?Item=N82E16822152185 -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Nov 25 23:42:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 26 Nov 2010 00:42:17 -0500 Subject: [dba-VB] Samsung 2 gb 5400 $80 Message-ID: <4CEF48B9.80204@colbyconsulting.com> For anyone doing an HTPC - this is a well liked, huge drive for a darned good price. I'm about to do this. http://www.newegg.com/Product/Product.aspx?Item=N82E16822152245 I just pulled the trigger on a 40" LCD for the bedroom and now I need an HTPC. I have a version 1 TIVO but that is getting long in the tooth, and doesn't really look very good on a high def TV. I think it is time to move on, though I am not sure whether I will convince my wife to give up the TIVO. The TIVO is probably the most reliable piece of electronics I have *ever* encountered and dead simple to use. The HTPC will cost more than the TV by quite a bit (or the TIVO, even with the lifetime subscription). OTOH I built one for the living room and it has been solid as a rock since I moved it to Windows 7. The HTPC can work with my Unraid media server to display not only ripped movies but photos, home video and music. My new low end cameras take stunningly good video in addition to photos. My daughter loves to sit and watch home videos of herself. Quite the little narcissist. -- John W. Colby www.ColbyConsulting.com From actebs at actebs.com.au Tue Nov 30 07:06:52 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 00:06:52 +1100 Subject: [dba-VB] Close DB Connection Message-ID: <001201cb908f$7512cac0$5f386040$@com.au> Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad From shamil at smsconsulting.spb.ru Tue Nov 30 07:31:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 30 Nov 2010 16:31:12 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001201cb908f$7512cac0$5f386040$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ 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 Nov 30 07:46:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 30 Nov 2010 08:46:49 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001201cb908f$7512cac0$5f386040$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: <4CF50049.6030803@colbyconsulting.com> I had a similar issue with connections to SQL Server. When I was investigating the problem I discovered that (in my case) the issue was that the garbage collector (GC) was taking its sweet time collecting the trash, and the connections were not released until the trash was taken out. Understand that in my case I was creating classes which created a collection, then I would destroy the class. Since the GC does its thing whenever it decides that it needs to free up memory, and since I had a lot of memory, the GC decided to take its sweet time. Once I discovered destructors and dispose, my problems went away. John W. Colby www.ColbyConsulting.com On 11/30/2010 8:06 AM, ACTEBS wrote: > Hi Everyone, > > > > I've got this issue with my app where the app keeps it's connection to the > Access DB open even after the application has finished it's task. I can't > figure out for the life of me where I've missed closing it in the various > Functions and Sub Routines. > > > > I've ensured that cn.Close and cn = Nothing, has been included in all the > code where the DB is opened. The only place I can't include cn = Nothing is > when the connection is encapsulated within a Using Statement where for some > reason this is not allowed. Could this be the problem? If so, how can I > release the connection? > > > > Also, is there any way of finding out which bit of code is keeping the > connection open? > > > > Many Thanks > > > > Vlad > > > > > > > > _______________________________________________ > 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 Nov 30 12:44:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 30 Nov 2010 21:44:57 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView header ( .TopLeftHeaderCell)? Message-ID: Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil From actebs at actebs.com.au Tue Nov 30 21:50:29 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 14:50:29 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ 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 actebs at actebs.com.au Tue Nov 30 21:53:10 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 14:53:10 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <4CF50049.6030803@colbyconsulting.com> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com> Message-ID: <001801cb910b$45a462e0$d0ed28a0$@com.au> Hi John, Would you please give me an example of how you use the destructor class to close an open db connection? I've researched it, but can't conceptualise how you'd set it up. Many thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, 1 December 2010 12:47 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Close DB Connection I had a similar issue with connections to SQL Server. When I was investigating the problem I discovered that (in my case) the issue was that the garbage collector (GC) was taking its sweet time collecting the trash, and the connections were not released until the trash was taken out. Understand that in my case I was creating classes which created a collection, then I would destroy the class. Since the GC does its thing whenever it decides that it needs to free up memory, and since I had a lot of memory, the GC decided to take its sweet time. Once I discovered destructors and dispose, my problems went away. John W. Colby www.ColbyConsulting.com On 11/30/2010 8:06 AM, ACTEBS wrote: > Hi Everyone, > > > > I've got this issue with my app where the app keeps it's connection to the > Access DB open even after the application has finished it's task. I can't > figure out for the life of me where I've missed closing it in the various > Functions and Sub Routines. > > > > I've ensured that cn.Close and cn = Nothing, has been included in all the > code where the DB is opened. The only place I can't include cn = Nothing is > when the connection is encapsulated within a Using Statement where for some > reason this is not allowed. Could this be the problem? If so, how can I > release the connection? > > > > Also, is there any way of finding out which bit of code is keeping the > connection open? > > > > Many Thanks > > > > Vlad > > > > > > > > _______________________________________________ > 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 Nov 1 11:16:21 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 01 Nov 2010 12:16:21 -0400 Subject: [dba-VB] C# access to thunderbird Message-ID: <4CCEE7D5.9060007@colbyconsulting.com> Has anyone figured out accessing Thunderbird from C# / .Net? I did a 10 minute Google and am... uh... not encouraged. I am not finding a well written API or an object that can be referenced. Has anyone done this? I use Thunderbird exclusively here at my home / office and really don't want to go back to Outlook just so that I can program against a model. -- John W. Colby www.ColbyConsulting.com From accessd at shaw.ca Mon Nov 1 11:46:17 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 1 Nov 2010 09:46:17 -0700 Subject: [dba-VB] C# access to thunderbird In-Reply-To: <4CCEE7D5.9060007@colbyconsulting.com> References: <4CCEE7D5.9060007@colbyconsulting.com> Message-ID: <28D9C56616DA407AA50A108A97951C8E@creativesystemdesigns.com> I do not think there is any direct interface to Thunderbird via C#...there is a product called XUL which seems to be able to interface but I know nothing more than that. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, November 01, 2010 9:16 AM To: VBA Subject: [dba-VB] C# access to thunderbird Has anyone figured out accessing Thunderbird from C# / .Net? I did a 10 minute Google and am... uh... not encouraged. I am not finding a well written API or an object that can be referenced. Has anyone done this? I use Thunderbird exclusively here at my home / office and really don't want to go back to Outlook just so that I can program against a model. -- 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 Nov 3 20:22:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 03 Nov 2010 21:22:11 -0400 Subject: [dba-VB] Comparative timings Message-ID: <4CD20AC3.2020308@colbyconsulting.com> I am processing an order for the client that i built this server for. One of the steps is to count the available records. The task, select 640K records from two related tables, 65 million names / addresses joined to 50 million records of demographics (the database from hell). Filter down to (male, high income, young) and (has kids or mail order buyers). The selection views return full name / address plus selection fields. Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the clustered index). Cover indexes on the selection fields. The tables are in separate databases, both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection view. The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around 20% -25% of capacity. I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, averaging about 30-40% of capacity. The time to do the count was about 3:36. I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but a couple of the other cores not assigned also did something significant - 30-40%. The time to do the count was 2:06. I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% for much of the time, but the total time was 1:53. I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the total time was 2:01. Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to process the count. And finally back to 12 gigs and 3 procs. 2:00 So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating and disturbing). 3 cores and 24 gigs put on a very poor show. And of course this test did not have the server doing anything else. I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm did not perform as well as on the previous server. I believe it is probably a simple matter of clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single core and if the core is faster... So I will likely rebuild a server to just hold the vm. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu Nov 4 08:39:17 2010 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 4 Nov 2010 06:39:17 -0700 Subject: [dba-VB] [dba-SQLServer] Comparative timings In-Reply-To: <4CD20AC3.2020308@colbyconsulting.com> References: <4CD20AC3.2020308@colbyconsulting.com> Message-ID: John, Just curious but did you shut down the instance after each change or clear the buffers and cache to ensure proper benchmarking? You can clear the cache by running DBCC DROPCLEANBUFFERS, Then run DBCC FREEPROCCACHE, which clears the stored procedure cache. -Francisco http://bit.ly/sqlthis | Tsql and More... On Wed, Nov 3, 2010 at 6:22 PM, jwcolby wrote: > I am processing an order for the client that i built this server for. One > of the steps is to count > the available records. > > The task, select 640K records from two related tables, 65 million names / > addresses joined to 50 > million records of demographics (the database from hell). Filter down to > (male, high income, young) > and (has kids or mail order buyers). The selection views return full name > / address plus selection > fields. > > Both tables have a clustered index on integer PK. The tables are joined on > PK/FK (the key of the > clustered index). Cover indexes on the selection fields. The tables are > in separate databases, > both databases on the same SSD (2 drive raid 0). The count simply counts > the PKID of the selection > view. > > The server was configured with 6 of 8 cores available to SQL Server and 24 > gigs of RAM. The count > ran consistently around 0:1:55 (one minute 55 secs). The system was only > running the 6 cores around > 20% -25% of capacity. > > I cut the processors assigned to 3 of 8 and reran the same count. The > three assigned processors ran > about 80% of capacity, but several of the processors not assigned to SQL > Server also ran something, > averaging about 30-40% of capacity. The time to do the count was about > 3:36. > > I then cut the memory assigned to SQL Server to 12 gigs with 3 cores > assigned. Again, the > processors ran very similar to the last run, the three assigned to SQL > Server ran around 60-80% but > a couple of the other cores not assigned also did something significant - > 30-40%. The time to do > the count was 2:06. > > I then assigned 6 processors but 12 gigs of memory. The 6 processors > assigned averaged around 80% > for much of the time, but the total time was 1:53. > > I then jacked the memory back up to 24 gigs / 6 processors. Average core > utilization dropped, the > total time was 2:01. > > Just to see if it was an anomaly I dropped back down to 3 procs with 24 > gigs of memory. 4:00 to > process the count. > > And finally back to 12 gigs and 3 procs. 2:00 > > So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs > (which I find fascinating > and disturbing). 3 cores and 24 gigs put on a very poor show. > > And of course this test did not have the server doing anything else. > > I had intended to run a VM on the server though I am changing my mind. In > preliminary tests, the vm > did not perform as well as on the previous server. I believe it is > probably a simple matter of > clock speed. This server has 8 cores but they are clocked at 2 gigs. My > previous server had only 4 > cores but they were clocked at 3.2 gigs. The VM has always shown the best > results with a single > core and if the core is faster... > > So I will likely rebuild a server to just hold the vm. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Nov 6 15:15:18 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 16:15:18 -0400 Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs Message-ID: <4CD5B756.5050603@colbyconsulting.com> A fascinating article - modding Seagate disk drive. http://www.techwarelabs.com/seagate_1-5tb-mod Leaves you to wonder how big you could make it and still get that speed. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Nov 6 16:05:26 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:05:26 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs Message-ID: <4CD5C316.5050407@colbyconsulting.com> And another interesting one. http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Sat Nov 6 16:12:16 2010 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 6 Nov 2010 14:12:16 -0700 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: <4CD5C316.5050407@colbyconsulting.com> References: <4CD5C316.5050407@colbyconsulting.com> Message-ID: When you get this working, let us know how it went! Doug On Sat, Nov 6, 2010 at 2:05 PM, jwcolby wrote: > And another interesting one. > > > http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 > > -- > 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 Nov 6 16:25:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:25:08 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: References: <4CD5C316.5050407@colbyconsulting.com> Message-ID: <4CD5C7B4.3070409@colbyconsulting.com> LOL, I have no use for this. I just found it interesting enough to read. John W. Colby www.ColbyConsulting.com On 11/6/2010 5:12 PM, Doug Steele wrote: > When you get this working, let us know how it went! > > Doug > > On Sat, Nov 6, 2010 at 2:05 PM, jwcolby wrote: > >> And another interesting one. >> >> >> http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 >> >> -- >> 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 dbdoug at gmail.com Sat Nov 6 16:35:28 2010 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 6 Nov 2010 14:35:28 -0700 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: <4CD5C7B4.3070409@colbyconsulting.com> References: <4CD5C316.5050407@colbyconsulting.com> <4CD5C7B4.3070409@colbyconsulting.com> Message-ID: I figure it could give you something do do while you're waiting for your mega queries to run :) Doug On Sat, Nov 6, 2010 at 2:25 PM, jwcolby wrote: > LOL, I have no use for this. I just found it interesting enough to read. > > John W. Colby > www.ColbyConsulting.com > > On 11/6/2010 5:12 PM, Doug Steele wrote: > > When you get this working, let us know how it went! > > > > Doug > > > > On Sat, Nov 6, 2010 at 2:05 PM, jwcolby > wrote: > > > >> And another interesting one. > >> > >> > >> > http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 > >> > >> -- > >> 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 Sat Nov 6 16:42:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:42:08 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: References: <4CD5C316.5050407@colbyconsulting.com> <4CD5C7B4.3070409@colbyconsulting.com> Message-ID: <4CD5CBB0.2030000@colbyconsulting.com> I am waiting considerably less since the new server install. ;) John W. Colby www.ColbyConsulting.com On 11/6/2010 5:35 PM, Doug Steele wrote: > I figure it could give you something do do while you're waiting for your > mega queries to run :) > > Doug > > On Sat, Nov 6, 2010 at 2:25 PM, jwcolby wrote: > >> LOL, I have no use for this. I just found it interesting enough to read. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 11/6/2010 5:12 PM, Doug Steele wrote: >>> When you get this working, let us know how it went! >>> >>> Doug >>> >>> On Sat, Nov 6, 2010 at 2:05 PM, jwcolby >> wrote: >>> >>>> And another interesting one. >>>> >>>> >>>> >> http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 >>>> >>>> -- >>>> 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 accessd at shaw.ca Sat Nov 6 18:08:22 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 6 Nov 2010 16:08:22 -0700 Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs In-Reply-To: <4CD5B756.5050603@colbyconsulting.com> References: <4CD5B756.5050603@colbyconsulting.com> Message-ID: <531E3AF46E0E4863B287DC202FF81E86@creativesystemdesigns.com> That is real neat. A poorman's high speed boot drive. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, November 06, 2010 1:15 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs A fascinating article - modding Seagate disk drive. http://www.techwarelabs.com/seagate_1-5tb-mod Leaves you to wonder how big you could make it and still get that speed. -- 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 Nov 14 20:05:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 14 Nov 2010 21:05:44 -0500 Subject: [dba-VB] Rounding time Message-ID: <4CE09578.1010606@colbyconsulting.com> ' '1440 '____ = 5 minute round 'X Function RoundTime(vRoundTime As Date) As Date 'Const cintMult As Integer = 96 '15 minute round 'Const cintMult As Integer = 144 '10 minute round Const cintMult As Integer = 288 '5 minute round RoundTime = CVDate(Int(vRoundTime * cintMult + 0.5) / cintMult) End Function -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 19 10:04:14 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 19 Nov 2010 11:04:14 -0500 Subject: [dba-VB] What is EventArg? Message-ID: <4CE69FFE.7050105@colbyconsulting.com> The MS "convention" is that an event method raises an event and passes out two parameters, one of which is EventArg e. What is e? I need to pass back status from the object raising the event and EventArgs seems like what I should be using to send back the status, but e has not methods for directly adding status like information. Am I supposed to create a status class and have it inherit (descend from) EventArgs? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Nov 19 11:02:04 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 19 Nov 2010 18:02:04 +0100 Subject: [dba-VB] What is EventArg? Message-ID: Hi John As I've seen it, e returns a collection of properties (or values) from the event, but which is dependant on which object raised the event and what "type" the event was. I don't recall any methods, for example: private string _nodeSelected; private void TreeViewMenu_AfterSelect(object sender, TreeViewEventArgs e) { _nodeSelected = e.Node.Name; Console.WriteLine(e.Node.Handle.ToString()); } private void TreeViewMenu_KeyPress(object sender, KeyPressEventArgs e) { Console.WriteLine((string)"Key: " + _nodeSelected); TreeViewAction(); // Avoid speaker "beep" for not found keyboard entries. e.Handled = true; } I often use "sender" to obtain the object in question without specifying its name: private void dataTableEmployerDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) { DataGridView dataGridView = (DataGridView)sender; DataGridViewCell cell = dataGridView[e.ColumnIndex, e.RowIndex]; if (cell.ColumnIndex.Equals(_columnIndexPassword)) { // Check if the new password contains invalid chars. string password = cell.Value.ToString().Replace(" ", "").Replace("\'", "").Replace("\"", ""); if (password.Length == 0) { // Invalid chars found or password is of zero length. password = _password; } cell.Value = password; } } /gustav >>> jwcolby at colbyconsulting.com 19-11-2010 17:04:14 >>> The MS "convention" is that an event method raises an event and passes out two parameters, one of which is EventArg e. What is e? I need to pass back status from the object raising the event and EventArgs seems like what I should be using to send back the status, but e has not methods for directly adding status like information. Am I supposed to create a status class and have it inherit (descend from) EventArgs? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 19 12:58:42 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 19 Nov 2010 13:58:42 -0500 Subject: [dba-VB] What is EventArg? In-Reply-To: References: Message-ID: <4CE6C8E2.3030107@colbyconsulting.com> As it happens, we have solved this problem. The EventArgs class is used to create a new class which is descendant from this EventArgs class. You then add your own properties that you need to pass back. public class DbExpEventArgs : EventArgs { public int recCount; public Exception ex; public SqlException exSql; } RecCount, Ex and SQLEx are properties that I car about in this case. Now I can create an instance of this class and fill in any of the properties, then pass this back to the event handler. John W. Colby www.ColbyConsulting.com On 11/19/2010 12:02 PM, Gustav Brock wrote: > Hi John > > As I've seen it, e returns a collection of properties (or values) from the event, but which is dependant on which object raised the event and what "type" the event was. > I don't recall any methods, for example: > > private string _nodeSelected; > > > > private void TreeViewMenu_AfterSelect(object sender, TreeViewEventArgs e) > { > _nodeSelected = e.Node.Name; > Console.WriteLine(e.Node.Handle.ToString()); > } > > private void TreeViewMenu_KeyPress(object sender, KeyPressEventArgs e) > { > Console.WriteLine((string)"Key: " + _nodeSelected); > TreeViewAction(); > // Avoid speaker "beep" for not found keyboard entries. > e.Handled = true; > } > > I often use "sender" to obtain the object in question without specifying its name: > > private void dataTableEmployerDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) > { > DataGridView dataGridView = (DataGridView)sender; > DataGridViewCell cell = dataGridView[e.ColumnIndex, e.RowIndex]; > if (cell.ColumnIndex.Equals(_columnIndexPassword)) > { > // Check if the new password contains invalid chars. > string password = cell.Value.ToString().Replace(" ", "").Replace("\'", "").Replace("\"", ""); > if (password.Length == 0) > { > // Invalid chars found or password is of zero length. > password = _password; > } > cell.Value = password; > } > } > > /gustav > > >>>> jwcolby at colbyconsulting.com 19-11-2010 17:04:14>>> > The MS "convention" is that an event method raises an event and passes out two parameters, one of > which is EventArg e. > > What is e? > > I need to pass back status from the object raising the event and EventArgs seems like what I should > be using to send back the status, but e has not methods for directly adding status like information. > > Am I supposed to create a status class and have it inherit (descend from) EventArgs? > From jwcolby at colbyconsulting.com Mon Nov 22 11:53:54 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 22 Nov 2010 12:53:54 -0500 Subject: [dba-VB] OT: SAMSUNG Spinpoint F3 HD103SJ Message-ID: <4CEAAE32.2020809@colbyconsulting.com> Samsung 1 tb drive $55 with free shipping http://www.newegg.com/Product/Product.aspx?Item=N82E16822152185 -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Nov 25 23:42:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 26 Nov 2010 00:42:17 -0500 Subject: [dba-VB] Samsung 2 gb 5400 $80 Message-ID: <4CEF48B9.80204@colbyconsulting.com> For anyone doing an HTPC - this is a well liked, huge drive for a darned good price. I'm about to do this. http://www.newegg.com/Product/Product.aspx?Item=N82E16822152245 I just pulled the trigger on a 40" LCD for the bedroom and now I need an HTPC. I have a version 1 TIVO but that is getting long in the tooth, and doesn't really look very good on a high def TV. I think it is time to move on, though I am not sure whether I will convince my wife to give up the TIVO. The TIVO is probably the most reliable piece of electronics I have *ever* encountered and dead simple to use. The HTPC will cost more than the TV by quite a bit (or the TIVO, even with the lifetime subscription). OTOH I built one for the living room and it has been solid as a rock since I moved it to Windows 7. The HTPC can work with my Unraid media server to display not only ripped movies but photos, home video and music. My new low end cameras take stunningly good video in addition to photos. My daughter loves to sit and watch home videos of herself. Quite the little narcissist. -- John W. Colby www.ColbyConsulting.com From actebs at actebs.com.au Tue Nov 30 07:06:52 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 00:06:52 +1100 Subject: [dba-VB] Close DB Connection Message-ID: <001201cb908f$7512cac0$5f386040$@com.au> Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad From shamil at smsconsulting.spb.ru Tue Nov 30 07:31:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 30 Nov 2010 16:31:12 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001201cb908f$7512cac0$5f386040$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ 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 Nov 30 07:46:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 30 Nov 2010 08:46:49 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001201cb908f$7512cac0$5f386040$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: <4CF50049.6030803@colbyconsulting.com> I had a similar issue with connections to SQL Server. When I was investigating the problem I discovered that (in my case) the issue was that the garbage collector (GC) was taking its sweet time collecting the trash, and the connections were not released until the trash was taken out. Understand that in my case I was creating classes which created a collection, then I would destroy the class. Since the GC does its thing whenever it decides that it needs to free up memory, and since I had a lot of memory, the GC decided to take its sweet time. Once I discovered destructors and dispose, my problems went away. John W. Colby www.ColbyConsulting.com On 11/30/2010 8:06 AM, ACTEBS wrote: > Hi Everyone, > > > > I've got this issue with my app where the app keeps it's connection to the > Access DB open even after the application has finished it's task. I can't > figure out for the life of me where I've missed closing it in the various > Functions and Sub Routines. > > > > I've ensured that cn.Close and cn = Nothing, has been included in all the > code where the DB is opened. The only place I can't include cn = Nothing is > when the connection is encapsulated within a Using Statement where for some > reason this is not allowed. Could this be the problem? If so, how can I > release the connection? > > > > Also, is there any way of finding out which bit of code is keeping the > connection open? > > > > Many Thanks > > > > Vlad > > > > > > > > _______________________________________________ > 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 Nov 30 12:44:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 30 Nov 2010 21:44:57 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView header ( .TopLeftHeaderCell)? Message-ID: Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil From actebs at actebs.com.au Tue Nov 30 21:50:29 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 14:50:29 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ 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 actebs at actebs.com.au Tue Nov 30 21:53:10 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 14:53:10 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <4CF50049.6030803@colbyconsulting.com> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com> Message-ID: <001801cb910b$45a462e0$d0ed28a0$@com.au> Hi John, Would you please give me an example of how you use the destructor class to close an open db connection? I've researched it, but can't conceptualise how you'd set it up. Many thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, 1 December 2010 12:47 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Close DB Connection I had a similar issue with connections to SQL Server. When I was investigating the problem I discovered that (in my case) the issue was that the garbage collector (GC) was taking its sweet time collecting the trash, and the connections were not released until the trash was taken out. Understand that in my case I was creating classes which created a collection, then I would destroy the class. Since the GC does its thing whenever it decides that it needs to free up memory, and since I had a lot of memory, the GC decided to take its sweet time. Once I discovered destructors and dispose, my problems went away. John W. Colby www.ColbyConsulting.com On 11/30/2010 8:06 AM, ACTEBS wrote: > Hi Everyone, > > > > I've got this issue with my app where the app keeps it's connection to the > Access DB open even after the application has finished it's task. I can't > figure out for the life of me where I've missed closing it in the various > Functions and Sub Routines. > > > > I've ensured that cn.Close and cn = Nothing, has been included in all the > code where the DB is opened. The only place I can't include cn = Nothing is > when the connection is encapsulated within a Using Statement where for some > reason this is not allowed. Could this be the problem? If so, how can I > release the connection? > > > > Also, is there any way of finding out which bit of code is keeping the > connection open? > > > > Many Thanks > > > > Vlad > > > > > > > > _______________________________________________ > 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 Nov 1 11:16:21 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 01 Nov 2010 12:16:21 -0400 Subject: [dba-VB] C# access to thunderbird Message-ID: <4CCEE7D5.9060007@colbyconsulting.com> Has anyone figured out accessing Thunderbird from C# / .Net? I did a 10 minute Google and am... uh... not encouraged. I am not finding a well written API or an object that can be referenced. Has anyone done this? I use Thunderbird exclusively here at my home / office and really don't want to go back to Outlook just so that I can program against a model. -- John W. Colby www.ColbyConsulting.com From accessd at shaw.ca Mon Nov 1 11:46:17 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 1 Nov 2010 09:46:17 -0700 Subject: [dba-VB] C# access to thunderbird In-Reply-To: <4CCEE7D5.9060007@colbyconsulting.com> References: <4CCEE7D5.9060007@colbyconsulting.com> Message-ID: <28D9C56616DA407AA50A108A97951C8E@creativesystemdesigns.com> I do not think there is any direct interface to Thunderbird via C#...there is a product called XUL which seems to be able to interface but I know nothing more than that. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, November 01, 2010 9:16 AM To: VBA Subject: [dba-VB] C# access to thunderbird Has anyone figured out accessing Thunderbird from C# / .Net? I did a 10 minute Google and am... uh... not encouraged. I am not finding a well written API or an object that can be referenced. Has anyone done this? I use Thunderbird exclusively here at my home / office and really don't want to go back to Outlook just so that I can program against a model. -- 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 Nov 3 20:22:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 03 Nov 2010 21:22:11 -0400 Subject: [dba-VB] Comparative timings Message-ID: <4CD20AC3.2020308@colbyconsulting.com> I am processing an order for the client that i built this server for. One of the steps is to count the available records. The task, select 640K records from two related tables, 65 million names / addresses joined to 50 million records of demographics (the database from hell). Filter down to (male, high income, young) and (has kids or mail order buyers). The selection views return full name / address plus selection fields. Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the clustered index). Cover indexes on the selection fields. The tables are in separate databases, both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection view. The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around 20% -25% of capacity. I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, averaging about 30-40% of capacity. The time to do the count was about 3:36. I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but a couple of the other cores not assigned also did something significant - 30-40%. The time to do the count was 2:06. I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% for much of the time, but the total time was 1:53. I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the total time was 2:01. Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to process the count. And finally back to 12 gigs and 3 procs. 2:00 So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating and disturbing). 3 cores and 24 gigs put on a very poor show. And of course this test did not have the server doing anything else. I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm did not perform as well as on the previous server. I believe it is probably a simple matter of clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single core and if the core is faster... So I will likely rebuild a server to just hold the vm. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu Nov 4 08:39:17 2010 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 4 Nov 2010 06:39:17 -0700 Subject: [dba-VB] [dba-SQLServer] Comparative timings In-Reply-To: <4CD20AC3.2020308@colbyconsulting.com> References: <4CD20AC3.2020308@colbyconsulting.com> Message-ID: John, Just curious but did you shut down the instance after each change or clear the buffers and cache to ensure proper benchmarking? You can clear the cache by running DBCC DROPCLEANBUFFERS, Then run DBCC FREEPROCCACHE, which clears the stored procedure cache. -Francisco http://bit.ly/sqlthis | Tsql and More... On Wed, Nov 3, 2010 at 6:22 PM, jwcolby wrote: > I am processing an order for the client that i built this server for. One > of the steps is to count > the available records. > > The task, select 640K records from two related tables, 65 million names / > addresses joined to 50 > million records of demographics (the database from hell). Filter down to > (male, high income, young) > and (has kids or mail order buyers). The selection views return full name > / address plus selection > fields. > > Both tables have a clustered index on integer PK. The tables are joined on > PK/FK (the key of the > clustered index). Cover indexes on the selection fields. The tables are > in separate databases, > both databases on the same SSD (2 drive raid 0). The count simply counts > the PKID of the selection > view. > > The server was configured with 6 of 8 cores available to SQL Server and 24 > gigs of RAM. The count > ran consistently around 0:1:55 (one minute 55 secs). The system was only > running the 6 cores around > 20% -25% of capacity. > > I cut the processors assigned to 3 of 8 and reran the same count. The > three assigned processors ran > about 80% of capacity, but several of the processors not assigned to SQL > Server also ran something, > averaging about 30-40% of capacity. The time to do the count was about > 3:36. > > I then cut the memory assigned to SQL Server to 12 gigs with 3 cores > assigned. Again, the > processors ran very similar to the last run, the three assigned to SQL > Server ran around 60-80% but > a couple of the other cores not assigned also did something significant - > 30-40%. The time to do > the count was 2:06. > > I then assigned 6 processors but 12 gigs of memory. The 6 processors > assigned averaged around 80% > for much of the time, but the total time was 1:53. > > I then jacked the memory back up to 24 gigs / 6 processors. Average core > utilization dropped, the > total time was 2:01. > > Just to see if it was an anomaly I dropped back down to 3 procs with 24 > gigs of memory. 4:00 to > process the count. > > And finally back to 12 gigs and 3 procs. 2:00 > > So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs > (which I find fascinating > and disturbing). 3 cores and 24 gigs put on a very poor show. > > And of course this test did not have the server doing anything else. > > I had intended to run a VM on the server though I am changing my mind. In > preliminary tests, the vm > did not perform as well as on the previous server. I believe it is > probably a simple matter of > clock speed. This server has 8 cores but they are clocked at 2 gigs. My > previous server had only 4 > cores but they were clocked at 3.2 gigs. The VM has always shown the best > results with a single > core and if the core is faster... > > So I will likely rebuild a server to just hold the vm. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Nov 6 15:15:18 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 16:15:18 -0400 Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs Message-ID: <4CD5B756.5050603@colbyconsulting.com> A fascinating article - modding Seagate disk drive. http://www.techwarelabs.com/seagate_1-5tb-mod Leaves you to wonder how big you could make it and still get that speed. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Nov 6 16:05:26 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:05:26 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs Message-ID: <4CD5C316.5050407@colbyconsulting.com> And another interesting one. http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Sat Nov 6 16:12:16 2010 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 6 Nov 2010 14:12:16 -0700 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: <4CD5C316.5050407@colbyconsulting.com> References: <4CD5C316.5050407@colbyconsulting.com> Message-ID: When you get this working, let us know how it went! Doug On Sat, Nov 6, 2010 at 2:05 PM, jwcolby wrote: > And another interesting one. > > > http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 > > -- > 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 Nov 6 16:25:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:25:08 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: References: <4CD5C316.5050407@colbyconsulting.com> Message-ID: <4CD5C7B4.3070409@colbyconsulting.com> LOL, I have no use for this. I just found it interesting enough to read. John W. Colby www.ColbyConsulting.com On 11/6/2010 5:12 PM, Doug Steele wrote: > When you get this working, let us know how it went! > > Doug > > On Sat, Nov 6, 2010 at 2:05 PM, jwcolby wrote: > >> And another interesting one. >> >> >> http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 >> >> -- >> 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 dbdoug at gmail.com Sat Nov 6 16:35:28 2010 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 6 Nov 2010 14:35:28 -0700 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: <4CD5C7B4.3070409@colbyconsulting.com> References: <4CD5C316.5050407@colbyconsulting.com> <4CD5C7B4.3070409@colbyconsulting.com> Message-ID: I figure it could give you something do do while you're waiting for your mega queries to run :) Doug On Sat, Nov 6, 2010 at 2:25 PM, jwcolby wrote: > LOL, I have no use for this. I just found it interesting enough to read. > > John W. Colby > www.ColbyConsulting.com > > On 11/6/2010 5:12 PM, Doug Steele wrote: > > When you get this working, let us know how it went! > > > > Doug > > > > On Sat, Nov 6, 2010 at 2:05 PM, jwcolby > wrote: > > > >> And another interesting one. > >> > >> > >> > http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 > >> > >> -- > >> 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 Sat Nov 6 16:42:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 06 Nov 2010 17:42:08 -0400 Subject: [dba-VB] How To Hack Your Neighbor's WIFI/Wireless With Your Graphics Card | TechwareLabs In-Reply-To: References: <4CD5C316.5050407@colbyconsulting.com> <4CD5C7B4.3070409@colbyconsulting.com> Message-ID: <4CD5CBB0.2030000@colbyconsulting.com> I am waiting considerably less since the new server install. ;) John W. Colby www.ColbyConsulting.com On 11/6/2010 5:35 PM, Doug Steele wrote: > I figure it could give you something do do while you're waiting for your > mega queries to run :) > > Doug > > On Sat, Nov 6, 2010 at 2:25 PM, jwcolby wrote: > >> LOL, I have no use for this. I just found it interesting enough to read. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 11/6/2010 5:12 PM, Doug Steele wrote: >>> When you get this working, let us know how it went! >>> >>> Doug >>> >>> On Sat, Nov 6, 2010 at 2:05 PM, jwcolby >> wrote: >>> >>>> And another interesting one. >>>> >>>> >>>> >> http://www.techwarelabs.com/how-to-hack-your-neighbors-wifiwireless-with-your-graphics-card/all/1 >>>> >>>> -- >>>> 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 accessd at shaw.ca Sat Nov 6 18:08:22 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 6 Nov 2010 16:08:22 -0700 Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs In-Reply-To: <4CD5B756.5050603@colbyconsulting.com> References: <4CD5B756.5050603@colbyconsulting.com> Message-ID: <531E3AF46E0E4863B287DC202FF81E86@creativesystemdesigns.com> That is real neat. A poorman's high speed boot drive. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, November 06, 2010 1:15 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] Seagate Barracuda 1.5 Tb MOD | TechwareLabs A fascinating article - modding Seagate disk drive. http://www.techwarelabs.com/seagate_1-5tb-mod Leaves you to wonder how big you could make it and still get that speed. -- 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 Nov 14 20:05:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 14 Nov 2010 21:05:44 -0500 Subject: [dba-VB] Rounding time Message-ID: <4CE09578.1010606@colbyconsulting.com> ' '1440 '____ = 5 minute round 'X Function RoundTime(vRoundTime As Date) As Date 'Const cintMult As Integer = 96 '15 minute round 'Const cintMult As Integer = 144 '10 minute round Const cintMult As Integer = 288 '5 minute round RoundTime = CVDate(Int(vRoundTime * cintMult + 0.5) / cintMult) End Function -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 19 10:04:14 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 19 Nov 2010 11:04:14 -0500 Subject: [dba-VB] What is EventArg? Message-ID: <4CE69FFE.7050105@colbyconsulting.com> The MS "convention" is that an event method raises an event and passes out two parameters, one of which is EventArg e. What is e? I need to pass back status from the object raising the event and EventArgs seems like what I should be using to send back the status, but e has not methods for directly adding status like information. Am I supposed to create a status class and have it inherit (descend from) EventArgs? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Nov 19 11:02:04 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 19 Nov 2010 18:02:04 +0100 Subject: [dba-VB] What is EventArg? Message-ID: Hi John As I've seen it, e returns a collection of properties (or values) from the event, but which is dependant on which object raised the event and what "type" the event was. I don't recall any methods, for example: private string _nodeSelected; private void TreeViewMenu_AfterSelect(object sender, TreeViewEventArgs e) { _nodeSelected = e.Node.Name; Console.WriteLine(e.Node.Handle.ToString()); } private void TreeViewMenu_KeyPress(object sender, KeyPressEventArgs e) { Console.WriteLine((string)"Key: " + _nodeSelected); TreeViewAction(); // Avoid speaker "beep" for not found keyboard entries. e.Handled = true; } I often use "sender" to obtain the object in question without specifying its name: private void dataTableEmployerDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) { DataGridView dataGridView = (DataGridView)sender; DataGridViewCell cell = dataGridView[e.ColumnIndex, e.RowIndex]; if (cell.ColumnIndex.Equals(_columnIndexPassword)) { // Check if the new password contains invalid chars. string password = cell.Value.ToString().Replace(" ", "").Replace("\'", "").Replace("\"", ""); if (password.Length == 0) { // Invalid chars found or password is of zero length. password = _password; } cell.Value = password; } } /gustav >>> jwcolby at colbyconsulting.com 19-11-2010 17:04:14 >>> The MS "convention" is that an event method raises an event and passes out two parameters, one of which is EventArg e. What is e? I need to pass back status from the object raising the event and EventArgs seems like what I should be using to send back the status, but e has not methods for directly adding status like information. Am I supposed to create a status class and have it inherit (descend from) EventArgs? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 19 12:58:42 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 19 Nov 2010 13:58:42 -0500 Subject: [dba-VB] What is EventArg? In-Reply-To: References: Message-ID: <4CE6C8E2.3030107@colbyconsulting.com> As it happens, we have solved this problem. The EventArgs class is used to create a new class which is descendant from this EventArgs class. You then add your own properties that you need to pass back. public class DbExpEventArgs : EventArgs { public int recCount; public Exception ex; public SqlException exSql; } RecCount, Ex and SQLEx are properties that I car about in this case. Now I can create an instance of this class and fill in any of the properties, then pass this back to the event handler. John W. Colby www.ColbyConsulting.com On 11/19/2010 12:02 PM, Gustav Brock wrote: > Hi John > > As I've seen it, e returns a collection of properties (or values) from the event, but which is dependant on which object raised the event and what "type" the event was. > I don't recall any methods, for example: > > private string _nodeSelected; > > > > private void TreeViewMenu_AfterSelect(object sender, TreeViewEventArgs e) > { > _nodeSelected = e.Node.Name; > Console.WriteLine(e.Node.Handle.ToString()); > } > > private void TreeViewMenu_KeyPress(object sender, KeyPressEventArgs e) > { > Console.WriteLine((string)"Key: " + _nodeSelected); > TreeViewAction(); > // Avoid speaker "beep" for not found keyboard entries. > e.Handled = true; > } > > I often use "sender" to obtain the object in question without specifying its name: > > private void dataTableEmployerDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) > { > DataGridView dataGridView = (DataGridView)sender; > DataGridViewCell cell = dataGridView[e.ColumnIndex, e.RowIndex]; > if (cell.ColumnIndex.Equals(_columnIndexPassword)) > { > // Check if the new password contains invalid chars. > string password = cell.Value.ToString().Replace(" ", "").Replace("\'", "").Replace("\"", ""); > if (password.Length == 0) > { > // Invalid chars found or password is of zero length. > password = _password; > } > cell.Value = password; > } > } > > /gustav > > >>>> jwcolby at colbyconsulting.com 19-11-2010 17:04:14>>> > The MS "convention" is that an event method raises an event and passes out two parameters, one of > which is EventArg e. > > What is e? > > I need to pass back status from the object raising the event and EventArgs seems like what I should > be using to send back the status, but e has not methods for directly adding status like information. > > Am I supposed to create a status class and have it inherit (descend from) EventArgs? > From jwcolby at colbyconsulting.com Mon Nov 22 11:53:54 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 22 Nov 2010 12:53:54 -0500 Subject: [dba-VB] OT: SAMSUNG Spinpoint F3 HD103SJ Message-ID: <4CEAAE32.2020809@colbyconsulting.com> Samsung 1 tb drive $55 with free shipping http://www.newegg.com/Product/Product.aspx?Item=N82E16822152185 -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Nov 25 23:42:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 26 Nov 2010 00:42:17 -0500 Subject: [dba-VB] Samsung 2 gb 5400 $80 Message-ID: <4CEF48B9.80204@colbyconsulting.com> For anyone doing an HTPC - this is a well liked, huge drive for a darned good price. I'm about to do this. http://www.newegg.com/Product/Product.aspx?Item=N82E16822152245 I just pulled the trigger on a 40" LCD for the bedroom and now I need an HTPC. I have a version 1 TIVO but that is getting long in the tooth, and doesn't really look very good on a high def TV. I think it is time to move on, though I am not sure whether I will convince my wife to give up the TIVO. The TIVO is probably the most reliable piece of electronics I have *ever* encountered and dead simple to use. The HTPC will cost more than the TV by quite a bit (or the TIVO, even with the lifetime subscription). OTOH I built one for the living room and it has been solid as a rock since I moved it to Windows 7. The HTPC can work with my Unraid media server to display not only ripped movies but photos, home video and music. My new low end cameras take stunningly good video in addition to photos. My daughter loves to sit and watch home videos of herself. Quite the little narcissist. -- John W. Colby www.ColbyConsulting.com From actebs at actebs.com.au Tue Nov 30 07:06:52 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 00:06:52 +1100 Subject: [dba-VB] Close DB Connection Message-ID: <001201cb908f$7512cac0$5f386040$@com.au> Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad From shamil at smsconsulting.spb.ru Tue Nov 30 07:31:12 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 30 Nov 2010 16:31:12 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001201cb908f$7512cac0$5f386040$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ 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 Nov 30 07:46:49 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 30 Nov 2010 08:46:49 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001201cb908f$7512cac0$5f386040$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: <4CF50049.6030803@colbyconsulting.com> I had a similar issue with connections to SQL Server. When I was investigating the problem I discovered that (in my case) the issue was that the garbage collector (GC) was taking its sweet time collecting the trash, and the connections were not released until the trash was taken out. Understand that in my case I was creating classes which created a collection, then I would destroy the class. Since the GC does its thing whenever it decides that it needs to free up memory, and since I had a lot of memory, the GC decided to take its sweet time. Once I discovered destructors and dispose, my problems went away. John W. Colby www.ColbyConsulting.com On 11/30/2010 8:06 AM, ACTEBS wrote: > Hi Everyone, > > > > I've got this issue with my app where the app keeps it's connection to the > Access DB open even after the application has finished it's task. I can't > figure out for the life of me where I've missed closing it in the various > Functions and Sub Routines. > > > > I've ensured that cn.Close and cn = Nothing, has been included in all the > code where the DB is opened. The only place I can't include cn = Nothing is > when the connection is encapsulated within a Using Statement where for some > reason this is not allowed. Could this be the problem? If so, how can I > release the connection? > > > > Also, is there any way of finding out which bit of code is keeping the > connection open? > > > > Many Thanks > > > > Vlad > > > > > > > > _______________________________________________ > 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 Nov 30 12:44:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 30 Nov 2010 21:44:57 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView header ( .TopLeftHeaderCell)? Message-ID: Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil From actebs at actebs.com.au Tue Nov 30 21:50:29 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 14:50:29 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: References: <001201cb908f$7512cac0$5f386040$@com.au> Message-ID: <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ 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 actebs at actebs.com.au Tue Nov 30 21:53:10 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 14:53:10 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <4CF50049.6030803@colbyconsulting.com> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com> Message-ID: <001801cb910b$45a462e0$d0ed28a0$@com.au> Hi John, Would you please give me an example of how you use the destructor class to close an open db connection? I've researched it, but can't conceptualise how you'd set it up. Many thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, 1 December 2010 12:47 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Close DB Connection I had a similar issue with connections to SQL Server. When I was investigating the problem I discovered that (in my case) the issue was that the garbage collector (GC) was taking its sweet time collecting the trash, and the connections were not released until the trash was taken out. Understand that in my case I was creating classes which created a collection, then I would destroy the class. Since the GC does its thing whenever it decides that it needs to free up memory, and since I had a lot of memory, the GC decided to take its sweet time. Once I discovered destructors and dispose, my problems went away. John W. Colby www.ColbyConsulting.com On 11/30/2010 8:06 AM, ACTEBS wrote: > Hi Everyone, > > > > I've got this issue with my app where the app keeps it's connection to the > Access DB open even after the application has finished it's task. I can't > figure out for the life of me where I've missed closing it in the various > Functions and Sub Routines. > > > > I've ensured that cn.Close and cn = Nothing, has been included in all the > code where the DB is opened. The only place I can't include cn = Nothing is > when the connection is encapsulated within a Using Statement where for some > reason this is not allowed. Could this be the problem? If so, how can I > release the connection? > > > > Also, is there any way of finding out which bit of code is keeping the > connection open? > > > > Many Thanks > > > > Vlad > > > > > > > > _______________________________________________ > 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