From jwcolby at colbyconsulting.com Wed Jul 4 10:24:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 4 Jul 2007 11:24:23 -0400 Subject: [dba-VB] VB.Net - System.IO.Stream Message-ID: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> I am working with a library that wants a stream passed in. NOT a StreamReader, a plain old stream. According to the docs, Stream is supposed to be a member of System.IO but it does not appear to be. According to Microsoft's docs, Stream is supposed to be the base class and is supposed to be accessible. I cannot get at it. Does anyone know how to reference System.IO.Stream? John W. Colby Colby Consulting www.ColbyConsulting.com From chizotz at mchsi.com Wed Jul 4 12:34:48 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 4 Jul 2007 12:34:48 -0500 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> References: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> Message-ID: <5310128033.20070704123448@mchsi.com> Hi John, Stream is an abstract class so an instance can't be created. You need to create an instance of a specific type of stream then pass that. I've never used it, but I suspect what you need is a MemoryStream, you might want to check into that. Ron Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > I am working with a library that wants a stream passed in. NOT a > StreamReader, a plain old stream. According to the docs, Stream is supposed > to be a member of System.IO but it does not appear to be. According to > Microsoft's docs, Stream is supposed to be the base class and is supposed to > be accessible. I cannot get at it. > Does anyone know how to reference System.IO.Stream? --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com From gustav at cactus.dk Wed Jul 4 16:43:08 2007 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 04 Jul 2007 23:43:08 +0200 Subject: [dba-VB] Menu control Message-ID: Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From jwcolby at colbyconsulting.com Wed Jul 4 18:48:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 4 Jul 2007 19:48:37 -0400 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <5310128033.20070704123448@mchsi.com> Message-ID: <20070704234853.B108ABD83@smtp-auth.no-ip.com> Ron, Unfortunately intellisense is telling me that a type STREAM is required, and furthermore if I try to pass any of the subtypes the DLLs class constructor refuses to accept it. It seems that I cannot do a new on it but I may be able to somehow dim an instance of the base class. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen Sent: Wednesday, July 04, 2007 1:35 PM To: jwcolby Subject: Re: [dba-VB] VB.Net - System.IO.Stream Hi John, Stream is an abstract class so an instance can't be created. You need to create an instance of a specific type of stream then pass that. I've never used it, but I suspect what you need is a MemoryStream, you might want to check into that. Ron Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > I am working with a library that wants a stream passed in. NOT a > StreamReader, a plain old stream. According to the docs, Stream is > supposed to be a member of System.IO but it does not appear to be. > According to Microsoft's docs, Stream is supposed to be the base class > and is supposed to be accessible. I cannot get at it. > Does anyone know how to reference System.IO.Stream? --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From martyconnelly at shaw.ca Wed Jul 4 21:08:29 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Wed, 04 Jul 2007 19:08:29 -0700 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <20070704234853.B108ABD83@smtp-auth.no-ip.com> References: <20070704234853.B108ABD83@smtp-auth.no-ip.com> Message-ID: <468C529D.4030505@shaw.ca> I thought it was dedclared this way Imports System.IO Dim s As System.IO.Stream jwcolby wrote: >Ron, > >Unfortunately intellisense is telling me that a type STREAM is required, and >furthermore if I try to pass any of the subtypes the DLLs class constructor >refuses to accept it. It seems that I cannot do a new on it but I may be >able to somehow dim an instance of the base class. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen >Sent: Wednesday, July 04, 2007 1:35 PM >To: jwcolby >Subject: Re: [dba-VB] VB.Net - System.IO.Stream > >Hi John, > >Stream is an abstract class so an instance can't be created. You need to >create an instance of a specific type of stream then pass that. I've never >used it, but I suspect what you need is a MemoryStream, you might want to >check into that. > >Ron > > >Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > > > >>I am working with a library that wants a stream passed in. NOT a >>StreamReader, a plain old stream. According to the docs, Stream is >>supposed to be a member of System.IO but it does not appear to be. >>According to Microsoft's docs, Stream is supposed to be the base class >>and is supposed to be accessible. I cannot get at it. >> >> > > > >>Does anyone know how to reference System.IO.Stream? >> >> > > > > >--- >avast! Antivirus: Outbound message clean. >Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM >avast! - copyright (c) 1988-2007 ALWIL Software. >http://www.avast.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 > > > > > -- Marty Connelly Victoria, B.C. Canada From Jdemarco at hudsonhealthplan.org Thu Jul 5 07:02:45 2007 From: Jdemarco at hudsonhealthplan.org (Jim DeMarco) Date: Thu, 5 Jul 2007 08:02:45 -0400 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: <0B8880A20E2CF24280FA60901E108FB08F28EF@TTNEXCHSVR.hshhp.com> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 5 09:15:26 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jul 2007 16:15:26 +0200 Subject: [dba-VB] Menu control Message-ID: Hi Jim It was something like this I had in mind: http://www.divil.co.uk/net/controls/eyefinder/rendering.aspx It is for VS2005. /gustav >>> Jdemarco at hudsonhealthplan.org 05-07-2007 14:02 >>> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From cfoust at infostatsystems.com Thu Jul 5 12:12:30 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 5 Jul 2007 10:12:30 -0700 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 5 12:35:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 5 Jul 2007 13:35:53 -0400 Subject: [dba-VB] Menu control In-Reply-To: Message-ID: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> >We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Jane, you ignorant slut (to quote one of my favorite SNL skits). I must say I can't for the life of me figure out WHY you would avoid a piece of trash that takes up 1/4 of the screen in low resolution modes. But that is of course just my own opinion. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 05, 2007 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 5 15:12:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 5 Jul 2007 13:12:03 -0700 Subject: [dba-VB] Menu control In-Reply-To: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> References: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> Message-ID: Why, John, what a sweet thing to say!! LOL We finally agree on something ... The ribbon, that is. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 05, 2007 10:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control >We basically give the user multiple ways to get at menu options and we >are actively avoiding *ribbons*!! Jane, you ignorant slut (to quote one of my favorite SNL skits). I must say I can't for the life of me figure out WHY you would avoid a piece of trash that takes up 1/4 of the screen in low resolution modes. But that is of course just my own opinion. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 05, 2007 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Jdemarco at hudsonhealthplan.org Fri Jul 6 13:17:51 2007 From: Jdemarco at hudsonhealthplan.org (Jim DeMarco) Date: Fri, 6 Jul 2007 14:17:51 -0400 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: <0B8880A20E2CF24280FA60901E108FB08F2961@TTNEXCHSVR.hshhp.com> That's a nice looking control eh? I think the one I just sent you is older. Good luck, Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 05, 2007 10:15 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control Hi Jim It was something like this I had in mind: http://www.divil.co.uk/net/controls/eyefinder/rendering.aspx It is for VS2005. /gustav >>> Jdemarco at hudsonhealthplan.org 05-07-2007 14:02 >>> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Mon Jul 9 20:35:54 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Tue, 10 Jul 2007 11:35:54 +1000 Subject: [dba-VB] Menu control References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289A19@ddi-01.DDI.local> Dotnetbar is my favourite. It covers just about every UI menu/toolbar style going back to Office 2000. It also does docking windows, which I like a lot. 200 USD IIRC. Well worth it IMO. http://www.devcomponents.com/dotnetbar/ cheers Michael M Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Tue Jul 10 03:08:17 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 10 Jul 2007 10:08:17 +0200 Subject: [dba-VB] Menu control Message-ID: Hi Michael Thanks! It seems to be very comprehensive ... /gustav >>> michael at ddisolutions.com.au 10-07-2007 03:35 >>> Dotnetbar is my favourite. It covers just about every UI menu/toolbar style going back to Office 2000. It also does docking windows, which I like a lot. 200 USD IIRC. Well worth it IMO. http://www.devcomponents.com/dotnetbar/ cheers Michael M Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From Gustav at cactus.dk Tue Jul 10 11:51:14 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 10 Jul 2007 18:51:14 +0200 Subject: [dba-VB] Cheat Sheets Message-ID: Hi all "Learn Visual Studio" http://www.learnvisualstudio.net has just published this set of syntax/overview/etc cards which you may find handy and useful: We've spent a lot of time developing these free cheat sheets, to make your experience with Microsoft Visual Studio, even easier. And the best part is they're free for anyone to download. So, print 'em out, put 'em on your bulletin board, in your wallet, or near your computer to help give you a gentle nudge as you're writing code. We have 6 cheat sheets available for you to download in PDF format. Choose the one that works best for you, or grab them all, they're your's now. Take a look; ------------------------------------------------------------------------- VB Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=5cbf7baf-aef6-47da-9862-609444c12aa4 ------------------------------------------------------------------------- C# Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=ef94e215-f654-4f1f-9ff3-3a48e3d987b0 ------------------------------------------------------------------------- ASP.NET Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=6cf3ecf8-668c-4614-9248-c75529149876 ------------------------------------------------------------------------- VB Toolbars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=83ebdfe5-6e9a-47c2-be3d-ee1077148bc3 ------------------------------------------------------------------------- C#Toolbars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=2116b801-40f6-49e7-868e-c7c90cbc5a1d ------------------------------------------------------------------------- Visual Web Developer Tool Bars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=f9f74ae8-6bfb-4288-91ab-aaba042dd63d Watch for word wraps. /gustav From jwcolby at colbyconsulting.com Tue Jul 10 22:24:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 10 Jul 2007 23:24:36 -0400 Subject: [dba-VB] Build table Message-ID: <20070711032439.67F66BE14@smtp-auth.no-ip.com> I need to build a table in SQL Server given a server name, database name, table name and a list of fields. I have a rough draft as follows: Public Function mCreateTbl() As Boolean Dim strSQL As String With csvData.Columns Dim strName As String strSQL = "CREATE TABLE [" & mstrDatabaseName & "].[dbo].[" & mstrTblName & "] (" & _ "[PKID] [int] IDENTITY (1, 1) NOT NULL " For Each strName In .Names strSQL = strSQL & ",[" & strName & "] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL " Next strName strSQL = strSQL & ") ON [PRIMARY] " & _ "GO()" Dim strSQLAddKey As String strSQLAddKey = "ALTER TABLE [dbo].[" & mstrTblName & "] WITH NOCHECK ADD " & _ "CONSTRAINT [PKID] PRIMARY KEY CLUSTERED (" & _ "[PKID]() " & _ ") ON [PRIMARY] " & _ "GO()" End With End Function I have not yet even started testing it to get the strings compilable in SQL Server but if and when it comes together, what would the database objects (ADO?) look like to execute such a beast? Is anyone doing such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com From mikedorism at verizon.net Wed Jul 11 05:56:12 2007 From: mikedorism at verizon.net (Doris Manning) Date: Wed, 11 Jul 2007 06:56:12 -0400 Subject: [dba-VB] Build table In-Reply-To: <20070711032439.67F66BE14@smtp-auth.no-ip.com> References: <20070711032439.67F66BE14@smtp-auth.no-ip.com> Message-ID: <000901c7c3aa$18f4c6e0$2f01a8c0@Kermit> John, You will need an ADO Connection object and an ADO Command object. You don't need to include "GO()" in the SQL Statement. You only use that when you are working in Query Analyzer. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 10, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Build table I need to build a table in SQL Server given a server name, database name, table name and a list of fields. I have a rough draft as follows: Public Function mCreateTbl() As Boolean Dim strSQL As String With csvData.Columns Dim strName As String strSQL = "CREATE TABLE [" & mstrDatabaseName & "].[dbo].[" & mstrTblName & "] (" & _ "[PKID] [int] IDENTITY (1, 1) NOT NULL " For Each strName In .Names strSQL = strSQL & ",[" & strName & "] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL " Next strName strSQL = strSQL & ") ON [PRIMARY] " & _ "GO()" Dim strSQLAddKey As String strSQLAddKey = "ALTER TABLE [dbo].[" & mstrTblName & "] WITH NOCHECK ADD " & _ "CONSTRAINT [PKID] PRIMARY KEY CLUSTERED (" & _ "[PKID]() " & _ ") ON [PRIMARY] " & _ "GO()" End With End Function I have not yet even started testing it to get the strings compilable in SQL Server but if and when it comes together, what would the database objects (ADO?) look like to execute such a beast? Is anyone doing such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 11 09:19:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 10:19:36 -0400 Subject: [dba-VB] Visual studio help Message-ID: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Wed Jul 11 10:14:20 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 11 Jul 2007 08:14:20 -0700 Subject: [dba-VB] Visual studio help In-Reply-To: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> References: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> Message-ID: By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 11 10:51:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 11:51:28 -0400 Subject: [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Wed Jul 11 11:04:55 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 11 Jul 2007 09:04:55 -0700 Subject: [dba-VB] Visual studio help In-Reply-To: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> References: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Message-ID: Oh, that!! The filtering stuff has gotten progressively worse in VS with each version. Mine comes up by default filtered by Infragistics Software, even though the help pane itself amy have brought up the VB Language Reference information for whatever I hit F1 on. You can set the filter and it should remember it next time you hit F1, but I never bother because I rock back and forth between VB.Net and the custom help for the 3rd party tools and SQL Server. The filter seems to be only loosely coupled to the help pane, so I wouldn't depend on it for much unless you like drilling down tree views. The search tab is what I always use. You can type in the word or phrase, set you language, technology and content and see a list of search hits. That usually works best for me, kind of like searching the MSKB. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:51 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com; 'Access Developers discussion and problem solving' Subject: Re: [dba-VB] Visual studio help Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 Wed Jul 11 11:14:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:14:53 -0400 Subject: [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711161456.9C2DFBC01@smtp-auth.no-ip.com> Well, the problem is that the filter seems to control whether anything will appear. Given that the only choices are SQL stuff, if I try to search for something specific to VB.net language nothing appears. And since I cannot change the filters to anything else... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 12:05 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help Oh, that!! The filtering stuff has gotten progressively worse in VS with each version. Mine comes up by default filtered by Infragistics Software, even though the help pane itself amy have brought up the VB Language Reference information for whatever I hit F1 on. You can set the filter and it should remember it next time you hit F1, but I never bother because I rock back and forth between VB.Net and the custom help for the 3rd party tools and SQL Server. The filter seems to be only loosely coupled to the help pane, so I wouldn't depend on it for much unless you like drilling down tree views. The search tab is what I always use. You can type in the word or phrase, set you language, technology and content and see a list of search hits. That usually works best for me, kind of like searching the MSKB. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:51 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com; 'Access Developers discussion and problem solving' Subject: Re: [dba-VB] Visual studio help Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 jwcolby at colbyconsulting.com Wed Jul 11 11:29:03 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:29:03 -0400 Subject: [dba-VB] [dba-SQLServer] Visual studio help In-Reply-To: <200707111605.l6BG50a6018086@databaseadvisors.com> Message-ID: <20070711162907.4016CBE1D@smtp-auth.no-ip.com> Robert, Yep, a reinstall of MSDN fixed the problem. Thanks for the heads up John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Wednesday, July 11, 2007 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Visual studio help John, The help files for Visual Studio are not installed automatically. You have to run the install on the MSDN disk(s) that came with it to get help of any kind. Robert At 10:51 AM 7/11/2007, you wrote: >Date: Wed, 11 Jul 2007 11:51:28 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] [dba-VB] Visual studio help >To: , > , "'Access Developers discussion and > problem solving'" >Message-ID: <20070711155131.9F8C9BE74 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Yes, but if you hit F1 then it opens a help file of some sort. I can >say whether it is going to use the local help or the internet help first etc. >As for books online, well... I only know that term in terms of SQL Server. > >1) Go into code. >2) Select some something, keyword, whatever. >3) Hit F1. > >What do you see? > >I see a help window. On the top blue bar it says "Microsoft Visual >Studio >2005 Documentation". That is a good sign. > >However on the left hand side there is a Pane (or PAIN depending on >your point of view), which has a "filter by" combo. The ONLY CHOICES >(for me) >are: > >SQL Server 2005 >SQL Server Analysis Service >SQL Server... >SQL Server... >SQL Server... >Etc etc. > >I am locked in to filtering on SQL Server help. I DON'T WANT SQL >SERVER HELP, I WANT VB HELP. > >Actually I want to be able to select VB, C#, Java, SQL Server and >whatever else is appropriate in the context I am using. I am flying >Visual Studio blind, unless all I am interested in is SQL Server help >in which case I am ducky. > >John W. Colby _______________________________________________ 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 Wed Jul 11 22:03:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 23:03:42 -0400 Subject: [dba-VB] Windows 2003 x64; SQL Server 2005 X64 Message-ID: <20070712030347.0B7E8BDA9@smtp-auth.no-ip.com> Is anyone out there running Windows 2003 X64? If so would you care to comment on what was involved in getting it to happen, drivers, getting the software etc. Same question for SQl Server 2005 X64. John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 17:27:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 18:27:59 -0400 Subject: [dba-VB] VB.Net - DoEvents Message-ID: <20070712222800.DE47FBD36@smtp-auth.no-ip.com> I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 22:25:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 23:25:15 -0400 Subject: [dba-VB] Resource files Message-ID: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 23:33:27 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 00:33:27 -0400 Subject: [dba-VB] Convert C to VB Message-ID: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com From newsgrps at dalyn.co.nz Thu Jul 12 23:41:35 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 13 Jul 2007 16:41:35 +1200 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> References: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <20070713043858.EMOF11149.fep01.xtra.co.nz@Dalyn.dalyn.co.nz> John, Try this site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx Regards David Emerson Dalyn Software Ltd Wellington, New Zealand At 13/07/2007, you wrote: >I need to convert a chunk of 'C#' code to Vb. The code apparently allows >you to get an expanded list of default values for the FolderBrowserDialog. > >It isn't much and I (believe I) have mostly figured it out. > >http://www.xoc.net/works/tips/folderbrowserdialog.asp > >So far I have: > >imports System; >imports System.Reflection; > >Public Class FolderBrowserDialogEx > '[Flags()] > Public Enum CsIdl > Desktop = &H0 ' Desktop > Internet = &H1 ' Internet Explorer (icon on desktop) > Programs = &H2 '// Start Menu\Programs > Controls = &H3 ' My Computer\Control Panel > Printers = &H4 ' My Computer\Printers > Personal = &H5 ' My Documents > Favorites = &H6 ' user name\Favorites > Startup = &H7 ' Start Menu\Programs\Startup > Recent = &H8 ' user name\Recent > SendTo = &H9 ' user name\SendTo > BitBucket = &HA ' desktop\Recycle Bin > StartMenu = &HB ' user name\Start Menu > MyDocuments = &HC ' logical "My Documents" desktop icon > MyMusic = &HD ' "My Music" folder > MyVideo = &HE ' "My Videos" folder > DesktopDirectory = &H10 ' user name\Desktop > Drives = &H11 ' My Computer > Network = &H12 ' Network Neighborhood (My Network Places) > Nethood = &H13 ' user name\nethood > Fonts = &H14 ' windows\fonts > Templates = &H0015, > CommonStartMenu = &H16 ' All Users\Start Menu > CommonPrograms = &H17 ' All Users\Start Menu\Programs > CommonStartup = &H18 ' All Users\Startup > CommonDesktopDirectory = &H19 ' All Users\Desktop > AppData = &H1A ' user name\Application Data > PrintHood = &H1B ' user name\PrintHood > LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non >roaming) > AltStartup = &H1D ' non localized startup > CommonAltStartup = &H1E ' non localized common startup > CommonFavorites = &H1F > InternetCache = &H20 > Cookies = &H21 > History = &H22 > CommonAppdata = &H23 ' All Users\Application Data > Windows = &H24 ' GetWindowsDirectory() > System = &H25 ' GetSystemDirectory() > ProgramFiles = &H26 ' C:\Program Files > MyPictures = &H27 ' C:\Program Files\My Pictures > Profile = &H28 ' USERPROFILE > SystemX86 = &H29 ' x86 system directory on RISC > ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC > ProgramFilesCommon = &H2B ' C:\Program Files\Common > ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC > CommonTemplates = &H2D ' All Users\Templates > CommonDocuments = &H2E ' All Users\Documents > CommonAdminTools = &H2F ' All Users\Start >Menu\Programs\Administrative Tools > AdminTools = &H30 ' user name\Start Menu\Programs\Administrative >Tools > Connections = &H31 ' Network and Dial-up Connections > CommonMusic = &H35 ' All Users\My Music > CommonPictures = &H36 ' All Users\My Pictures > CommonVideo = &H37 ' All Users\My Video > Resources = &H38 ' Resource Direcotry > ResourcesLocalized = &H39 ' Localized Resource Direcotry > CommonOemLinks = &H3A ' Links to All Users OEM specific apps > CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application >Data\Microsoft\CD Burning > ComputersNearMe = &H3D ' Computers Near Me (computered from >Workgroup membership) > FlagCreate = &H8000 ' combine with CSIDL_ value to force folder >creation in SHGetFolderPath() > FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an >unverified folder path > FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias >versions of the pidl > FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate >per-user init (eg. upgrade) > FlagMask = &HFF00 ' mask for all possible flag values > > End Enum > > Private Sub FolderBrowserDialogEx() > End Sub > > > Public Sub SetRootFolder(ByVal fbd As >System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) > Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType > dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance >| BindingFlags.NonPublic); > fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); > End Sub >End Class > >That last chunk - SetRootFolder - just isn't cooperating. Any help much >appreciated. > >TIA. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com From ebarro at verizon.net Thu Jul 12 23:42:55 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 12 Jul 2007 21:42:55 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <0JL300K6CP3M1117@vms048.mailsrvcs.net> Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM From accessd at shaw.ca Fri Jul 13 02:37:18 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 13 Jul 2007 00:37:18 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <0JL300J4CWYZUOF0@l-daemon> Hi John: Check the following site out. You can link to it from the DBA web site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:00:16 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:00:16 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <0JL300K6CP3M1117@vms048.mailsrvcs.net> Message-ID: <20070713120017.88743BEB8@smtp-auth.no-ip.com> Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:02:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:02:59 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <0JL300J4CWYZUOF0@l-daemon> Message-ID: <20070713120300.4631CBDD9@smtp-auth.no-ip.com> Like all things, these only get you so far. In this case it didn't get me anywhere but that is another story. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, July 13, 2007 3:37 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Hi John: Check the following site out. You can link to it from the DBA web site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting 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 mikedorism at verizon.net Fri Jul 13 07:18:26 2007 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 13 Jul 2007 08:18:26 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713120017.88743BEB8@smtp-auth.no-ip.com> References: <0JL300K6CP3M1117@vms048.mailsrvcs.net> <20070713120017.88743BEB8@smtp-auth.no-ip.com> Message-ID: <000301c7c547$eaa5c1f0$2f01a8c0@Kermit> You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ 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 mikedorism at verizon.net Fri Jul 13 07:22:16 2007 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 13 Jul 2007 08:22:16 -0400 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> References: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: <000401c7c548$73d00bc0$2f01a8c0@Kermit> The "goodie images" that come with VS 2005 are the standard boring icons and bitmaps. I decided long ago to build my own "goodie image" archive. There are a lot of great online resources for icons. My favorites are (in no particular order): http://www.seoconsultants.com/windows/icons/microsoft/ http://www.coolarchive.com/icons.php http://www.iconbazaar.com/ http://www.iconarchive.com/ Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:36:39 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:36:39 -0400 Subject: [dba-VB] Resource files In-Reply-To: <000401c7c548$73d00bc0$2f01a8c0@Kermit> Message-ID: <20070713123641.1E1DBBCEC@smtp-auth.no-ip.com> Thanks for the links. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:22 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Resource files The "goodie images" that come with VS 2005 are the standard boring icons and bitmaps. I decided long ago to build my own "goodie image" archive. There are a lot of great online resources for icons. My favorites are (in no particular order): http://www.seoconsultants.com/windows/icons/microsoft/ http://www.coolarchive.com/icons.php http://www.iconbazaar.com/ http://www.iconarchive.com/ Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:37:54 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:37:54 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <000301c7c547$eaa5c1f0$2f01a8c0@Kermit> Message-ID: <20070713123755.97D58BE5F@smtp-auth.no-ip.com> Yea, I was hoping that a member who uses C# might be able to translate this. I am such a nubee that I am clueless. I can translate syntax but not much more. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:18 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Fri Jul 13 07:48:22 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 13 Jul 2007 16:48:22 +0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070712222800.DE47FBD36@smtp-auth.no-ip.com> Message-ID: <000401c7c54c$19201db0$6401a8c0@nant> Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 08:10:46 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 09:10:46 -0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <000401c7c54c$19201db0$6401a8c0@nant> Message-ID: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com From ebarro at verizon.net Fri Jul 13 09:29:10 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 13 Jul 2007 07:29:10 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713120017.88743BEB8@smtp-auth.no-ip.com> Message-ID: <0JL4008KQG8EVZ2I@vms044.mailsrvcs.net> John, This compiled for me... Public Sub SetRootFolder(ByRef fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As Type = fbd.GetType() Dim fi As FieldInfo = t.GetField("rootFolder", BindingFlags.Instance Or BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub The error in your transposition had to do with defining t as System.Windows.Forms.FolderBrowserDialog that's why it was complaining when you set it to fbd.GetType() The variable t should have been defined as System.Type as in the original C# code... public static void SetRootFolder(System.Windows.Forms.FolderBrowserDialog fbd, CsIdl csidl) { Type t = fbd.GetType(); FieldInfo fi = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); } Eric -----Original Message----- From: jwcolby [mailto:jwcolby at colbyconsulting.com] Sent: Friday, July 13, 2007 5:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: RE: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: 7/12/2007 4:08 PM From ebarro at verizon.net Fri Jul 13 09:32:57 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 13 Jul 2007 07:32:57 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713123755.97D58BE5F@smtp-auth.no-ip.com> Message-ID: <0JL40085FGEPVMNI@vms044.mailsrvcs.net> Unfortunately most C# programmers don't even want to acknowledge VB.NET as being equal in the programming world. Hence they don't even care to be "ambidexterous" when it comes to programming in .NET. VB.NET is much more forgiving and you can forego a lot of declarations that C# will balk at and ask you to implicitly define in your code before you can use it. I learned .NET using VB.NET and since then I have been using C#. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:38 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Yea, I was hoping that a member who uses C# might be able to translate this. I am such a nubee that I am clueless. I can translate syntax but not much more. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:18 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jul 13 09:56:01 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 13 Jul 2007 09:56:01 -0500 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: I've used Axialis Icon Editor a lot. Let's you pull icons out of .exes, .dll's, etc. Handy tool, and a shell32.dll has a ton of them. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 10:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From shamil at users.mns.ru Fri Jul 13 10:10:28 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 13 Jul 2007 19:10:28 +0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Message-ID: <000601c7c55f$f2cffb30$6401a8c0@nant> Hello John, I have no clear idea why you do not get your WinForms controls updated if you raise and process(sink) events to update these controls in the same thread. Do you have one main (UI/WinForms) thread calling your long running code bulk insert code or this bulk insert is executed in another worker thread? <<< I continue to be amazed at how quickly you can do things in .Net >>> Yes, I agree, .NET 2.0 with VS2005 is the "dream come true"... <<< After hundreds of hours of hacking away I have yet to bind an object to data >>> John, have a look here: http://brewder.blogspot.com/2007/03/data-binding-classes-interfaces-and.html <<< Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! >>> Yes! Waaaaaaaaaa! :) I'm also still far from getting very closely familiar with this .NET Framework "behemoth"... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Jul 13 10:38:21 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 13 Jul 2007 08:38:21 -0700 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> References: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: We just use the WinXP images for stuff like that, John. The easiest way to handle images is with an ImageList control dropped on the form. Once you have pointed the control at an image file (or several if you like), you can copy that imageList control to other forms when you need it and just point to the image in the list. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 8:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Jul 13 10:47:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 13 Jul 2007 08:47:03 -0700 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> References: <000401c7c54c$19201db0$6401a8c0@nant> <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Message-ID: Boy, do I hear that, John! Most of the books are not very helpful in learning .Net for exactly the reasons you give. It was a big help to me to have worked extensively with ADO and to have done a lot of unbound stuff, so I didn't have to rely on binding and object to a data source before starting to work with it. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 6:11 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-i n-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 11:45:31 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 12:45:31 -0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <000601c7c55f$f2cffb30$6401a8c0@nant> Message-ID: <20070713164532.A0D62BD84@smtp-auth.no-ip.com> It is all one thread atm. However the event sinks function and code steps in there. I do DoEvents inside of those event sinks (on the main form) as soon as I update the form controls (in the event sinks). It works correctly when just running, but not when stepping through code. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 11:10 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I have no clear idea why you do not get your WinForms controls updated if you raise and process(sink) events to update these controls in the same thread. Do you have one main (UI/WinForms) thread calling your long running code bulk insert code or this bulk insert is executed in another worker thread? <<< I continue to be amazed at how quickly you can do things in .Net >>> Yes, I agree, .NET 2.0 with VS2005 is the "dream come true"... <<< After hundreds of hours of hacking away I have yet to bind an object to data >>> John, have a look here: http://brewder.blogspot.com/2007/03/data-binding-classes-interfaces-and.html <<< Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! >>> Yes! Waaaaaaaaaa! :) I'm also still far from getting very closely familiar with this .NET Framework "behemoth"... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 10:27:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 11:27:57 -0400 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com From chizotz at mchsi.com Wed Jul 18 11:53:45 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 18 Jul 2007 16:53:45 +0000 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> John, I know that there is a school of thought that this approach is inappropriate, but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER hive so each user has their own set of saved values, which is most often convenient for me. This example stores (in the form close event) the location, height, and width of the form, and (in the form open event) restores the form to that size and location. You should be able to easily adapt it for your needs. Ron (all syntax in C#, but should translate easily and well to VB) using Microsoft.Win32; //necessary include to get Registry classes In form close event: /* If form is maximized, minimized, or larger than the screen in either dimension, do not save size and position information */ if(this.WindowState != FormWindowState.Maximized && this.WindowState != FormWindowState.Minimized && this.Width <= Screen.PrimaryScreen.Bounds.Width && this.Height <= Screen.PrimaryScreen.Bounds.Height) { string regPath = @"Software\Tribune\Circ\CircTools\Settings"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey.GetValue("ResettingPositions").ToString() == "0") { regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey != null) { regKey.SetValue("X", Location.X); regKey.SetValue("Y", Location.Y); regKey.SetValue("H", this.Height); regKey.SetValue("W", this.Width); } } } In form open event: string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey == null) { regKey = Registry.CurrentUser.CreateSubKey(regPath); } if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) { Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); } if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) { this.Height = (int)regKey.GetValue("H"); this.Width = (int)regKey.GetValue("W"); } ---------------------- Original Message: --------------------- From: "jwcolby" To: Subject: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 15:31:33 +0000 > I need a way to store the values in controls as the form closes, such that > the form can the load those last values when it re-opens. I do things like > enter data in controls for server, database, table, paths to files etc. I > need the form to save those values so that the next time the form opens it > can retrieve those values and I don't have to key them in again every time. > > Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a > nubee) web sites? > > TIA, > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From chizotz at mchsi.com Wed Jul 18 11:59:00 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 18 Jul 2007 16:59:00 +0000 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <071820071659.25521.469E46D3000E2673000063B1219791336303010CD2079C080C03BF969B019607080C@mchsi.com> Oops. Copy and paste error in the code I sent. The variable regPath should be the same in both the form open and form close events, and in the code I sent it wasn't. I copied the code out of a form where I do other things with the registry too, and copied the wrong line where the value of regPath is set for the form close event. Sorry. ---------------------- Original Message: --------------------- From: chizotz at mchsi.com (Ron Allen) To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 16:53:46 +0000 > John, > > I know that there is a school of thought that this approach is inappropriate, > but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER > hive so each user has their own set of saved values, which is most often > convenient for me. > > This example stores (in the form close event) the location, height, and width > of the form, and (in the form open event) restores the form to that size and > location. You should be able to easily adapt it for your needs. > > Ron > > > > (all syntax in C#, but should translate easily and well to VB) > > using Microsoft.Win32; //necessary include to get Registry classes > > In form close event: > > /* > If form is maximized, minimized, or larger than > the screen in either dimension, do not save size > and position information > */ > if(this.WindowState != FormWindowState.Maximized && > this.WindowState != FormWindowState.Minimized && > this.Width <= Screen.PrimaryScreen.Bounds.Width && > this.Height <= Screen.PrimaryScreen.Bounds.Height) > { > string regPath = @"Software\Tribune\Circ\CircTools\Settings"; > RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey.GetValue("ResettingPositions").ToString() == "0") > { > regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; > regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey != null) > { > regKey.SetValue("X", Location.X); > regKey.SetValue("Y", Location.Y); > regKey.SetValue("H", this.Height); > regKey.SetValue("W", this.Width); > } > } > } > > In form open event: > > string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; > RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey == null) > { > regKey = Registry.CurrentUser.CreateSubKey(regPath); > } > if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) > { > Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); > } > if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) > { > this.Height = (int)regKey.GetValue("H"); > this.Width = (int)regKey.GetValue("W"); > } From ebarro at verizon.net Wed Jul 18 12:06:11 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 18 Jul 2007 10:06:11 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> Message-ID: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM From cfoust at infostatsystems.com Wed Jul 18 12:05:08 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 18 Jul 2007 10:05:08 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> References: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> Message-ID: The problem with using the registry is that a lot of IT departments are locking it down and require you to use the Documents and Settings folder to store current user stuff. We use XML for this purpose. We'll have an XML file that contains a variable number of elements, which all have a ReadOnly attribute set to False as the default. We use a class to retrieve values from the file and to save values to it. Similar to what we used to do with registry settings. You could have a FormsDefaults.XML file that contains a template element with default settings in it for any form you have saved custom settings for, and then the class could create a new element for each form that had saved settings. Not hard and it doesn't require any api calls to read. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen Sent: Wednesday, July 18, 2007 9:54 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults John, I know that there is a school of thought that this approach is inappropriate, but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER hive so each user has their own set of saved values, which is most often convenient for me. This example stores (in the form close event) the location, height, and width of the form, and (in the form open event) restores the form to that size and location. You should be able to easily adapt it for your needs. Ron (all syntax in C#, but should translate easily and well to VB) using Microsoft.Win32; //necessary include to get Registry classes In form close event: /* If form is maximized, minimized, or larger than the screen in either dimension, do not save size and position information */ if(this.WindowState != FormWindowState.Maximized && this.WindowState != FormWindowState.Minimized && this.Width <= Screen.PrimaryScreen.Bounds.Width && this.Height <= Screen.PrimaryScreen.Bounds.Height) { string regPath = @"Software\Tribune\Circ\CircTools\Settings"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey.GetValue("ResettingPositions").ToString() == "0") { regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey != null) { regKey.SetValue("X", Location.X); regKey.SetValue("Y", Location.Y); regKey.SetValue("H", this.Height); regKey.SetValue("W", this.Width); } } } In form open event: string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey == null) { regKey = Registry.CurrentUser.CreateSubKey(regPath); } if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) { Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); } if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) { this.Height = (int)regKey.GetValue("H"); this.Width = (int)regKey.GetValue("W"); } ---------------------- Original Message: --------------------- From: "jwcolby" To: Subject: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 15:31:33 +0000 > I need a way to store the values in controls as the form closes, such > that the form can the load those last values when it re-opens. I do > things like enter data in controls for server, database, table, paths > to files etc. I need the form to save those values so that the next > time the form opens it can retrieve those values and I don't have to key them in again every time. > > Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE > (to a > nubee) web sites? > > TIA, > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 12:24:04 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 13:24:04 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> Message-ID: <20070718172406.C2962BD32@smtp-auth.no-ip.com> This looks cool! Thanks, John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 18, 2007 1:06 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 12:36:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 13:36:42 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> Message-ID: <20070718173644.36F99BD1F@smtp-auth.no-ip.com> Except that is a c# solution. Sigh. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 18, 2007 1:06 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Wed Jul 18 14:20:04 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 19 Jul 2007 07:20:04 +1200 Subject: [dba-VB] Object Reference not set to an Object error Message-ID: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> I use an add on from DataDynamics called ActiveReports which alows me to produce dot net reports in a similar interface to Access (sort of). I have a connection string defined in my Web.Config file. I want to set the connection string of the report to this when the report is run. I have the following code which is supposed to check whether the report has a connection string already. If the report doesn't have a connection string then I don't want to add a connection string (because there is no data for the report), otherwise I want to replace the connection string with the one in the Web.Config. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToString <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBConnection").ConnectionString End If The problem is with the first line. If there is a connection string then it is replaced. If the report doesn't have a connection string then an error is raised at the first line saying "Object reference not set to an instance of an object". My guess is that this is because no data source is set at all for the report there is no ConnectionString object to compare to. Can anyone please help with the syntax for checking whether the data source object exists (then if it does I can make the replacement to the connectionString). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From ebarro at verizon.net Wed Jul 18 14:41:12 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 18 Jul 2007 12:41:12 -0700 Subject: [dba-VB] Object Reference not set to an Object error In-Reply-To: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <0JLE00D9U40N69W0@vms046.mailsrvcs.net> Use Try...Catch Try ' Statement which can cause an exception. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS tring <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon nection").ConnectionString End If Catch x As Type ' Statements for handling the exception Finally End Try 'Any cleanup code -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Wednesday, July 18, 2007 12:20 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Object Reference not set to an Object error I use an add on from DataDynamics called ActiveReports which alows me to produce dot net reports in a similar interface to Access (sort of). I have a connection string defined in my Web.Config file. I want to set the connection string of the report to this when the report is run. I have the following code which is supposed to check whether the report has a connection string already. If the report doesn't have a connection string then I don't want to add a connection string (because there is no data for the report), otherwise I want to replace the connection string with the one in the Web.Config. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS tring <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon nection").ConnectionString End If The problem is with the first line. If there is a connection string then it is replaced. If the report doesn't have a connection string then an error is raised at the first line saying "Object reference not set to an instance of an object". My guess is that this is because no data source is set at all for the report there is no ConnectionString object to compare to. Can anyone please help with the syntax for checking whether the data source object exists (then if it does I can make the replacement to the connectionString). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM From newsgrps at dalyn.co.nz Wed Jul 18 17:15:04 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 19 Jul 2007 10:15:04 +1200 Subject: [dba-VB] Object Reference not set to an Object error In-Reply-To: <0JLE00D9U40N69W0@vms046.mailsrvcs.net> References: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> <0JLE00D9U40N69W0@vms046.mailsrvcs.net> Message-ID: <20070718221539.HJMD16296.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks Eric, Another topic to digest. David At 19/07/2007, you wrote: >Use Try...Catch > >Try > ' Statement which can cause an exception. > If CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS >tring <> "" Then > CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = >System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon >nection").ConnectionString > End If > >Catch x As Type > ' Statements for handling the exception >Finally > >End Try 'Any cleanup code > > > >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson >Sent: Wednesday, July 18, 2007 12:20 PM >To: dba-vb at databaseadvisors.com >Subject: [dba-VB] Object Reference not set to an Object error > >I use an add on from DataDynamics called ActiveReports which alows me to >produce dot net reports in a similar interface to Access (sort of). > >I have a connection string defined in my Web.Config file. I want to set the >connection string of the report to this when the report is run. I have the >following code which is supposed to check whether the report has a >connection string already. If the report doesn't have a connection string >then I don't want to add a connection string (because there is no data for >the report), otherwise I want to replace the connection string with the one >in the Web.Config. > >If CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS >tring ><> "" Then > CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString >= >System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon >nection").ConnectionString >End If > >The problem is with the first line. If there is a connection string then it >is replaced. If the report doesn't have a connection string then an error >is raised at the first line saying "Object reference not set to an instance >of an object". My guess is that this is because no data source is set at >all for the report there is no ConnectionString object to compare to. > >Can anyone please help with the syntax for checking whether the data source >object exists (then if it does I can make the replacement to the >connectionString). > > >Regards > >David Emerson >Dalyn Software Ltd >Wellington, New Zealand >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > >No virus found in this incoming message. >Checked by AVG Free Edition. >Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 >6:30 PM > > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com From shamil at users.mns.ru Wed Jul 18 20:34:44 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Thu, 19 Jul 2007 05:34:44 +0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> Message-ID: <000601c7c9a4$fc3d16f0$6401a8c0@nant> Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 7:28 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 20:57:38 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 21:57:38 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <000601c7c9a4$fc3d16f0$6401a8c0@nant> Message-ID: <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> Shamil, Funny you should mention that. I was working on just such a class earlier this afternoon - from a book called Beginning Visual Basic .NET from Wrox. That book does not mention binding the form to the class though. It actually reads / writes the values out of the controls. I like the "binding" idea. Now all I have to do is figure out how to do that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, July 18, 2007 9:35 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil From jwcolby at colbyconsulting.com Thu Jul 19 09:59:47 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 10:59:47 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> I operate under Option Strict. I have a situation where I am trying to use code from a book. That code assigns an object type to a class, i.e. Dim lcls as clsSomething = SerializeData(... SerializeData returns an object. How do I cast Serialize data to return a type clsSomething so that I don't get the "option strict disallows..." error message? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Thu Jul 19 10:09:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 08:09:03 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> References: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> Message-ID: That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:00 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion I operate under Option Strict. I have a situation where I am trying to use code from a book. That code assigns an object type to a class, i.e. Dim lcls as clsSomething = SerializeData(... SerializeData returns an object. How do I cast Serialize data to return a type clsSomething so that I don't get the "option strict disallows..." error message? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 10:27:01 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 08:27:01 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> References: <000601c7c9a4$fc3d16f0$6401a8c0@nant> <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> Message-ID: The specific "how" is use the databindings properties of the form. Typed Datasets are the easiest to work with because even in design time, they know what the properties of their source is--fields, data types, etc. We normally create a class for each typed dataset, give it whatever business rules we want to enforce at the data level, and drag the class form the toolbox onto the form or user control. That creates the binding to the form and you can then control the binding to the controls in design view or through code. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 6:58 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Shamil, Funny you should mention that. I was working on just such a class earlier this afternoon - from a book called Beginning Visual Basic .NET from Wrox. That book does not mention binding the form to the class though. It actually reads / writes the values out of the controls. I like the "binding" idea. Now all I have to do is figure out how to do that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, July 18, 2007 9:35 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 10:48:41 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 11:48:41 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719154843.48102BF92@smtp-auth.no-ip.com> I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 11:13:19 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:13:19 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719154843.48102BF92@smtp-auth.no-ip.com> References: <20070719154843.48102BF92@smtp-auth.no-ip.com> Message-ID: John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 11:24:07 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 12:24:07 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 11:44:05 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 18:44:05 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 11:47:46 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:47:46 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> References: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> Message-ID: We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 cfoust at infostatsystems.com Thu Jul 19 11:49:07 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:49:07 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 12:02:43 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 19:02:43 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte So true. Nothing beats experience. Seems like while some of us overwhelmed are fooling around, you just do it. /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:49 >>> Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 12:06:16 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:06:16 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte So true. Nothing beats experience. Seems like while some of us overwhelmed are fooling around, you just do it. /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:49 >>> Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 12:18:38 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 19:18:38 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte You retire? Give me one good reason for that. /gustav >>> cfoust at infostatsystems.com 19-07-2007 19:06 >>> I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte From cfoust at infostatsystems.com Thu Jul 19 12:30:25 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:30:25 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: Hmmn. Death? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 10:19 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte You retire? Give me one good reason for that. /gustav >>> cfoust at infostatsystems.com 19-07-2007 19:06 >>> I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 12:35:38 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 13:35:38 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Well, I'm (slowly) learning how to do it. Unfortunately because I work alone it is tough to get the "doing it right" part. If I do it wrong there is no one looking over my shoulder telling me to "do it this way". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 mmattys at rochester.rr.com Thu Jul 19 12:45:47 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Thu, 19 Jul 2007 13:45:47 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion References: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Message-ID: <010a01c7ca2c$a560e130$0202a8c0@Laptop> Ooh! Ooh Ooh! I'll do it! - Horshack from 'Welcome Back, Kotter" Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" To: Sent: Thursday, July 19, 2007 1:35 PM Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > Well, I'm (slowly) learning how to do it. Unfortunately because I work > alone it is tough to get the "doing it right" part. If I do it wrong > there > is no one looking over my shoulder telling me to "do it this way". > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 12:48 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > We're LEARNING how to do it right OJT! LOL Our senior developer was the > only one who had any previous experience with .Net and we've blown past > the > firm we hired to advise us at the start of the project. And yes, it's > been > a lot of fun being in it from the ground up. > > Charlotte > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, July 19, 2007 9:24 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > Boy I must say you lucked out getting that job. I would die for an > opportunity to learn VB.Net OJT AND though a company that apparently > really > knows how to do it right! > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 12:13 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > John, > > We use typed datasets to handle the serialization. Then we can work with > the typed dataset in design view as if it were a real table. We do NOT > hand > build that code! It was easy to generate typed datasets in > 2003 but I keep forgetting how in 2005. It is well worth exploring though > for the work it saves. > >>>I was just about to ask about binding this to a form when your next > email came in. The only question I have is, is it possible to bind to a > class where the open event of the form itself is going to load the data > into > the class? It seems kinda "cart before the horse". > > What you do is bind to the class, which has no data in it at that point. > You have a setup routine in the form that either accepts a dataset or > fills > the one it already has. That's the advantage to working with the indirect > links offered by typed datasets and wrapper classes. We create various > Get > and Fill methods (Get returns a filled instance of the class object, Fill > populates a passed in instance) to accept parameters and populate the > class > with the data requested. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, July 19, 2007 8:49 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > I used DirectCast. And it all works. AMAZING!!! > > Charlotte, you probably use this all of the time. The example code builds > a > "serializable class" with functions that do the serialization in / out to > a > data stream, and functions that get a stream from / to a file. Then you > build a properties class that inherits the serializable class, which class > then allows you to define your properties. Since the properties class > inherits the code to serialize itself, it can do so without further adoo. > > I then use that in my form to store the control data into a properties > class > instance and can now store that out to an xml file using the .net > serializable stuff embedded in the inherited "serializable class". > Likewise retrieve it later. > > I have to say that the dim statement to do the restore is a mess though! > > To save: > Dim lclsIOData As New clsIOData > PopulateIODataFromForm(lclsIOData) > Dim strFileName As String = lclsIOData.mDataFileName("FormData") > lclsIOData.mSave(strFileName) > > To restore: > Dim lclsIOData As clsIOData > lclsIOData = > DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), > GetType(clsIOData)), clsIOData) > mPopulateFormFromIOData(lclsIOData) > > It is really a reasonably small amount of code setting up the serializable > class, but once done, any data class can be serialized to xml. From what > I > can understand I could also serialize it to a table if I wanted to simply > by > having another function that opened a stream to / from a table instead of > a > file. I will leave that for another day. > > Cool stuff. > > I was just about to ask about binding this to a form when your next email > came in. The only question I have is, is it possible to bind to a class > where the open event of the form itself is going to load the data into the > class? It seems kinda "cart before the horse". > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 11:09 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > That's one problem I always have with the books too, they tend to use a > lot > of implicit conversion. Of course, you learn a lot from making the > examples > work with option strict on. There are various ways to do it, John. You > can > use a Ctype() function to convert the object to a clsSomething like this: > Ctype(SerializeData(....), clsSomething). You can also use a DirectCast > function. > > Charlotte Foust > > > _______________________________________________ > 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 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 12:49:44 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:49:44 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> References: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Message-ID: Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 10:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, I'm (slowly) learning how to do it. Unfortunately because I work alone it is tough to get the "doing it right" part. If I do it wrong there is no one looking over my shoulder telling me to "do it this way". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 13:42:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 14:42:05 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte From cfoust at infostatsystems.com Thu Jul 19 14:01:11 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:01:11 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> References: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> Message-ID: >>It has to be easy. ROTFL There's your problem, right there!! Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 14:07:26 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:07:26 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> References: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> Message-ID: Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 14:10:04 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 21:10:04 +0200 Subject: [dba-VB] How I'm approaching the problem Message-ID: Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. From jwcolby at colbyconsulting.com Thu Jul 19 14:31:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:31:56 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719193157.E3430BD48@smtp-auth.no-ip.com> I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 14:33:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:33:25 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719193327.7EDFBBD43@smtp-auth.no-ip.com> I have found code to do that. How it works I haven't a clue but once I get it working I will show what it is. In my case it has to be local. Servers out on the internet are not usable in my business. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 3:10 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 14:36:34 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:36:34 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719193157.E3430BD48@smtp-auth.no-ip.com> References: <20070719193157.E3430BD48@smtp-auth.no-ip.com> Message-ID: Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 ebarro at verizon.net Thu Jul 19 14:49:04 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 19 Jul 2007 12:49:04 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719193327.7EDFBBD43@smtp-auth.no-ip.com> Message-ID: <0JLF00LV0Z1B32Y4@vms042.mailsrvcs.net> I have code that can query a database for its tables and the fields in those tables (SQL server-specific). -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:33 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I have found code to do that. How it works I haven't a clue but once I get it working I will show what it is. In my case it has to be local. Servers out on the internet are not usable in my business. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 3:10 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. _______________________________________________ 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.9/907 - Release Date: 7/18/2007 3:30 PM From jwcolby at colbyconsulting.com Thu Jul 19 14:56:01 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:56:01 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719195607.4216ABC02@smtp-auth.no-ip.com> >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 cfoust at infostatsystems.com Thu Jul 19 15:04:14 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 13:04:14 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719195607.4216ABC02@smtp-auth.no-ip.com> References: <20070719195607.4216ABC02@smtp-auth.no-ip.com> Message-ID: I see. You had mentioned that before but I forgot (blame my age LOL). I know about that kind of list from bitter experience, although the biggest ones I ever had to import were less than 100K names per list. But I also didn't have the benefits of .Net and had to work strictly in Access 97, which didn't make it fun. I still don't see the need to import the data into a database immediately when you could manipulate them in xml form until you got them the way you wanted and THEN import the data once and for all. You could park the rejects in another database for reference. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 16:02:26 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 17:02:26 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719210229.D676BBE9C@smtp-auth.no-ip.com> My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 4:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I see. You had mentioned that before but I forgot (blame my age LOL). I know about that kind of list from bitter experience, although the biggest ones I ever had to import were less than 100K names per list. But I also didn't have the benefits of .Net and had to work strictly in Access 97, which didn't make it fun. I still don't see the need to import the data into a database immediately when you could manipulate them in xml form until you got them the way you wanted and THEN import the data once and for all. You could park the rejects in another database for reference. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 _______________________________________________ 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 Jul 21 21:14:25 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 21 Jul 2007 19:14:25 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719210229.D676BBE9C@smtp-auth.no-ip.com> Message-ID: <0JLK002Q05ZSBFE4@l-daemon> Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. From jwcolby at colbyconsulting.com Sat Jul 21 23:51:17 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 00:51:17 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLK002Q05ZSBFE4@l-daemon> Message-ID: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. From pcs at azizaz.com Sun Jul 22 02:24:37 2007 From: pcs at azizaz.com (Borge Hansen) Date: Sun, 22 Jul 2007 17:24:37 +1000 Subject: [dba-VB] Address Processing References: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> Message-ID: <036401c7cc31$5cbad380$fa10a8c0@Albatross> Hi John, I've been following your threads on the subject of your SQL Server system on and off, the latest being: Subject: Re: [dba-VB] How I'm approaching the problem Where you wrote: "...The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity...." I am curious as to what your address processing entails...if you have been writing on this previously I missed it... Does the address processing entail returning geocode on the address? I am currently using Google's MAP API to process addresses and having them returned with a geocode including degree of accurary (street, suburb or zip).... I am using some javascript picked up somewhere on the internet.... The javascript uses a webpage textcontrol as the input for address processing (I copy and paste about 1,000 address records from an access table into the textcontrol), and outputs the data records returned from Google as tab delimited lines of text to another text control on the same webpage. So I can process about a 1,000 addresses at a time... but at present I have to manually copy and paste the processed addresses from the text control into a say Access table.... What I am after is code that allows me to use a table (Access or SQL) as input and another table for inserting the processed addresses.... Is this something you are doing? Anyone else who can help out here? Regards, Borge Hansen From jwcolby at colbyconsulting.com Sun Jul 22 11:07:17 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 12:07:17 -0400 Subject: [dba-VB] Address Processing In-Reply-To: <036401c7cc31$5cbad380$fa10a8c0@Albatross> Message-ID: <20070722160723.D36EFBD05@smtp-auth.no-ip.com> This business is about bulk mail addresses. My client buys lists of addresses from other list providers. Each list is basically a "poll" that someone answered or something similar. A million people filled out warranty cards when they bought a car, or filled out an online form when they visited a web site, or... Somehow they got their name on a list, but more importantly they gave other important information about themselves such as brands of tobacco used, soft drinks consumed, electronics purchased etc. It is really THAT information that is important about the person, because my client sells these names to advertisers targeting people who have dogs or cats (a dog / cat food mailing) or bought a certain brand of car 4 years ago (a dealership mailing). So... I get lists of names / addresses, with "demographics" information included. I pull the lists in to SQL Server. Why? Because my client then comes back to me and says "give me 100K names in these zips who purchased laundry detergent". So I have to have the info in SQL Server in order to do the where clauses on zips and demographics fields. As soon as I import the table, I immediately export the data back out for "address cleaning". These lists average about 20% "trash", addresses where the address was misspelled, no zip was given, or a completely fake address was supplied etc. So I export my own PKID, the name and address out to CSV files, up to 1 million records at a time. I send those addresses through a program that verifies the addresses. The first process is called CASS, which simply verifies that the address "matches" an address template. A second process (run at the same time, subsequent to CASS is called DPV which stands for delivery point validation. IOW, yea, it matches a template, but can it actually be delivered. The USPS provides databases of every valid address in the United States, and the addresses are run through this database to see if it is a "real address" (DPV) as opposed just "looks like a real address" (CASS). And finally, the address is then processed for NCOA or National Change of Address. That is a database (USPS) that says "yea, that person USED TO LIVE THERE but moved". So it is obvious why I do the processing. However I also need to re-process the data periodically in order to catch the moves. If John Colby moves from Connecticut to North Carolina, I want to discover that and stop sending mail to him in Connecticut and start sending it to him in NC. So every so often (monthly?) I will export the name / address back out and run it through the process again. CASS and DPV (theoretically) will get a 100% hit rate now because I already did that last time, but NCOA will catch a certain % of the people who moved. I use a dedicated program for doing this. There are too many variables for me to even consider "reinventing the wheel". These professional programs perform such functions as splitting names and addresses, standardizing abbreviations such as ST or ST. for Street etc. Those standardizing processes are required to get a hit on an address in the USPS database. If you are doing a few hundred names for your church or for some charity organization, you can visually scan the "fallout" data to see if you can pick up errors, but when processing 90 million names I never even look at the data, I just can't do that. So this professionally designed program handles a bunch of stuff in order to prepare the data for validation, performs the validation, and hands me back my PKID, name and address fields, plus about 40 other fields that tell me things about the data itself (political district, area code, etc) as well as data about why the data failed to validate in case I want to do processing on the rejects (I don't). In any event, this is not just a one shot deal. I pull the RAW data in, add a PK, Export the name / address, process that, import the resulting cleaned address data back into a DIFFERENT table, but related to the RAW data by my PK that I assigned to the raw data. Periodically I re-export / import for NCOA processing. Now when the client asks for 1 million names of people who own dogs I go to the table they tell me to, join the raw data to the address data, apply where clauses (zip to the cleaned address, demographics to the raw data), and pull the names and addresses out and export them for shipping to the purchaser of the names. We can tell the client that the data was last cleaned "X weeks ago" so that they know they are not spending money to send mail to bad addresses. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Sunday, July 22, 2007 3:25 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Address Processing Hi John, I've been following your threads on the subject of your SQL Server system on and off, the latest being: Subject: Re: [dba-VB] How I'm approaching the problem Where you wrote: "...The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity...." I am curious as to what your address processing entails...if you have been writing on this previously I missed it... Does the address processing entail returning geocode on the address? I am currently using Google's MAP API to process addresses and having them returned with a geocode including degree of accurary (street, suburb or zip).... I am using some javascript picked up somewhere on the internet.... The javascript uses a webpage textcontrol as the input for address processing (I copy and paste about 1,000 address records from an access table into the textcontrol), and outputs the data records returned from Google as tab delimited lines of text to another text control on the same webpage. So I can process about a 1,000 addresses at a time... but at present I have to manually copy and paste the processed addresses from the text control into a say Access table.... What I am after is code that allows me to use a table (Access or SQL) as input and another table for inserting the processed addresses.... Is this something you are doing? Anyone else who can help out here? Regards, Borge Hansen _______________________________________________ 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 Sun Jul 22 17:41:33 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 22 Jul 2007 15:41:33 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> Message-ID: <0JLL0046YQSWLTW1@l-daemon> Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 22 20:53:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 21:53:57 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLL0046YQSWLTW1@l-daemon> Message-ID: <20070723015404.F2E3ABCDF@smtp-auth.no-ip.com> ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 6:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try | to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ 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 Sun Jul 22 22:01:21 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 22 Jul 2007 20:01:21 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723015404.F2E3ABCDF@smtp-auth.no-ip.com> Message-ID: <0JLM00G2W2TVP6K5@l-daemon> Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 22, 2007 6:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 6:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try | to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 23 07:22:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 08:22:28 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLM00G2W2TVP6K5@l-daemon> Message-ID: <20070723122237.42363BE4A@smtp-auth.no-ip.com> Jim, Throw in the fact that I have to get real work done (process data for the client) and it really gets fun. That is why I have been working from the bottom up, getting those pieces written that allow me to actually process the lists, even if I have to manually run them from the click of a button, with hard coded constants for the parameters. It is good that I finally have a real paying project that requires SQL Server and VB.Net. Yea, having to learn them under the gun is stressful, but I have not succeeded in learning them in the past because I just didn't NEED them and I had too much other stuff to do to spend the hundreds of hours required to figure them out. Now I NEED them. I'll tell you, I really love VB.NET. As a dev language / environment it has everything that I want. That was not true before 2.0, but with the latest version it is complete enough to really do what I need. Yes, it is 10 times more complex than anything I have previously encountered, but a lot of the reason is that it provides so much more "out of the box". I am a class kind of guy and a programmer at heart, and this is very much my dream environment. It is just a matter of learning it well. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 11:01 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 22, 2007 6:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting From shamil at users.mns.ru Mon Jul 23 12:24:41 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Mon, 23 Jul 2007 21:24:41 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLM00G2W2TVP6K5@l-daemon> Message-ID: <000001c7cd4e$5ab9fcf0$6401a8c0@nant> All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> From jwcolby at colbyconsulting.com Mon Jul 23 12:37:33 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 13:37:33 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000001c7cd4e$5ab9fcf0$6401a8c0@nant> Message-ID: <20070723173742.D9657C1B3@smtp-auth.no-ip.com> Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Mon Jul 23 14:57:01 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Mon, 23 Jul 2007 23:57:01 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723173742.D9657C1B3@smtp-auth.no-ip.com> Message-ID: <001101c7cd63$a3ae3d30$6401a8c0@nant> <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 23 15:17:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 16:17:15 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070723201724.4F8A7BEC5@smtp-auth.no-ip.com> Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Tue Jul 24 02:12:21 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 11:12:21 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723201724.4F8A7BEC5@smtp-auth.no-ip.com> Message-ID: <000a01c7cdc1$fb01f460$6401a8c0@nant> Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 08:52:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 09:52:59 -0400 Subject: [dba-VB] VB.Net Message-ID: <20070724135310.20ABDBC8E@smtp-auth.no-ip.com> I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com From James at fcidms.com Tue Jul 24 09:05:45 2007 From: James at fcidms.com (James Barash) Date: Tue, 24 Jul 2007 10:05:45 -0400 Subject: [dba-VB] VB.Net In-Reply-To: <20070724135310.20ABDBC8E@smtp-auth.no-ip.com> Message-ID: <005f01c7cdfb$baf45a90$800101df@fci.local> John: You want: DateTime.Now.ToString("yyyyMMdd-hhmmss") James Barash -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 9:53 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 09:26:20 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 10:26:20 -0400 Subject: [dba-VB] VB.Net In-Reply-To: <005f01c7cdfb$baf45a90$800101df@fci.local> Message-ID: <20070724142630.E5045BC93@smtp-auth.no-ip.com> Thanks James. It turns out that I was mixing up the CASE of the characters and ending up with totally weird formatted strings as you might imagine. Once I found the help for the format for dates and used the correct characters, in the correct case (upper / lower) then it started working just fine. Thanks again for the response. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of James Barash Sent: Tuesday, July 24, 2007 10:06 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net John: You want: DateTime.Now.ToString("yyyyMMdd-hhmmss") James Barash -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 9:53 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 10:02:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 11:02:25 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000a01c7cdc1$fb01f460$6401a8c0@nant> Message-ID: <20070724150235.C5CE4BD9E@smtp-auth.no-ip.com> Shamil, >Would that have any (economical) sense for your customer to improve DB bulk loading time? I don't understand the context - would what have any economical sense? >Why you do not use 64 bit .Net Framework to run your code on the server side? My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. First, I am a one man show with a month by month budget. Second, In order to get maximum bang for my hard earned dollar I build my own systems. I was talking to the owner of the company that does my address validation and they just spend $25,000 for a DELL server with 32 megs of data and windows 2003 x64. I don't have that kind of money. When you buy a DELL (as an example) then getting Windows x64 to install is a simple click of the button on the order page. Getting windows x64 to install on a desktop is not so simple, with issues for ALL of the drivers from video, network, disk etc. When I built the workstations I use to run SQL Server I did not understand the size of the task; Now I do. I will be building a new server this fall with a server motherboard, designed and certified to run the X64 versions of windows, with drivers supplied etc. It will be a dual processor / 8 core machine which will contain 32 megs or ram to start, 64 megs eventually. I MAY be able to get Windows 2003 x64 to run on the current servers, and if I can then I will but I am not holding my breath. Even if I can, they max out at 8 megs of ram that they can address so they will still be underpowered for my purpose. >Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? I am still working through that. The third party lib, DataStreams from www.csvreader.com Has a set of objects (readers) which can read and write streams to and from files. The docs are complete but the examples are sparse! However the author is available on his forums to answer questions and generally responds within a few hours. Basically what happens is that you instantiate one of the reader objects, tell the object what data type each column will be and then pass in a stream from that object to the SQLBulkCopy object. The DataStreams reader object handles all of the opening of the file, parsing the CSV file into an array and writing the array data into the stream. It appears to handle chunks of data so that the entire file does not have to fit into memory at once. With a CSV file, typically there is a header line in the first row. DataStreams reads that in and does the mapping for you if that row exists. He also has methods for obtaining the collection of field names etc, so I am actually building code to automatically build a table in SQL Server based on the names in the field names collection, plus a PK column of my own (long autoincrement) out at the end. His code correctly feeds the data into the table IF the columns from the file are the first columns, i.e. the PK is at the end of the table, but does not correctly handle the data feed if the PK is the first field in the table (and there is no PK field in the data). Remember that I have two distinct cases. 1) Data (lists) from vendors. These may have some "PK" of their own, but I do not know what it is or whether there will be one (typically not) so I just routinely build my own. 2) Data that I export from SQL Server, process, and get back from the address validation software. Those CSVs already have a PKID because my source tables have one and I export that PKID into the CSV file when I do the export from SQL Server. Given the costs of the lib, I am very impressed with the implementation so far. He provides a record event to allow preprocessing data within each record being read before sending it off to the SQLBulkCopy. You can do anything you might imagine with such control - look for specific data values in a given field, skip the record based on such evaluations, modify the data in specific fields etc, all on-the-fly as the data moves from CSV to SQL Server. I believe it also handles fixed width files which is also on my plate. So basically I just outsourced one small but complex part of the project. It was easy to get working and seems pretty fast so I am happy with the results so far. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:05:18 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:05:18 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724160529.0F54FBD8E@smtp-auth.no-ip.com> Shamil, I have started logging the imports now so I can tell you the times to import (in time / tick counts) as soon as I do a bunch, which will be today. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:10:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:10:37 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724161047.DA2F0BC81@smtp-auth.no-ip.com> One issue I am running into is that I really want to be able to log the start / stop PKID of each record imported. I use an autoincrement in SQL Server, but I do not know how to get at the last PKID in these values "live" as the SQLBulkInsert runs. Is it possible to pull the value of a field back out of the SQLBulkInsert object? Do I have to execute a sql statement to "get" the value of the PKID of the last record before the import and the last record after the import? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com From Gustav at cactus.dk Tue Jul 24 11:12:45 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 24 Jul 2007 18:12:45 +0200 Subject: [dba-VB] How I'm approaching the problem Message-ID: Hi John Don't you subscribe to the Action Pack? The July update includes DVDs with Windows Vista Business 64 bit Windows Server 2003 R2 64 bit Windows Server 2008 Enterprise 64 bit Beta 3 That's not a running server, I know, but an important part ... /gustav >>> jwcolby at colbyconsulting.com 24-07-2007 17:02 >>> My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. From jwcolby at colbyconsulting.com Tue Jul 24 12:35:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 13:35:56 -0400 Subject: [dba-VB] The command object exception Message-ID: <20070724173606.D7354BCD1@smtp-auth.no-ip.com> I am trying to execute queries that build databases, build tables etc. When I executed the ExecuteNonQuery method with a query that built a database and the database already exists, I got an error returned of -2147217900. When I tried to execute a sql statement with a general error I got the same error returned. How do I get meaningful error codes back from ExecuteNonQuery? Try mobjCmd.ExecuteNonQuery() Catch ex As OleDbException Select Case ex.ErrorCode Case -2147217900 'database already exists so ignore the error Case Else MessageBox.Show(ex.Message) Return -3 End Select End Try John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 24 14:32:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 15:32:57 -0400 Subject: [dba-VB] Count of specific character Message-ID: <20070724193307.C3D38BE7E@smtp-auth.no-ip.com> Is there any single function that will return a count of a specific character in a string? I have a situation where (apparently) the header of a CSV file has the same field name twice. I am trying to determine what is going on, so I want to count the field separator characters in the header and the first line of real data to see if there are more fields in the header than in the data or if something else is going on. John W. Colby Colby Consulting www.ColbyConsulting.com From shamil at users.mns.ru Tue Jul 24 14:37:04 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 23:37:04 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070724150235.C5CE4BD9E@smtp-auth.no-ip.com> Message-ID: <000001c7ce2a$03a5e320$6401a8c0@nant> Hello John, <<< I don't understand the context - would what have any economical sense? >>> I meant does your customer need to make bulk loading any faster or not? You know one may fly Paris - NY using ordinary Boeing planes, one can use (in the past) Concord or even TU-144(!?) (http://en.wikipedia.org/wiki/Tupolev_Tu-144) - IOW does your customer still need Concord for their task or current very good Boeing solution is good enough for them now and for a long time in the future? I also mean we can try to find what is (if any) bottleneck of the current solution and "break" this bottleneck? Some tests (Dual Core 3MHz, 2GB, W2003 Server, simple IDE/SATA 7400rpm HDD) - the raw performance of reading a delimited by TAB char CSV file in .NET: Total Counter = 1011852 (1 million...) ElapsedTime = 3,359375 seconds ElapsedTime = 0,0559895833333333 minutes Total Counter = 10006092 (10 million...) ElapsedTime = 32,890625 seconds ElapsedTime = 0,548177083333333 minutes Total Counter = 100010952 (100 million...) ElapsedTime = 327,875 seconds ElapsedTime = 5,46458333333333 minutes Splitting of CSV file lines into array added... Total Counter = 1011852 (1 million...) ElapsedTime = 8,375 seconds ElapsedTime = 0,139583333333333 minutes ... (I didn't have time to test other cases of 10 and 100 million source file lines - please do if you have time...) Of course that is just reading the file - the open question is how closely this extreme files reading performance can be approached when such a file is bulk loaded into MS SQL Database? Join, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... I must say I'm very interested to return here next week, sorry for any inconvenience... -- Shamil P.S. Simple C# code used for testing (watch line wraps): using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long MAX_LIMIT = 1000000; // 00; string s = @"F:\Temp\XL\ConsoleApplication1\IN\testfile.txt"; long totalCounter = 0; long lineCounter = 0; DateTime startTime = DateTime.Now; while (totalCounter < MAX_LIMIT) { System.IO.TextReader rdr = new System.IO.StreamReader(s); lineCounter = 0; string inline = ""; char delimiter = (char)9; while ((inline = rdr.ReadLine())!=null) { string[] fields = inline.Split(delimiter); ++totalCounter; ++lineCounter; } rdr.Close(); } DateTime endTime = DateTime.Now ; TimeSpan elapsedTime = endTime - startTime; Console.WriteLine("File Line Counter = {0}", lineCounter.ToString()); Console.WriteLine("Total Counter = {0}", totalCounter.ToString()); Console.WriteLine("ElapsedTime = {0} seconds", elapsedTime.TotalSeconds.ToString()); Console.WriteLine("ElapsedTime = {0} minutes", elapsedTime.TotalMinutes.ToString()); } } } -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 7:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, >Would that have any (economical) sense for your customer to improve DB bulk loading time? I don't understand the context - would what have any economical sense? >Why you do not use 64 bit .Net Framework to run your code on the server side? My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. First, I am a one man show with a month by month budget. Second, In order to get maximum bang for my hard earned dollar I build my own systems. I was talking to the owner of the company that does my address validation and they just spend $25,000 for a DELL server with 32 megs of data and windows 2003 x64. I don't have that kind of money. When you buy a DELL (as an example) then getting Windows x64 to install is a simple click of the button on the order page. Getting windows x64 to install on a desktop is not so simple, with issues for ALL of the drivers from video, network, disk etc. When I built the workstations I use to run SQL Server I did not understand the size of the task; Now I do. I will be building a new server this fall with a server motherboard, designed and certified to run the X64 versions of windows, with drivers supplied etc. It will be a dual processor / 8 core machine which will contain 32 megs or ram to start, 64 megs eventually. I MAY be able to get Windows 2003 x64 to run on the current servers, and if I can then I will but I am not holding my breath. Even if I can, they max out at 8 megs of ram that they can address so they will still be underpowered for my purpose. >Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? I am still working through that. The third party lib, DataStreams from www.csvreader.com Has a set of objects (readers) which can read and write streams to and from files. The docs are complete but the examples are sparse! However the author is available on his forums to answer questions and generally responds within a few hours. Basically what happens is that you instantiate one of the reader objects, tell the object what data type each column will be and then pass in a stream from that object to the SQLBulkCopy object. The DataStreams reader object handles all of the opening of the file, parsing the CSV file into an array and writing the array data into the stream. It appears to handle chunks of data so that the entire file does not have to fit into memory at once. With a CSV file, typically there is a header line in the first row. DataStreams reads that in and does the mapping for you if that row exists. He also has methods for obtaining the collection of field names etc, so I am actually building code to automatically build a table in SQL Server based on the names in the field names collection, plus a PK column of my own (long autoincrement) out at the end. His code correctly feeds the data into the table IF the columns from the file are the first columns, i.e. the PK is at the end of the table, but does not correctly handle the data feed if the PK is the first field in the table (and there is no PK field in the data). Remember that I have two distinct cases. 1) Data (lists) from vendors. These may have some "PK" of their own, but I do not know what it is or whether there will be one (typically not) so I just routinely build my own. 2) Data that I export from SQL Server, process, and get back from the address validation software. Those CSVs already have a PKID because my source tables have one and I export that PKID into the CSV file when I do the export from SQL Server. Given the costs of the lib, I am very impressed with the implementation so far. He provides a record event to allow preprocessing data within each record being read before sending it off to the SQLBulkCopy. You can do anything you might imagine with such control - look for specific data values in a given field, skip the record based on such evaluations, modify the data in specific fields etc, all on-the-fly as the data moves from CSV to SQL Server. I believe it also handles fixed width files which is also on my plate. So basically I just outsourced one small but complex part of the project. It was easy to get working and seems pretty fast so I am happy with the results so far. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Tue Jul 24 14:54:44 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 23:54:44 +0400 Subject: [dba-VB] Count of specific character In-Reply-To: <20070724193307.C3D38BE7E@smtp-auth.no-ip.com> Message-ID: <000101c7ce2c$7b5ace60$6401a8c0@nant> Hello John, You can use System.Text.RegularExpressions (see for details in MSDN) - here is a C# sample: // count 'a' char occurrences string testString = "One car red car blue car"; MatchCollection matches = Regex.Matches(testString, "[a]"); Console.WriteLine(matches.Count.ToString()); Please take into account that Regex is not "lightning fast" - I mean experts do not recommend to rely on its speed to investigate/parse large amounts of text data in short time... If time is not an issue then Regex can do in a few (one!?) line of code many things, which manually written will take many more code lines. Although as I noted above manually written custom code could be (much) quicker than Regex to "pump through" large amounts of text data... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 11:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Count of specific character Is there any single function that will return a count of a specific character in a string? I have a situation where (apparently) the header of a CSV file has the same field name twice. I am trying to determine what is going on, so I want to count the field separator characters in the header and the first line of real data to see if there are more fields in the header than in the data or if something else is going on. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 15:29:16 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 16:29:16 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000001c7ce2a$03a5e320$6401a8c0@nant> Message-ID: <20070724202926.DD477BD76@smtp-auth.no-ip.com> Shamil, >John, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... Understood, I will answer so that it will be available for when you are back. >I meant does your customer need to make bulk loading any faster or not? The short answer is yes. The long answer is really that I did not buy the library to make the speed faster, I bought it to make the implementation (coding) faster by not having to handle this part myself. However to answer your question directly, I am moving to a model where I charge the client for each operation, i.e. for computer time. IOW, in each process that imports or exports data, the amount of time required to perform that process is logged, and will (eventually) be directly entered into a billing program. So the client will be billed for X hours of computer time, where A hours are used for import of raw data lists, B hours are used for address export, C hours are used for address validation (by a different server in my office), D hours are used to import the data back into the SQL Server database, etc. I will not be breaking the time down on the bill, I envision billing line items like $XXX for address import of raw data list XYZ $YYY for address validation of list QRS Etc. With luck (and hard work), someday soon these processes will run totally automatically, with no manual input from me. Thus I will be essentially charging for "process", not my personal time. This billing method allows the client to understand the overall costs. But by logging the actual times required for doing each part I can understand where my bottlenecks are, plan for upgrades to handle my requirements etc. So the faster it works the less I make and the more the client saves. 8-( Alternatively, the faster it runs the more lists I can run on a given machine in a given period of time. 8-) I am really trying to sell the customer on how efficient it is (vs. his old method) to import his lists, and then export / address validate / reimport them. The client does not understand the mechanics behind the process, nor does he want to or care to. What he does understand is that it used to cost him (literally) $1.25 / thousand names to get addresses validated. I can do it for $.12 / thousand names, or about 1/10th his previous cost. Not only can I do it for that, I can make a killing doing it at that cost, IF I can move the frequency up to once per month or even every three months. The lists have to be reprocessed every X time units, perhaps monthly, perhaps quarterly. Again, by being able to demonstrate efficiency, I can convince the client that is cost effective to use my service, and also cost effective to perform this service monthly instead of waiting every six months or every year. He gets to sell his business by marketing "addresses cleaned monthly", and believe me that is important to his client. I doubt he will drop his cost to pass on the cost savings so he ends up making more / thousand names since he is now paying way less to do that process. His previous provider was so expensive that he literally did the address validation on each order and passed the cost through. I want a business model where he can afford (and he CAN!) to do this process monthly on each of his lists. Thus I get an income stream that I can depend on, and I get a process that does not cost me MY TIME, but rather sells the client my computer's time. "More work, more / faster computers" instead of "more work, more of MY TIME". I want to be sitting on the beach while my computers are earning me money. So yea, it always pays to do something faster, whether in my ability to make more money on each hour of machine time, or my ability to be more efficient and sell that to the client and get more work. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, <<< I don't understand the context - would what have any economical sense? >>> I meant does your customer need to make bulk loading any faster or not? You know one may fly Paris - NY using ordinary Boeing planes, one can use (in the past) Concord or even TU-144(!?) (http://en.wikipedia.org/wiki/Tupolev_Tu-144) - IOW does your customer still need Concord for their task or current very good Boeing solution is good enough for them now and for a long time in the future? I also mean we can try to find what is (if any) bottleneck of the current solution and "break" this bottleneck? Some tests (Dual Core 3MHz, 2GB, W2003 Server, simple IDE/SATA 7400rpm HDD) - the raw performance of reading a delimited by TAB char CSV file in .NET: Total Counter = 1011852 (1 million...) ElapsedTime = 3,359375 seconds ElapsedTime = 0,0559895833333333 minutes Total Counter = 10006092 (10 million...) ElapsedTime = 32,890625 seconds ElapsedTime = 0,548177083333333 minutes Total Counter = 100010952 (100 million...) ElapsedTime = 327,875 seconds ElapsedTime = 5,46458333333333 minutes Splitting of CSV file lines into array added... Total Counter = 1011852 (1 million...) ElapsedTime = 8,375 seconds ElapsedTime = 0,139583333333333 minutes ... (I didn't have time to test other cases of 10 and 100 million source file lines - please do if you have time...) Of course that is just reading the file - the open question is how closely this extreme files reading performance can be approached when such a file is bulk loaded into MS SQL Database? Join, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... I must say I'm very interested to return here next week, sorry for any inconvenience... -- Shamil P.S. Simple C# code used for testing (watch line wraps): using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long MAX_LIMIT = 1000000; // 00; string s = @"F:\Temp\XL\ConsoleApplication1\IN\testfile.txt"; long totalCounter = 0; long lineCounter = 0; DateTime startTime = DateTime.Now; while (totalCounter < MAX_LIMIT) { System.IO.TextReader rdr = new System.IO.StreamReader(s); lineCounter = 0; string inline = ""; char delimiter = (char)9; while ((inline = rdr.ReadLine())!=null) { string[] fields = inline.Split(delimiter); ++totalCounter; ++lineCounter; } rdr.Close(); } DateTime endTime = DateTime.Now ; TimeSpan elapsedTime = endTime - startTime; Console.WriteLine("File Line Counter = {0}", lineCounter.ToString()); Console.WriteLine("Total Counter = {0}", totalCounter.ToString()); Console.WriteLine("ElapsedTime = {0} seconds", elapsedTime.TotalSeconds.ToString()); Console.WriteLine("ElapsedTime = {0} minutes", elapsedTime.TotalMinutes.ToString()); } } } From Chris.Foote at uk.thalesgroup.com Wed Jul 25 05:38:29 2007 From: Chris.Foote at uk.thalesgroup.com (Foote, Chris) Date: Wed, 25 Jul 2007 11:38:29 +0100 Subject: [dba-VB] Count of specific character Message-ID: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV > file has the same > field name twice. I am trying to determine what is going on, > so I want to > count the field separator characters in the header and the > first line of > real data to see if there are more fields in the header than > in the data or > if something else is going on. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Jul 25 08:20:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 25 Jul 2007 09:20:05 -0400 Subject: [dba-VB] Count of specific character In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Message-ID: <20070725132017.45122BC2A@smtp-auth.no-ip.com> Wow. That does work. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 6:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 DWUTKA at Marlow.com Wed Jul 25 08:08:21 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 25 Jul 2007 08:08:21 -0500 Subject: [dba-VB] Count of specific character In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> References: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Message-ID: Neat trick, you could do that with Replace in VB. Len(strTemp)-Len(Replace(strTemp,"X","")) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 5:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From ebarro at verizon.net Wed Jul 25 09:07:29 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 25 Jul 2007 07:07:29 -0700 Subject: [dba-VB] Count of specific character In-Reply-To: Message-ID: <0JLQ007KNN7CGNW3@vms046.mailsrvcs.net> And in .NET (both VB and C#)... strTemp.Length - strTemp.Replace("X", "").Length -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, July 25, 2007 6:08 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Count of specific character Neat trick, you could do that with Replace in VB. Len(strTemp)-Len(Replace(strTemp,"X","")) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 5:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.19/917 - Release Date: 7/25/2007 1:16 AM From jwcolby at colbyconsulting.com Fri Jul 27 09:49:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 27 Jul 2007 10:49:23 -0400 Subject: [dba-VB] VB.Net - Proxy Class Message-ID: <20070727144938.81890BF2D@smtp-auth.no-ip.com> I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Jul 27 10:14:13 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jul 2007 08:14:13 -0700 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727144938.81890BF2D@smtp-auth.no-ip.com> References: <20070727144938.81890BF2D@smtp-auth.no-ip.com> Message-ID: John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jul 27 10:13:27 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jul 2007 10:13:27 -0500 Subject: [dba-VB] Odd problem with VB 6 application Message-ID: This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Jul 27 11:31:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 27 Jul 2007 12:31:32 -0400 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: Message-ID: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> Charlotte, Thanks for that. In fact I am examining using back ground threads to handle the process class work, however not knowing as much as I need to about VB.Net and .Net in general I want to get the entire process running (so I can do work) and then go investigate and use threads and background workers. In the meantime, what I am think of is a "middle man" class. The form knows about the middle man and can sink its events. The middle man can sink events from any class that implements a certain interface (but I think that is the wrong terminology here). The middle man sinks events from any class that can raise those events, and just immediately raises its own event, identically named, passing the parameters on. I have something similar to in concept but not exactly the same in implementation already working in VBA. I call it a message class. A message class is instantiated. It has a method that is called to send a message. Anyone with a pointer to the message class instance can call a method of the class instance and send a message. The message class simply raises an event and passes on the message. Anyone with a pointer to the message class can sink its events and receive any message. The message class is a middleman. Each end has to know about and get a pointer to the a clsMessage instance but they do not have to know about each other specifically. clsProcess needs to send a message. It gets a pointer to a clsMessage instance, calls a method of that instance and sends the message. clsMonitor needs to monitor clsProcess. It gets a pointer to the clsMessage instance and sinks it's events. Whenever clsProcess sends a message, it is passed through clsMessage and received by clsMonitor. clsMonitor can receive messages from ANY clsProcess (or any other class that sends messages on that instance of clsMessage). clsProcess can send messages and not worry about whether anyone is listening. If some class wants to log clsProcess' messages they can, if some other class wants to display clsProcess' messages on a form, they can etc. Loosely coupled interface, implemented through a common class instance. In fact messages can be sent back and forth between two classes or 100 classes, all listening on the message channel. BTW, a demo of that is on my web site in the WithEvents demo section. So I am looking to implement a similar construct here. In .Net though I have more flexibility in implementation because there are more capabilities available. Real inheritance, casting of an object to a specific data type etc. I do not know whether I can do what I am struggling to conceptualize. I want a process class to raise events. This allows the loosely coupled interface on the sending end. I want a proxy class instance to sink those events and retransmit them I want a progress form to sink events from a specific proxy class instance and use them. This allows the loosely coupled interface in the receiving end. The proxy class in the middle is the issue. IF I could create a clsProxy instance, pass in clsProcess to that instance as an OBJECT, then cast that object to a class that can be used WithEvents in a dim statement I would be there. I do not know how to do this. I can use the message class concept, I have already implemented that in VBA. That has the disadvantage of having to set up the message class instance and passing it in to the process class and to the progress form, but it is a lot more straightforward, and I can do that right now. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, July 27, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Fri Jul 27 11:54:45 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jul 2007 09:54:45 -0700 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> References: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> Message-ID: We use custom exception handlers, for example, and other "helper" classes. In the catch of a try-catch pair, we call the exception handler and pass it the exception and pops up a message ... But only for unhandled exceptions. We handle data exceptions in the data entity classes we create and pass the exception with custom message back to the calling object. We let the calling object then call a validationhelper class to handle the exception result it got, and that's were we pop up the messagebox and allow the user the OK or cancel options. We've tried to keep the model as untangled as possible, and the results affect the UI, so we make one-step jumps rather than daisy chaining events. I'm not sure whether that equates to what you're describing or not. We may, in fact, raise an event from a usercontrol, sink it in the parent of that usercontrol and raise another event from the parent to broadcast the result, if that's what you're describing. As for interface, we have defined interface classes, for instance for iToolbars and iValidation, which when implemented insert their shells into the object implementing them. In that object, we build code appropriate to whatever the event should do in that particular object. iValidation includes an IsValid function that accepts a feedbackstyle argument. The code in the object that implements it calls into the data entity class to validate a record before trying to update it. The validate event of the dataentity accepts a datarow uses the business rules tests in the entity and returns a boolean value for whether all the tests pass on the row. The calling object gets the boolean value back and if the record is valid, it save it. If it is not valid, it calls the ValidationHelper class to handle the exception message. That keeps up from changing something in the "middle" that breaks a bunch of other things. I don't know if that helps or not, because you're coming from a slightly different direction. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 9:32 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class Charlotte, Thanks for that. In fact I am examining using back ground threads to handle the process class work, however not knowing as much as I need to about VB.Net and .Net in general I want to get the entire process running (so I can do work) and then go investigate and use threads and background workers. In the meantime, what I am think of is a "middle man" class. The form knows about the middle man and can sink its events. The middle man can sink events from any class that implements a certain interface (but I think that is the wrong terminology here). The middle man sinks events from any class that can raise those events, and just immediately raises its own event, identically named, passing the parameters on. I have something similar to in concept but not exactly the same in implementation already working in VBA. I call it a message class. A message class is instantiated. It has a method that is called to send a message. Anyone with a pointer to the message class instance can call a method of the class instance and send a message. The message class simply raises an event and passes on the message. Anyone with a pointer to the message class can sink its events and receive any message. The message class is a middleman. Each end has to know about and get a pointer to the a clsMessage instance but they do not have to know about each other specifically. clsProcess needs to send a message. It gets a pointer to a clsMessage instance, calls a method of that instance and sends the message. clsMonitor needs to monitor clsProcess. It gets a pointer to the clsMessage instance and sinks it's events. Whenever clsProcess sends a message, it is passed through clsMessage and received by clsMonitor. clsMonitor can receive messages from ANY clsProcess (or any other class that sends messages on that instance of clsMessage). clsProcess can send messages and not worry about whether anyone is listening. If some class wants to log clsProcess' messages they can, if some other class wants to display clsProcess' messages on a form, they can etc. Loosely coupled interface, implemented through a common class instance. In fact messages can be sent back and forth between two classes or 100 classes, all listening on the message channel. BTW, a demo of that is on my web site in the WithEvents demo section. So I am looking to implement a similar construct here. In .Net though I have more flexibility in implementation because there are more capabilities available. Real inheritance, casting of an object to a specific data type etc. I do not know whether I can do what I am struggling to conceptualize. I want a process class to raise events. This allows the loosely coupled interface on the sending end. I want a proxy class instance to sink those events and retransmit them I want a progress form to sink events from a specific proxy class instance and use them. This allows the loosely coupled interface in the receiving end. The proxy class in the middle is the issue. IF I could create a clsProxy instance, pass in clsProcess to that instance as an OBJECT, then cast that object to a class that can be used WithEvents in a dim statement I would be there. I do not know how to do this. I can use the message class concept, I have already implemented that in VBA. That has the disadvantage of having to set up the message class instance and passing it in to the process class and to the progress form, but it is a lot more straightforward, and I can do that right now. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, July 27, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting 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 shamil at users.mns.ru Fri Jul 27 12:56:14 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 27 Jul 2007 21:56:14 +0400 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727144938.81890BF2D@smtp-auth.no-ip.com> Message-ID: <000501c7d077$6cae5b00$6401a8c0@nant> Hello John, Beware! - you're entering tricky world of threads, events and delegates (you never know what happens next in this world I mean). Be especially careful with sending notification to the form (thread) from worker processes - as Charlotte noted here System.ComponentModel.BackgroundWorker is the most safe solution for this case while you're getting through learning curve.... Sample code without using System.ComponentModel.BackgroundWorker and not tested with WinForms - just use VB.NET console application to run it (watch line wraps): ============ Imports System.Threading Imports System.Collections.Generic Module SSTestOfEventsAndDelegates ' // Delegate declaration Public Delegate Sub TestEventDelegate(ByVal objectId As Long, ByVal msgId As Integer) ' // main object (form simulator) Public Class TestForm Private WithEvents _proxy _ As New TestProcessEventsProxy() Private _testCount As Integer = 0 Private Sub _proxy_TestEvent(ByVal objectId As Long, ByVal msgId As Integer) _ Handles _proxy.TestEvent Console.WriteLine("TestForm: Message {0}.{1} arrived.", msgId, objectId) _testCount += 1 End Sub Public Sub Test() _proxy.Test() Dim startTime As DateTime = DateTime.Now Dim ts As TimeSpan = TimeSpan.MinValue Dim currentTime As DateTime = DateTime.MinValue While (_testCount < 9) And _ (ts < New TimeSpan(50000000)) '// 5s ts = DateTime.Now - startTime System.Threading.Thread.Sleep(250) Console.WriteLine("TestForm: Waiting for events, count = {0}, timeSpan = {1} s...", _ _testCount, ts.TotalSeconds) End While End Sub End Class ' // Proxy Public Class TestProcessEventsProxy Public Event TestEvent(ByVal Id As Long, ByVal msgId As Integer) Private _senders As List(Of System.Threading.Thread) = _ New List(Of System.Threading.Thread)() Public Sub Test() For i As Integer = 1 To 3 Dim newThread As System.Threading.Thread = _ New System.Threading.Thread(AddressOf myThread) newThread.Start() _senders.Add(newThread) Next i End Sub Protected Sub myThread() Dim obj As New TestProcess(AddressOf TestEventHook) obj.Test() End Sub Public Sub TestEventHook(ByVal objectId As Long, ByVal msgId As Integer) Console.WriteLine("Proxy: Message {0}.{1} is to be retransmitted.", objectId, msgId) RaiseEvent TestEvent(objectId, msgId) Console.WriteLine("Proxy: Message {0}.{1} has been retransmitted.", objectId, msgId) End Sub End Class ' // worker process Public Class TestProcess Private Shared _id As Long = 0 Private _myId As Long Private _myDelegate As TestEventDelegate Private _myMessageId As Long = 0 Public Sub New(ByRef eventDeleGate As TestEventDelegate) _myId = Interlocked.Increment(_id) _myDelegate = eventDeleGate End Sub Public Sub Test() For i As Integer = 1 To 3 _mymessageId += 1 System.Threading.Thread.Sleep(300) Console.WriteLine("Process: Message {0}.{1} is to be sent.", _myId, _myMessageId) _myDelegate.Invoke(_myId, _myMessageId) Console.WriteLine("Process: Message {0}.{1} has been sent.", _myId, _myMessageId) Next i End Sub End Class '// test Sub Main() Dim obj As New TestForm() obj.Test() End Sub End Module My results: =========== TestForm: Waiting for events, count = 0, timeSpan = 0 s... Process: Message 2.1 is to be sent. Process: Message 1.1 is to be sent. Proxy: Message 2.1 is to be retransmitted. Proxy: Message 1.1 is to be retransmitted. TestForm: Message 1.2 arrived. Proxy: Message 2.1 has been retransmitted. Process: Message 2.1 has been sent. Process: Message 3.1 is to be sent. Proxy: Message 3.1 is to be retransmitted. TestForm: Message 1.3 arrived. Proxy: Message 3.1 has been retransmitted. Process: Message 3.1 has been sent. TestForm: Message 1.1 arrived. Proxy: Message 1.1 has been retransmitted. Process: Message 1.1 has been sent. TestForm: Waiting for events, count = 3, timeSpan = 0,25 s... Process: Message 2.2 is to be sent. Proxy: Message 2.2 is to be retransmitted. TestForm: Message 2.2 arrived. Proxy: Message 2.2 has been retransmitted. Process: Message 2.2 has been sent. Process: Message 3.2 is to be sent. Proxy: Message 3.2 is to be retransmitted. TestForm: Message 2.3 arrived. Proxy: Message 3.2 has been retransmitted. Process: Message 1.2 is to be sent. Proxy: Message 1.2 is to be retransmitted. TestForm: Message 2.1 arrived. Proxy: Message 1.2 has been retransmitted. Process: Message 1.2 has been sent. Process: Message 3.2 has been sent. TestForm: Waiting for events, count = 6, timeSpan = 0,5 s... Process: Message 2.3 is to be sent. Proxy: Message 2.3 is to be retransmitted. TestForm: Message 3.2 arrived. Proxy: Message 2.3 has been retransmitted. Process: Message 2.3 has been sent. Process: Message 1.3 is to be sent. Proxy: Message 1.3 is to be retransmitted. TestForm: Message 3.1 arrived. Proxy: Message 1.3 has been retransmitted. Process: Message 1.3 has been sent. Process: Message 3.3 is to be sent. Proxy: Message 3.3 is to be retransmitted. TestForm: Message 3.3 arrived. Proxy: Message 3.3 has been retransmitted. Process: Message 3.3 has been sent. TestForm: Waiting for events, count = 9, timeSpan = 0,75 s... Press any key to continue . . . -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 6:49 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 27 20:20:14 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Sat, 28 Jul 2007 11:20:14 +1000 Subject: [dba-VB] Odd problem with VB 6 application References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289B06@ddi-01.DDI.local> Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Sat Jul 28 03:47:38 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 28 Jul 2007 03:47:38 -0500 Subject: [dba-VB] Odd problem with VB 6 application In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D01289B06@ddi-01.DDI.local> Message-ID: Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From shamil at users.mns.ru Sat Jul 28 05:29:28 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Sat, 28 Jul 2007 14:29:28 +0400 Subject: [dba-VB] Odd problem with VB 6 application In-Reply-To: Message-ID: <000001c7d102$2d8e9fd0$6401a8c0@nant> <<< You have to disable UAC. Not sure about regserver, but I assume it's the same. >>> Rather smooth workaround is to use INNO-Setup starting latest versions - just make simple installation of your ActiveX using INNO-Setup and you'll get manifest file automatically injected in it and this manifest file will elevate the user privileges on setup and will bypass UAC trouble... Not sure it works that way for very restricted Vista users but for standard non admin users it works that way - tested... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, July 28, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 28 12:51:13 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 28 Jul 2007 13:51:13 -0400 Subject: [dba-VB] VB.Net - Can tables be streams? Message-ID: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> I have a "serializable" class that serializes the data from a form to stream. Currently the stream is written to file. I am wondering if I can write it to a table instead by substituting a different kind of stream? John W. Colby Colby Consulting www.ColbyConsulting.com From shamil at users.mns.ru Sat Jul 28 17:41:19 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Sun, 29 Jul 2007 02:41:19 +0400 Subject: [dba-VB] VB.Net - Can tables be streams? In-Reply-To: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> Message-ID: <000f01c7d168$6a3a0620$6401a8c0@nant> Hello John, You can try to use DataSet's ReadXml method to load a DataSet instance with data, which you can then persist to a table.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 28, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Can tables be streams? I have a "serializable" class that serializes the data from a form to stream. Currently the stream is written to file. I am wondering if I can write it to a table instead by substituting a different kind of stream? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mmattys at rochester.rr.com Sat Jul 28 19:39:23 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sat, 28 Jul 2007 20:39:23 -0400 Subject: [dba-VB] VB.Net - Can tables be streams? References: <000f01c7d168$6a3a0620$6401a8c0@nant> Message-ID: <002201c7d178$ea2cbe30$0202a8c0@Laptop> Reports have been coming in of strange, insane laughter coming from the Colby house ... echoing in the mountains ... Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: Sent: Saturday, July 28, 2007 6:41 PM Subject: Re: [dba-VB] VB.Net - Can tables be streams? > Hello John, > > You can try to use DataSet's ReadXml method to load a DataSet instance > with > data, which you can then persist to a table.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 28, 2007 9:51 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] VB.Net - Can tables be streams? > > I have a "serializable" class that serializes the data from a form to > stream. Currently the stream is written to file. I am wondering if I can > write it to a table instead by substituting a different kind of stream? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com From thewaddles at sbcglobal.net Sat Jul 28 19:40:18 2007 From: thewaddles at sbcglobal.net (Kevin Waddle) Date: Sat, 28 Jul 2007 17:40:18 -0700 Subject: [dba-VB] VB6 Datarepeater Code In-Reply-To: <000f01c7d168$6a3a0620$6401a8c0@nant> References: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> <000f01c7d168$6a3a0620$6401a8c0@nant> Message-ID: <001301c7d179$0a09c950$6600a8c0@TheWaddles> Hello, I am trying to recreate an Access continuous form in a VB6 exe using the datarepeater control. I have created a ActiveX control containing a TextBox and a CheckBox. These are bound to an Access mdb file. I can display and update the textbox but cannot get anything to display properly on the checkboxes. The control will display the checkbox as true only when the record is active. Does anyone have an example using the datarepeater control with a checkbox or another avenue to create a continuous form in VB6? Thank you, Kevin Chocolate moose: 1 medium size moose, 20 pounds chocolate. From mmattys at rochester.rr.com Sat Jul 28 19:54:24 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sat, 28 Jul 2007 20:54:24 -0400 Subject: [dba-VB] VB6 Datarepeater Code References: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> <000f01c7d168$6a3a0620$6401a8c0@nant> <001301c7d179$0a09c950$6600a8c0@TheWaddles> Message-ID: <003501c7d17b$060daa90$0202a8c0@Laptop> Kevin, I haven't an example, but maybe KB Article 197428 will help? http://support.microsoft.com/kb/197428 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Kevin Waddle" To: Sent: Saturday, July 28, 2007 8:40 PM Subject: [dba-VB] VB6 Datarepeater Code > Hello, > > I am trying to recreate an Access continuous form in a VB6 exe using the > datarepeater control. > > I have created a ActiveX control containing a TextBox and a CheckBox. > These are bound to an Access mdb file. > I can display and update the textbox but cannot get anything to display > properly on the checkboxes. > > The control will display the checkbox as true only when the record is > active. > > Does anyone have an example using the datarepeater control with a checkbox > or another avenue to create a continuous form in VB6? > > Thank you, > Kevin > > > Chocolate moose: 1 medium size moose, 20 pounds chocolate. > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com From michael at ddisolutions.com.au Sun Jul 29 19:10:45 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 30 Jul 2007 10:10:45 +1000 Subject: [dba-VB] Odd problem with VB 6 application References: <000001c7d102$2d8e9fd0$6401a8c0@nant> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289B07@ddi-01.DDI.local> Yeah I also use Inno for all VB6 deployments, or I used to. Most new projects are in .net these days. However I have to maintain a lot of VB6 code. I don't really want to do a full install for each minor change to a dll, know what I mean? I guess with Vista I wont have a choice. cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, 28 July 2007 8:29 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application <<< You have to disable UAC. Not sure about regserver, but I assume it's the same. >>> Rather smooth workaround is to use INNO-Setup starting latest versions - just make simple installation of your ActiveX using INNO-Setup and you'll get manifest file automatically injected in it and this manifest file will elevate the user privileges on setup and will bypass UAC trouble... Not sure it works that way for very restricted Vista users but for standard non admin users it works that way - tested... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, July 28, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 09:03:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 10:03:56 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code Message-ID: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Mon Jul 30 10:49:04 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 08:49:04 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> References: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> Message-ID: Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 11:04:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 12:04:22 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730160428.2B49BBCC8@smtp-auth.no-ip.com> LOL. Uhh.... Yea, sure... ;-) John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 11:44:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 12:44:53 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Mon Jul 30 12:03:28 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 10:03:28 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> References: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> Message-ID: No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 Mon Jul 30 12:12:29 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 13:12:29 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> Well... That is pretty hard to say but I think so. I pretty much just choose the defaults. I read somewhere that there can be issues caused by copying files from one computer to another. Something about the security kicking in because Windows XP marks the files as "coming from" a specific computer and now it is not being run on that computer. I have to wonder if it is related to that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 1:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Mon Jul 30 13:08:12 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 11:08:12 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> References: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> Message-ID: Don't know. We use source safe, so all our files get copied from the same location to the local drive. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 10:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Well... That is pretty hard to say but I think so. I pretty much just choose the defaults. I read somewhere that there can be issues caused by copying files from one computer to another. Something about the security kicking in because Windows XP marks the files as "coming from" a specific computer and now it is not being run on that computer. I have to wonder if it is related to that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 1:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 4 10:24:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 4 Jul 2007 11:24:23 -0400 Subject: [dba-VB] VB.Net - System.IO.Stream Message-ID: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> I am working with a library that wants a stream passed in. NOT a StreamReader, a plain old stream. According to the docs, Stream is supposed to be a member of System.IO but it does not appear to be. According to Microsoft's docs, Stream is supposed to be the base class and is supposed to be accessible. I cannot get at it. Does anyone know how to reference System.IO.Stream? John W. Colby Colby Consulting www.ColbyConsulting.com From chizotz at mchsi.com Wed Jul 4 12:34:48 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 4 Jul 2007 12:34:48 -0500 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> References: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> Message-ID: <5310128033.20070704123448@mchsi.com> Hi John, Stream is an abstract class so an instance can't be created. You need to create an instance of a specific type of stream then pass that. I've never used it, but I suspect what you need is a MemoryStream, you might want to check into that. Ron Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > I am working with a library that wants a stream passed in. NOT a > StreamReader, a plain old stream. According to the docs, Stream is supposed > to be a member of System.IO but it does not appear to be. According to > Microsoft's docs, Stream is supposed to be the base class and is supposed to > be accessible. I cannot get at it. > Does anyone know how to reference System.IO.Stream? --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com From gustav at cactus.dk Wed Jul 4 16:43:08 2007 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 04 Jul 2007 23:43:08 +0200 Subject: [dba-VB] Menu control Message-ID: Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From jwcolby at colbyconsulting.com Wed Jul 4 18:48:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 4 Jul 2007 19:48:37 -0400 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <5310128033.20070704123448@mchsi.com> Message-ID: <20070704234853.B108ABD83@smtp-auth.no-ip.com> Ron, Unfortunately intellisense is telling me that a type STREAM is required, and furthermore if I try to pass any of the subtypes the DLLs class constructor refuses to accept it. It seems that I cannot do a new on it but I may be able to somehow dim an instance of the base class. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen Sent: Wednesday, July 04, 2007 1:35 PM To: jwcolby Subject: Re: [dba-VB] VB.Net - System.IO.Stream Hi John, Stream is an abstract class so an instance can't be created. You need to create an instance of a specific type of stream then pass that. I've never used it, but I suspect what you need is a MemoryStream, you might want to check into that. Ron Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > I am working with a library that wants a stream passed in. NOT a > StreamReader, a plain old stream. According to the docs, Stream is > supposed to be a member of System.IO but it does not appear to be. > According to Microsoft's docs, Stream is supposed to be the base class > and is supposed to be accessible. I cannot get at it. > Does anyone know how to reference System.IO.Stream? --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From martyconnelly at shaw.ca Wed Jul 4 21:08:29 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Wed, 04 Jul 2007 19:08:29 -0700 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <20070704234853.B108ABD83@smtp-auth.no-ip.com> References: <20070704234853.B108ABD83@smtp-auth.no-ip.com> Message-ID: <468C529D.4030505@shaw.ca> I thought it was dedclared this way Imports System.IO Dim s As System.IO.Stream jwcolby wrote: >Ron, > >Unfortunately intellisense is telling me that a type STREAM is required, and >furthermore if I try to pass any of the subtypes the DLLs class constructor >refuses to accept it. It seems that I cannot do a new on it but I may be >able to somehow dim an instance of the base class. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen >Sent: Wednesday, July 04, 2007 1:35 PM >To: jwcolby >Subject: Re: [dba-VB] VB.Net - System.IO.Stream > >Hi John, > >Stream is an abstract class so an instance can't be created. You need to >create an instance of a specific type of stream then pass that. I've never >used it, but I suspect what you need is a MemoryStream, you might want to >check into that. > >Ron > > >Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > > > >>I am working with a library that wants a stream passed in. NOT a >>StreamReader, a plain old stream. According to the docs, Stream is >>supposed to be a member of System.IO but it does not appear to be. >>According to Microsoft's docs, Stream is supposed to be the base class >>and is supposed to be accessible. I cannot get at it. >> >> > > > >>Does anyone know how to reference System.IO.Stream? >> >> > > > > >--- >avast! Antivirus: Outbound message clean. >Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM >avast! - copyright (c) 1988-2007 ALWIL Software. >http://www.avast.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 > > > > > -- Marty Connelly Victoria, B.C. Canada From Jdemarco at hudsonhealthplan.org Thu Jul 5 07:02:45 2007 From: Jdemarco at hudsonhealthplan.org (Jim DeMarco) Date: Thu, 5 Jul 2007 08:02:45 -0400 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: <0B8880A20E2CF24280FA60901E108FB08F28EF@TTNEXCHSVR.hshhp.com> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 5 09:15:26 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jul 2007 16:15:26 +0200 Subject: [dba-VB] Menu control Message-ID: Hi Jim It was something like this I had in mind: http://www.divil.co.uk/net/controls/eyefinder/rendering.aspx It is for VS2005. /gustav >>> Jdemarco at hudsonhealthplan.org 05-07-2007 14:02 >>> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From cfoust at infostatsystems.com Thu Jul 5 12:12:30 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 5 Jul 2007 10:12:30 -0700 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 5 12:35:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 5 Jul 2007 13:35:53 -0400 Subject: [dba-VB] Menu control In-Reply-To: Message-ID: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> >We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Jane, you ignorant slut (to quote one of my favorite SNL skits). I must say I can't for the life of me figure out WHY you would avoid a piece of trash that takes up 1/4 of the screen in low resolution modes. But that is of course just my own opinion. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 05, 2007 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 5 15:12:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 5 Jul 2007 13:12:03 -0700 Subject: [dba-VB] Menu control In-Reply-To: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> References: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> Message-ID: Why, John, what a sweet thing to say!! LOL We finally agree on something ... The ribbon, that is. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 05, 2007 10:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control >We basically give the user multiple ways to get at menu options and we >are actively avoiding *ribbons*!! Jane, you ignorant slut (to quote one of my favorite SNL skits). I must say I can't for the life of me figure out WHY you would avoid a piece of trash that takes up 1/4 of the screen in low resolution modes. But that is of course just my own opinion. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 05, 2007 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Jdemarco at hudsonhealthplan.org Fri Jul 6 13:17:51 2007 From: Jdemarco at hudsonhealthplan.org (Jim DeMarco) Date: Fri, 6 Jul 2007 14:17:51 -0400 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: <0B8880A20E2CF24280FA60901E108FB08F2961@TTNEXCHSVR.hshhp.com> That's a nice looking control eh? I think the one I just sent you is older. Good luck, Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 05, 2007 10:15 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control Hi Jim It was something like this I had in mind: http://www.divil.co.uk/net/controls/eyefinder/rendering.aspx It is for VS2005. /gustav >>> Jdemarco at hudsonhealthplan.org 05-07-2007 14:02 >>> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Mon Jul 9 20:35:54 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Tue, 10 Jul 2007 11:35:54 +1000 Subject: [dba-VB] Menu control References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289A19@ddi-01.DDI.local> Dotnetbar is my favourite. It covers just about every UI menu/toolbar style going back to Office 2000. It also does docking windows, which I like a lot. 200 USD IIRC. Well worth it IMO. http://www.devcomponents.com/dotnetbar/ cheers Michael M Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Tue Jul 10 03:08:17 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 10 Jul 2007 10:08:17 +0200 Subject: [dba-VB] Menu control Message-ID: Hi Michael Thanks! It seems to be very comprehensive ... /gustav >>> michael at ddisolutions.com.au 10-07-2007 03:35 >>> Dotnetbar is my favourite. It covers just about every UI menu/toolbar style going back to Office 2000. It also does docking windows, which I like a lot. 200 USD IIRC. Well worth it IMO. http://www.devcomponents.com/dotnetbar/ cheers Michael M Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From Gustav at cactus.dk Tue Jul 10 11:51:14 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 10 Jul 2007 18:51:14 +0200 Subject: [dba-VB] Cheat Sheets Message-ID: Hi all "Learn Visual Studio" http://www.learnvisualstudio.net has just published this set of syntax/overview/etc cards which you may find handy and useful: We've spent a lot of time developing these free cheat sheets, to make your experience with Microsoft Visual Studio, even easier. And the best part is they're free for anyone to download. So, print 'em out, put 'em on your bulletin board, in your wallet, or near your computer to help give you a gentle nudge as you're writing code. We have 6 cheat sheets available for you to download in PDF format. Choose the one that works best for you, or grab them all, they're your's now. Take a look; ------------------------------------------------------------------------- VB Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=5cbf7baf-aef6-47da-9862-609444c12aa4 ------------------------------------------------------------------------- C# Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=ef94e215-f654-4f1f-9ff3-3a48e3d987b0 ------------------------------------------------------------------------- ASP.NET Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=6cf3ecf8-668c-4614-9248-c75529149876 ------------------------------------------------------------------------- VB Toolbars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=83ebdfe5-6e9a-47c2-be3d-ee1077148bc3 ------------------------------------------------------------------------- C#Toolbars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=2116b801-40f6-49e7-868e-c7c90cbc5a1d ------------------------------------------------------------------------- Visual Web Developer Tool Bars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=f9f74ae8-6bfb-4288-91ab-aaba042dd63d Watch for word wraps. /gustav From jwcolby at colbyconsulting.com Tue Jul 10 22:24:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 10 Jul 2007 23:24:36 -0400 Subject: [dba-VB] Build table Message-ID: <20070711032439.67F66BE14@smtp-auth.no-ip.com> I need to build a table in SQL Server given a server name, database name, table name and a list of fields. I have a rough draft as follows: Public Function mCreateTbl() As Boolean Dim strSQL As String With csvData.Columns Dim strName As String strSQL = "CREATE TABLE [" & mstrDatabaseName & "].[dbo].[" & mstrTblName & "] (" & _ "[PKID] [int] IDENTITY (1, 1) NOT NULL " For Each strName In .Names strSQL = strSQL & ",[" & strName & "] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL " Next strName strSQL = strSQL & ") ON [PRIMARY] " & _ "GO()" Dim strSQLAddKey As String strSQLAddKey = "ALTER TABLE [dbo].[" & mstrTblName & "] WITH NOCHECK ADD " & _ "CONSTRAINT [PKID] PRIMARY KEY CLUSTERED (" & _ "[PKID]() " & _ ") ON [PRIMARY] " & _ "GO()" End With End Function I have not yet even started testing it to get the strings compilable in SQL Server but if and when it comes together, what would the database objects (ADO?) look like to execute such a beast? Is anyone doing such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com From mikedorism at verizon.net Wed Jul 11 05:56:12 2007 From: mikedorism at verizon.net (Doris Manning) Date: Wed, 11 Jul 2007 06:56:12 -0400 Subject: [dba-VB] Build table In-Reply-To: <20070711032439.67F66BE14@smtp-auth.no-ip.com> References: <20070711032439.67F66BE14@smtp-auth.no-ip.com> Message-ID: <000901c7c3aa$18f4c6e0$2f01a8c0@Kermit> John, You will need an ADO Connection object and an ADO Command object. You don't need to include "GO()" in the SQL Statement. You only use that when you are working in Query Analyzer. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 10, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Build table I need to build a table in SQL Server given a server name, database name, table name and a list of fields. I have a rough draft as follows: Public Function mCreateTbl() As Boolean Dim strSQL As String With csvData.Columns Dim strName As String strSQL = "CREATE TABLE [" & mstrDatabaseName & "].[dbo].[" & mstrTblName & "] (" & _ "[PKID] [int] IDENTITY (1, 1) NOT NULL " For Each strName In .Names strSQL = strSQL & ",[" & strName & "] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL " Next strName strSQL = strSQL & ") ON [PRIMARY] " & _ "GO()" Dim strSQLAddKey As String strSQLAddKey = "ALTER TABLE [dbo].[" & mstrTblName & "] WITH NOCHECK ADD " & _ "CONSTRAINT [PKID] PRIMARY KEY CLUSTERED (" & _ "[PKID]() " & _ ") ON [PRIMARY] " & _ "GO()" End With End Function I have not yet even started testing it to get the strings compilable in SQL Server but if and when it comes together, what would the database objects (ADO?) look like to execute such a beast? Is anyone doing such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 11 09:19:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 10:19:36 -0400 Subject: [dba-VB] Visual studio help Message-ID: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Wed Jul 11 10:14:20 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 11 Jul 2007 08:14:20 -0700 Subject: [dba-VB] Visual studio help In-Reply-To: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> References: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> Message-ID: By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 11 10:51:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 11:51:28 -0400 Subject: [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Wed Jul 11 11:04:55 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 11 Jul 2007 09:04:55 -0700 Subject: [dba-VB] Visual studio help In-Reply-To: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> References: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Message-ID: Oh, that!! The filtering stuff has gotten progressively worse in VS with each version. Mine comes up by default filtered by Infragistics Software, even though the help pane itself amy have brought up the VB Language Reference information for whatever I hit F1 on. You can set the filter and it should remember it next time you hit F1, but I never bother because I rock back and forth between VB.Net and the custom help for the 3rd party tools and SQL Server. The filter seems to be only loosely coupled to the help pane, so I wouldn't depend on it for much unless you like drilling down tree views. The search tab is what I always use. You can type in the word or phrase, set you language, technology and content and see a list of search hits. That usually works best for me, kind of like searching the MSKB. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:51 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com; 'Access Developers discussion and problem solving' Subject: Re: [dba-VB] Visual studio help Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 Wed Jul 11 11:14:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:14:53 -0400 Subject: [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711161456.9C2DFBC01@smtp-auth.no-ip.com> Well, the problem is that the filter seems to control whether anything will appear. Given that the only choices are SQL stuff, if I try to search for something specific to VB.net language nothing appears. And since I cannot change the filters to anything else... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 12:05 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help Oh, that!! The filtering stuff has gotten progressively worse in VS with each version. Mine comes up by default filtered by Infragistics Software, even though the help pane itself amy have brought up the VB Language Reference information for whatever I hit F1 on. You can set the filter and it should remember it next time you hit F1, but I never bother because I rock back and forth between VB.Net and the custom help for the 3rd party tools and SQL Server. The filter seems to be only loosely coupled to the help pane, so I wouldn't depend on it for much unless you like drilling down tree views. The search tab is what I always use. You can type in the word or phrase, set you language, technology and content and see a list of search hits. That usually works best for me, kind of like searching the MSKB. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:51 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com; 'Access Developers discussion and problem solving' Subject: Re: [dba-VB] Visual studio help Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 jwcolby at colbyconsulting.com Wed Jul 11 11:29:03 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:29:03 -0400 Subject: [dba-VB] [dba-SQLServer] Visual studio help In-Reply-To: <200707111605.l6BG50a6018086@databaseadvisors.com> Message-ID: <20070711162907.4016CBE1D@smtp-auth.no-ip.com> Robert, Yep, a reinstall of MSDN fixed the problem. Thanks for the heads up John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Wednesday, July 11, 2007 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Visual studio help John, The help files for Visual Studio are not installed automatically. You have to run the install on the MSDN disk(s) that came with it to get help of any kind. Robert At 10:51 AM 7/11/2007, you wrote: >Date: Wed, 11 Jul 2007 11:51:28 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] [dba-VB] Visual studio help >To: , > , "'Access Developers discussion and > problem solving'" >Message-ID: <20070711155131.9F8C9BE74 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Yes, but if you hit F1 then it opens a help file of some sort. I can >say whether it is going to use the local help or the internet help first etc. >As for books online, well... I only know that term in terms of SQL Server. > >1) Go into code. >2) Select some something, keyword, whatever. >3) Hit F1. > >What do you see? > >I see a help window. On the top blue bar it says "Microsoft Visual >Studio >2005 Documentation". That is a good sign. > >However on the left hand side there is a Pane (or PAIN depending on >your point of view), which has a "filter by" combo. The ONLY CHOICES >(for me) >are: > >SQL Server 2005 >SQL Server Analysis Service >SQL Server... >SQL Server... >SQL Server... >Etc etc. > >I am locked in to filtering on SQL Server help. I DON'T WANT SQL >SERVER HELP, I WANT VB HELP. > >Actually I want to be able to select VB, C#, Java, SQL Server and >whatever else is appropriate in the context I am using. I am flying >Visual Studio blind, unless all I am interested in is SQL Server help >in which case I am ducky. > >John W. Colby _______________________________________________ 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 Wed Jul 11 22:03:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 23:03:42 -0400 Subject: [dba-VB] Windows 2003 x64; SQL Server 2005 X64 Message-ID: <20070712030347.0B7E8BDA9@smtp-auth.no-ip.com> Is anyone out there running Windows 2003 X64? If so would you care to comment on what was involved in getting it to happen, drivers, getting the software etc. Same question for SQl Server 2005 X64. John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 17:27:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 18:27:59 -0400 Subject: [dba-VB] VB.Net - DoEvents Message-ID: <20070712222800.DE47FBD36@smtp-auth.no-ip.com> I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 22:25:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 23:25:15 -0400 Subject: [dba-VB] Resource files Message-ID: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 23:33:27 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 00:33:27 -0400 Subject: [dba-VB] Convert C to VB Message-ID: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com From newsgrps at dalyn.co.nz Thu Jul 12 23:41:35 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 13 Jul 2007 16:41:35 +1200 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> References: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <20070713043858.EMOF11149.fep01.xtra.co.nz@Dalyn.dalyn.co.nz> John, Try this site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx Regards David Emerson Dalyn Software Ltd Wellington, New Zealand At 13/07/2007, you wrote: >I need to convert a chunk of 'C#' code to Vb. The code apparently allows >you to get an expanded list of default values for the FolderBrowserDialog. > >It isn't much and I (believe I) have mostly figured it out. > >http://www.xoc.net/works/tips/folderbrowserdialog.asp > >So far I have: > >imports System; >imports System.Reflection; > >Public Class FolderBrowserDialogEx > '[Flags()] > Public Enum CsIdl > Desktop = &H0 ' Desktop > Internet = &H1 ' Internet Explorer (icon on desktop) > Programs = &H2 '// Start Menu\Programs > Controls = &H3 ' My Computer\Control Panel > Printers = &H4 ' My Computer\Printers > Personal = &H5 ' My Documents > Favorites = &H6 ' user name\Favorites > Startup = &H7 ' Start Menu\Programs\Startup > Recent = &H8 ' user name\Recent > SendTo = &H9 ' user name\SendTo > BitBucket = &HA ' desktop\Recycle Bin > StartMenu = &HB ' user name\Start Menu > MyDocuments = &HC ' logical "My Documents" desktop icon > MyMusic = &HD ' "My Music" folder > MyVideo = &HE ' "My Videos" folder > DesktopDirectory = &H10 ' user name\Desktop > Drives = &H11 ' My Computer > Network = &H12 ' Network Neighborhood (My Network Places) > Nethood = &H13 ' user name\nethood > Fonts = &H14 ' windows\fonts > Templates = &H0015, > CommonStartMenu = &H16 ' All Users\Start Menu > CommonPrograms = &H17 ' All Users\Start Menu\Programs > CommonStartup = &H18 ' All Users\Startup > CommonDesktopDirectory = &H19 ' All Users\Desktop > AppData = &H1A ' user name\Application Data > PrintHood = &H1B ' user name\PrintHood > LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non >roaming) > AltStartup = &H1D ' non localized startup > CommonAltStartup = &H1E ' non localized common startup > CommonFavorites = &H1F > InternetCache = &H20 > Cookies = &H21 > History = &H22 > CommonAppdata = &H23 ' All Users\Application Data > Windows = &H24 ' GetWindowsDirectory() > System = &H25 ' GetSystemDirectory() > ProgramFiles = &H26 ' C:\Program Files > MyPictures = &H27 ' C:\Program Files\My Pictures > Profile = &H28 ' USERPROFILE > SystemX86 = &H29 ' x86 system directory on RISC > ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC > ProgramFilesCommon = &H2B ' C:\Program Files\Common > ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC > CommonTemplates = &H2D ' All Users\Templates > CommonDocuments = &H2E ' All Users\Documents > CommonAdminTools = &H2F ' All Users\Start >Menu\Programs\Administrative Tools > AdminTools = &H30 ' user name\Start Menu\Programs\Administrative >Tools > Connections = &H31 ' Network and Dial-up Connections > CommonMusic = &H35 ' All Users\My Music > CommonPictures = &H36 ' All Users\My Pictures > CommonVideo = &H37 ' All Users\My Video > Resources = &H38 ' Resource Direcotry > ResourcesLocalized = &H39 ' Localized Resource Direcotry > CommonOemLinks = &H3A ' Links to All Users OEM specific apps > CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application >Data\Microsoft\CD Burning > ComputersNearMe = &H3D ' Computers Near Me (computered from >Workgroup membership) > FlagCreate = &H8000 ' combine with CSIDL_ value to force folder >creation in SHGetFolderPath() > FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an >unverified folder path > FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias >versions of the pidl > FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate >per-user init (eg. upgrade) > FlagMask = &HFF00 ' mask for all possible flag values > > End Enum > > Private Sub FolderBrowserDialogEx() > End Sub > > > Public Sub SetRootFolder(ByVal fbd As >System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) > Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType > dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance >| BindingFlags.NonPublic); > fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); > End Sub >End Class > >That last chunk - SetRootFolder - just isn't cooperating. Any help much >appreciated. > >TIA. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com From ebarro at verizon.net Thu Jul 12 23:42:55 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 12 Jul 2007 21:42:55 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <0JL300K6CP3M1117@vms048.mailsrvcs.net> Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM From accessd at shaw.ca Fri Jul 13 02:37:18 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 13 Jul 2007 00:37:18 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <0JL300J4CWYZUOF0@l-daemon> Hi John: Check the following site out. You can link to it from the DBA web site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:00:16 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:00:16 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <0JL300K6CP3M1117@vms048.mailsrvcs.net> Message-ID: <20070713120017.88743BEB8@smtp-auth.no-ip.com> Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:02:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:02:59 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <0JL300J4CWYZUOF0@l-daemon> Message-ID: <20070713120300.4631CBDD9@smtp-auth.no-ip.com> Like all things, these only get you so far. In this case it didn't get me anywhere but that is another story. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, July 13, 2007 3:37 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Hi John: Check the following site out. You can link to it from the DBA web site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting 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 mikedorism at verizon.net Fri Jul 13 07:18:26 2007 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 13 Jul 2007 08:18:26 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713120017.88743BEB8@smtp-auth.no-ip.com> References: <0JL300K6CP3M1117@vms048.mailsrvcs.net> <20070713120017.88743BEB8@smtp-auth.no-ip.com> Message-ID: <000301c7c547$eaa5c1f0$2f01a8c0@Kermit> You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ 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 mikedorism at verizon.net Fri Jul 13 07:22:16 2007 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 13 Jul 2007 08:22:16 -0400 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> References: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: <000401c7c548$73d00bc0$2f01a8c0@Kermit> The "goodie images" that come with VS 2005 are the standard boring icons and bitmaps. I decided long ago to build my own "goodie image" archive. There are a lot of great online resources for icons. My favorites are (in no particular order): http://www.seoconsultants.com/windows/icons/microsoft/ http://www.coolarchive.com/icons.php http://www.iconbazaar.com/ http://www.iconarchive.com/ Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:36:39 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:36:39 -0400 Subject: [dba-VB] Resource files In-Reply-To: <000401c7c548$73d00bc0$2f01a8c0@Kermit> Message-ID: <20070713123641.1E1DBBCEC@smtp-auth.no-ip.com> Thanks for the links. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:22 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Resource files The "goodie images" that come with VS 2005 are the standard boring icons and bitmaps. I decided long ago to build my own "goodie image" archive. There are a lot of great online resources for icons. My favorites are (in no particular order): http://www.seoconsultants.com/windows/icons/microsoft/ http://www.coolarchive.com/icons.php http://www.iconbazaar.com/ http://www.iconarchive.com/ Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:37:54 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:37:54 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <000301c7c547$eaa5c1f0$2f01a8c0@Kermit> Message-ID: <20070713123755.97D58BE5F@smtp-auth.no-ip.com> Yea, I was hoping that a member who uses C# might be able to translate this. I am such a nubee that I am clueless. I can translate syntax but not much more. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:18 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Fri Jul 13 07:48:22 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 13 Jul 2007 16:48:22 +0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070712222800.DE47FBD36@smtp-auth.no-ip.com> Message-ID: <000401c7c54c$19201db0$6401a8c0@nant> Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 08:10:46 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 09:10:46 -0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <000401c7c54c$19201db0$6401a8c0@nant> Message-ID: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com From ebarro at verizon.net Fri Jul 13 09:29:10 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 13 Jul 2007 07:29:10 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713120017.88743BEB8@smtp-auth.no-ip.com> Message-ID: <0JL4008KQG8EVZ2I@vms044.mailsrvcs.net> John, This compiled for me... Public Sub SetRootFolder(ByRef fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As Type = fbd.GetType() Dim fi As FieldInfo = t.GetField("rootFolder", BindingFlags.Instance Or BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub The error in your transposition had to do with defining t as System.Windows.Forms.FolderBrowserDialog that's why it was complaining when you set it to fbd.GetType() The variable t should have been defined as System.Type as in the original C# code... public static void SetRootFolder(System.Windows.Forms.FolderBrowserDialog fbd, CsIdl csidl) { Type t = fbd.GetType(); FieldInfo fi = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); } Eric -----Original Message----- From: jwcolby [mailto:jwcolby at colbyconsulting.com] Sent: Friday, July 13, 2007 5:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: RE: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: 7/12/2007 4:08 PM From ebarro at verizon.net Fri Jul 13 09:32:57 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 13 Jul 2007 07:32:57 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713123755.97D58BE5F@smtp-auth.no-ip.com> Message-ID: <0JL40085FGEPVMNI@vms044.mailsrvcs.net> Unfortunately most C# programmers don't even want to acknowledge VB.NET as being equal in the programming world. Hence they don't even care to be "ambidexterous" when it comes to programming in .NET. VB.NET is much more forgiving and you can forego a lot of declarations that C# will balk at and ask you to implicitly define in your code before you can use it. I learned .NET using VB.NET and since then I have been using C#. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:38 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Yea, I was hoping that a member who uses C# might be able to translate this. I am such a nubee that I am clueless. I can translate syntax but not much more. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:18 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jul 13 09:56:01 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 13 Jul 2007 09:56:01 -0500 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: I've used Axialis Icon Editor a lot. Let's you pull icons out of .exes, .dll's, etc. Handy tool, and a shell32.dll has a ton of them. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 10:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From shamil at users.mns.ru Fri Jul 13 10:10:28 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 13 Jul 2007 19:10:28 +0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Message-ID: <000601c7c55f$f2cffb30$6401a8c0@nant> Hello John, I have no clear idea why you do not get your WinForms controls updated if you raise and process(sink) events to update these controls in the same thread. Do you have one main (UI/WinForms) thread calling your long running code bulk insert code or this bulk insert is executed in another worker thread? <<< I continue to be amazed at how quickly you can do things in .Net >>> Yes, I agree, .NET 2.0 with VS2005 is the "dream come true"... <<< After hundreds of hours of hacking away I have yet to bind an object to data >>> John, have a look here: http://brewder.blogspot.com/2007/03/data-binding-classes-interfaces-and.html <<< Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! >>> Yes! Waaaaaaaaaa! :) I'm also still far from getting very closely familiar with this .NET Framework "behemoth"... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Jul 13 10:38:21 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 13 Jul 2007 08:38:21 -0700 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> References: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: We just use the WinXP images for stuff like that, John. The easiest way to handle images is with an ImageList control dropped on the form. Once you have pointed the control at an image file (or several if you like), you can copy that imageList control to other forms when you need it and just point to the image in the list. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 8:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Jul 13 10:47:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 13 Jul 2007 08:47:03 -0700 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> References: <000401c7c54c$19201db0$6401a8c0@nant> <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Message-ID: Boy, do I hear that, John! Most of the books are not very helpful in learning .Net for exactly the reasons you give. It was a big help to me to have worked extensively with ADO and to have done a lot of unbound stuff, so I didn't have to rely on binding and object to a data source before starting to work with it. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 6:11 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-i n-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 11:45:31 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 12:45:31 -0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <000601c7c55f$f2cffb30$6401a8c0@nant> Message-ID: <20070713164532.A0D62BD84@smtp-auth.no-ip.com> It is all one thread atm. However the event sinks function and code steps in there. I do DoEvents inside of those event sinks (on the main form) as soon as I update the form controls (in the event sinks). It works correctly when just running, but not when stepping through code. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 11:10 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I have no clear idea why you do not get your WinForms controls updated if you raise and process(sink) events to update these controls in the same thread. Do you have one main (UI/WinForms) thread calling your long running code bulk insert code or this bulk insert is executed in another worker thread? <<< I continue to be amazed at how quickly you can do things in .Net >>> Yes, I agree, .NET 2.0 with VS2005 is the "dream come true"... <<< After hundreds of hours of hacking away I have yet to bind an object to data >>> John, have a look here: http://brewder.blogspot.com/2007/03/data-binding-classes-interfaces-and.html <<< Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! >>> Yes! Waaaaaaaaaa! :) I'm also still far from getting very closely familiar with this .NET Framework "behemoth"... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 10:27:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 11:27:57 -0400 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com From chizotz at mchsi.com Wed Jul 18 11:53:45 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 18 Jul 2007 16:53:45 +0000 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> John, I know that there is a school of thought that this approach is inappropriate, but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER hive so each user has their own set of saved values, which is most often convenient for me. This example stores (in the form close event) the location, height, and width of the form, and (in the form open event) restores the form to that size and location. You should be able to easily adapt it for your needs. Ron (all syntax in C#, but should translate easily and well to VB) using Microsoft.Win32; //necessary include to get Registry classes In form close event: /* If form is maximized, minimized, or larger than the screen in either dimension, do not save size and position information */ if(this.WindowState != FormWindowState.Maximized && this.WindowState != FormWindowState.Minimized && this.Width <= Screen.PrimaryScreen.Bounds.Width && this.Height <= Screen.PrimaryScreen.Bounds.Height) { string regPath = @"Software\Tribune\Circ\CircTools\Settings"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey.GetValue("ResettingPositions").ToString() == "0") { regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey != null) { regKey.SetValue("X", Location.X); regKey.SetValue("Y", Location.Y); regKey.SetValue("H", this.Height); regKey.SetValue("W", this.Width); } } } In form open event: string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey == null) { regKey = Registry.CurrentUser.CreateSubKey(regPath); } if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) { Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); } if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) { this.Height = (int)regKey.GetValue("H"); this.Width = (int)regKey.GetValue("W"); } ---------------------- Original Message: --------------------- From: "jwcolby" To: Subject: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 15:31:33 +0000 > I need a way to store the values in controls as the form closes, such that > the form can the load those last values when it re-opens. I do things like > enter data in controls for server, database, table, paths to files etc. I > need the form to save those values so that the next time the form opens it > can retrieve those values and I don't have to key them in again every time. > > Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a > nubee) web sites? > > TIA, > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From chizotz at mchsi.com Wed Jul 18 11:59:00 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 18 Jul 2007 16:59:00 +0000 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <071820071659.25521.469E46D3000E2673000063B1219791336303010CD2079C080C03BF969B019607080C@mchsi.com> Oops. Copy and paste error in the code I sent. The variable regPath should be the same in both the form open and form close events, and in the code I sent it wasn't. I copied the code out of a form where I do other things with the registry too, and copied the wrong line where the value of regPath is set for the form close event. Sorry. ---------------------- Original Message: --------------------- From: chizotz at mchsi.com (Ron Allen) To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 16:53:46 +0000 > John, > > I know that there is a school of thought that this approach is inappropriate, > but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER > hive so each user has their own set of saved values, which is most often > convenient for me. > > This example stores (in the form close event) the location, height, and width > of the form, and (in the form open event) restores the form to that size and > location. You should be able to easily adapt it for your needs. > > Ron > > > > (all syntax in C#, but should translate easily and well to VB) > > using Microsoft.Win32; //necessary include to get Registry classes > > In form close event: > > /* > If form is maximized, minimized, or larger than > the screen in either dimension, do not save size > and position information > */ > if(this.WindowState != FormWindowState.Maximized && > this.WindowState != FormWindowState.Minimized && > this.Width <= Screen.PrimaryScreen.Bounds.Width && > this.Height <= Screen.PrimaryScreen.Bounds.Height) > { > string regPath = @"Software\Tribune\Circ\CircTools\Settings"; > RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey.GetValue("ResettingPositions").ToString() == "0") > { > regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; > regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey != null) > { > regKey.SetValue("X", Location.X); > regKey.SetValue("Y", Location.Y); > regKey.SetValue("H", this.Height); > regKey.SetValue("W", this.Width); > } > } > } > > In form open event: > > string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; > RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey == null) > { > regKey = Registry.CurrentUser.CreateSubKey(regPath); > } > if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) > { > Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); > } > if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) > { > this.Height = (int)regKey.GetValue("H"); > this.Width = (int)regKey.GetValue("W"); > } From ebarro at verizon.net Wed Jul 18 12:06:11 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 18 Jul 2007 10:06:11 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> Message-ID: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM From cfoust at infostatsystems.com Wed Jul 18 12:05:08 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 18 Jul 2007 10:05:08 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> References: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> Message-ID: The problem with using the registry is that a lot of IT departments are locking it down and require you to use the Documents and Settings folder to store current user stuff. We use XML for this purpose. We'll have an XML file that contains a variable number of elements, which all have a ReadOnly attribute set to False as the default. We use a class to retrieve values from the file and to save values to it. Similar to what we used to do with registry settings. You could have a FormsDefaults.XML file that contains a template element with default settings in it for any form you have saved custom settings for, and then the class could create a new element for each form that had saved settings. Not hard and it doesn't require any api calls to read. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen Sent: Wednesday, July 18, 2007 9:54 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults John, I know that there is a school of thought that this approach is inappropriate, but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER hive so each user has their own set of saved values, which is most often convenient for me. This example stores (in the form close event) the location, height, and width of the form, and (in the form open event) restores the form to that size and location. You should be able to easily adapt it for your needs. Ron (all syntax in C#, but should translate easily and well to VB) using Microsoft.Win32; //necessary include to get Registry classes In form close event: /* If form is maximized, minimized, or larger than the screen in either dimension, do not save size and position information */ if(this.WindowState != FormWindowState.Maximized && this.WindowState != FormWindowState.Minimized && this.Width <= Screen.PrimaryScreen.Bounds.Width && this.Height <= Screen.PrimaryScreen.Bounds.Height) { string regPath = @"Software\Tribune\Circ\CircTools\Settings"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey.GetValue("ResettingPositions").ToString() == "0") { regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey != null) { regKey.SetValue("X", Location.X); regKey.SetValue("Y", Location.Y); regKey.SetValue("H", this.Height); regKey.SetValue("W", this.Width); } } } In form open event: string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey == null) { regKey = Registry.CurrentUser.CreateSubKey(regPath); } if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) { Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); } if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) { this.Height = (int)regKey.GetValue("H"); this.Width = (int)regKey.GetValue("W"); } ---------------------- Original Message: --------------------- From: "jwcolby" To: Subject: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 15:31:33 +0000 > I need a way to store the values in controls as the form closes, such > that the form can the load those last values when it re-opens. I do > things like enter data in controls for server, database, table, paths > to files etc. I need the form to save those values so that the next > time the form opens it can retrieve those values and I don't have to key them in again every time. > > Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE > (to a > nubee) web sites? > > TIA, > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 12:24:04 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 13:24:04 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> Message-ID: <20070718172406.C2962BD32@smtp-auth.no-ip.com> This looks cool! Thanks, John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 18, 2007 1:06 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 12:36:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 13:36:42 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> Message-ID: <20070718173644.36F99BD1F@smtp-auth.no-ip.com> Except that is a c# solution. Sigh. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 18, 2007 1:06 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Wed Jul 18 14:20:04 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 19 Jul 2007 07:20:04 +1200 Subject: [dba-VB] Object Reference not set to an Object error Message-ID: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> I use an add on from DataDynamics called ActiveReports which alows me to produce dot net reports in a similar interface to Access (sort of). I have a connection string defined in my Web.Config file. I want to set the connection string of the report to this when the report is run. I have the following code which is supposed to check whether the report has a connection string already. If the report doesn't have a connection string then I don't want to add a connection string (because there is no data for the report), otherwise I want to replace the connection string with the one in the Web.Config. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToString <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBConnection").ConnectionString End If The problem is with the first line. If there is a connection string then it is replaced. If the report doesn't have a connection string then an error is raised at the first line saying "Object reference not set to an instance of an object". My guess is that this is because no data source is set at all for the report there is no ConnectionString object to compare to. Can anyone please help with the syntax for checking whether the data source object exists (then if it does I can make the replacement to the connectionString). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From ebarro at verizon.net Wed Jul 18 14:41:12 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 18 Jul 2007 12:41:12 -0700 Subject: [dba-VB] Object Reference not set to an Object error In-Reply-To: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <0JLE00D9U40N69W0@vms046.mailsrvcs.net> Use Try...Catch Try ' Statement which can cause an exception. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS tring <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon nection").ConnectionString End If Catch x As Type ' Statements for handling the exception Finally End Try 'Any cleanup code -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Wednesday, July 18, 2007 12:20 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Object Reference not set to an Object error I use an add on from DataDynamics called ActiveReports which alows me to produce dot net reports in a similar interface to Access (sort of). I have a connection string defined in my Web.Config file. I want to set the connection string of the report to this when the report is run. I have the following code which is supposed to check whether the report has a connection string already. If the report doesn't have a connection string then I don't want to add a connection string (because there is no data for the report), otherwise I want to replace the connection string with the one in the Web.Config. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS tring <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon nection").ConnectionString End If The problem is with the first line. If there is a connection string then it is replaced. If the report doesn't have a connection string then an error is raised at the first line saying "Object reference not set to an instance of an object". My guess is that this is because no data source is set at all for the report there is no ConnectionString object to compare to. Can anyone please help with the syntax for checking whether the data source object exists (then if it does I can make the replacement to the connectionString). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM From newsgrps at dalyn.co.nz Wed Jul 18 17:15:04 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 19 Jul 2007 10:15:04 +1200 Subject: [dba-VB] Object Reference not set to an Object error In-Reply-To: <0JLE00D9U40N69W0@vms046.mailsrvcs.net> References: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> <0JLE00D9U40N69W0@vms046.mailsrvcs.net> Message-ID: <20070718221539.HJMD16296.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks Eric, Another topic to digest. David At 19/07/2007, you wrote: >Use Try...Catch > >Try > ' Statement which can cause an exception. > If CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS >tring <> "" Then > CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = >System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon >nection").ConnectionString > End If > >Catch x As Type > ' Statements for handling the exception >Finally > >End Try 'Any cleanup code > > > >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson >Sent: Wednesday, July 18, 2007 12:20 PM >To: dba-vb at databaseadvisors.com >Subject: [dba-VB] Object Reference not set to an Object error > >I use an add on from DataDynamics called ActiveReports which alows me to >produce dot net reports in a similar interface to Access (sort of). > >I have a connection string defined in my Web.Config file. I want to set the >connection string of the report to this when the report is run. I have the >following code which is supposed to check whether the report has a >connection string already. If the report doesn't have a connection string >then I don't want to add a connection string (because there is no data for >the report), otherwise I want to replace the connection string with the one >in the Web.Config. > >If CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS >tring ><> "" Then > CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString >= >System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon >nection").ConnectionString >End If > >The problem is with the first line. If there is a connection string then it >is replaced. If the report doesn't have a connection string then an error >is raised at the first line saying "Object reference not set to an instance >of an object". My guess is that this is because no data source is set at >all for the report there is no ConnectionString object to compare to. > >Can anyone please help with the syntax for checking whether the data source >object exists (then if it does I can make the replacement to the >connectionString). > > >Regards > >David Emerson >Dalyn Software Ltd >Wellington, New Zealand >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > >No virus found in this incoming message. >Checked by AVG Free Edition. >Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 >6:30 PM > > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com From shamil at users.mns.ru Wed Jul 18 20:34:44 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Thu, 19 Jul 2007 05:34:44 +0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> Message-ID: <000601c7c9a4$fc3d16f0$6401a8c0@nant> Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 7:28 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 20:57:38 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 21:57:38 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <000601c7c9a4$fc3d16f0$6401a8c0@nant> Message-ID: <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> Shamil, Funny you should mention that. I was working on just such a class earlier this afternoon - from a book called Beginning Visual Basic .NET from Wrox. That book does not mention binding the form to the class though. It actually reads / writes the values out of the controls. I like the "binding" idea. Now all I have to do is figure out how to do that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, July 18, 2007 9:35 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil From jwcolby at colbyconsulting.com Thu Jul 19 09:59:47 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 10:59:47 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> I operate under Option Strict. I have a situation where I am trying to use code from a book. That code assigns an object type to a class, i.e. Dim lcls as clsSomething = SerializeData(... SerializeData returns an object. How do I cast Serialize data to return a type clsSomething so that I don't get the "option strict disallows..." error message? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Thu Jul 19 10:09:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 08:09:03 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> References: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> Message-ID: That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:00 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion I operate under Option Strict. I have a situation where I am trying to use code from a book. That code assigns an object type to a class, i.e. Dim lcls as clsSomething = SerializeData(... SerializeData returns an object. How do I cast Serialize data to return a type clsSomething so that I don't get the "option strict disallows..." error message? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 10:27:01 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 08:27:01 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> References: <000601c7c9a4$fc3d16f0$6401a8c0@nant> <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> Message-ID: The specific "how" is use the databindings properties of the form. Typed Datasets are the easiest to work with because even in design time, they know what the properties of their source is--fields, data types, etc. We normally create a class for each typed dataset, give it whatever business rules we want to enforce at the data level, and drag the class form the toolbox onto the form or user control. That creates the binding to the form and you can then control the binding to the controls in design view or through code. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 6:58 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Shamil, Funny you should mention that. I was working on just such a class earlier this afternoon - from a book called Beginning Visual Basic .NET from Wrox. That book does not mention binding the form to the class though. It actually reads / writes the values out of the controls. I like the "binding" idea. Now all I have to do is figure out how to do that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, July 18, 2007 9:35 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 10:48:41 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 11:48:41 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719154843.48102BF92@smtp-auth.no-ip.com> I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 11:13:19 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:13:19 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719154843.48102BF92@smtp-auth.no-ip.com> References: <20070719154843.48102BF92@smtp-auth.no-ip.com> Message-ID: John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 11:24:07 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 12:24:07 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 11:44:05 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 18:44:05 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 11:47:46 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:47:46 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> References: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> Message-ID: We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 cfoust at infostatsystems.com Thu Jul 19 11:49:07 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:49:07 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 12:02:43 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 19:02:43 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte So true. Nothing beats experience. Seems like while some of us overwhelmed are fooling around, you just do it. /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:49 >>> Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 12:06:16 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:06:16 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte So true. Nothing beats experience. Seems like while some of us overwhelmed are fooling around, you just do it. /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:49 >>> Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 12:18:38 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 19:18:38 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte You retire? Give me one good reason for that. /gustav >>> cfoust at infostatsystems.com 19-07-2007 19:06 >>> I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte From cfoust at infostatsystems.com Thu Jul 19 12:30:25 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:30:25 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: Hmmn. Death? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 10:19 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte You retire? Give me one good reason for that. /gustav >>> cfoust at infostatsystems.com 19-07-2007 19:06 >>> I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 12:35:38 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 13:35:38 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Well, I'm (slowly) learning how to do it. Unfortunately because I work alone it is tough to get the "doing it right" part. If I do it wrong there is no one looking over my shoulder telling me to "do it this way". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 mmattys at rochester.rr.com Thu Jul 19 12:45:47 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Thu, 19 Jul 2007 13:45:47 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion References: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Message-ID: <010a01c7ca2c$a560e130$0202a8c0@Laptop> Ooh! Ooh Ooh! I'll do it! - Horshack from 'Welcome Back, Kotter" Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" To: Sent: Thursday, July 19, 2007 1:35 PM Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > Well, I'm (slowly) learning how to do it. Unfortunately because I work > alone it is tough to get the "doing it right" part. If I do it wrong > there > is no one looking over my shoulder telling me to "do it this way". > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 12:48 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > We're LEARNING how to do it right OJT! LOL Our senior developer was the > only one who had any previous experience with .Net and we've blown past > the > firm we hired to advise us at the start of the project. And yes, it's > been > a lot of fun being in it from the ground up. > > Charlotte > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, July 19, 2007 9:24 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > Boy I must say you lucked out getting that job. I would die for an > opportunity to learn VB.Net OJT AND though a company that apparently > really > knows how to do it right! > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 12:13 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > John, > > We use typed datasets to handle the serialization. Then we can work with > the typed dataset in design view as if it were a real table. We do NOT > hand > build that code! It was easy to generate typed datasets in > 2003 but I keep forgetting how in 2005. It is well worth exploring though > for the work it saves. > >>>I was just about to ask about binding this to a form when your next > email came in. The only question I have is, is it possible to bind to a > class where the open event of the form itself is going to load the data > into > the class? It seems kinda "cart before the horse". > > What you do is bind to the class, which has no data in it at that point. > You have a setup routine in the form that either accepts a dataset or > fills > the one it already has. That's the advantage to working with the indirect > links offered by typed datasets and wrapper classes. We create various > Get > and Fill methods (Get returns a filled instance of the class object, Fill > populates a passed in instance) to accept parameters and populate the > class > with the data requested. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, July 19, 2007 8:49 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > I used DirectCast. And it all works. AMAZING!!! > > Charlotte, you probably use this all of the time. The example code builds > a > "serializable class" with functions that do the serialization in / out to > a > data stream, and functions that get a stream from / to a file. Then you > build a properties class that inherits the serializable class, which class > then allows you to define your properties. Since the properties class > inherits the code to serialize itself, it can do so without further adoo. > > I then use that in my form to store the control data into a properties > class > instance and can now store that out to an xml file using the .net > serializable stuff embedded in the inherited "serializable class". > Likewise retrieve it later. > > I have to say that the dim statement to do the restore is a mess though! > > To save: > Dim lclsIOData As New clsIOData > PopulateIODataFromForm(lclsIOData) > Dim strFileName As String = lclsIOData.mDataFileName("FormData") > lclsIOData.mSave(strFileName) > > To restore: > Dim lclsIOData As clsIOData > lclsIOData = > DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), > GetType(clsIOData)), clsIOData) > mPopulateFormFromIOData(lclsIOData) > > It is really a reasonably small amount of code setting up the serializable > class, but once done, any data class can be serialized to xml. From what > I > can understand I could also serialize it to a table if I wanted to simply > by > having another function that opened a stream to / from a table instead of > a > file. I will leave that for another day. > > Cool stuff. > > I was just about to ask about binding this to a form when your next email > came in. The only question I have is, is it possible to bind to a class > where the open event of the form itself is going to load the data into the > class? It seems kinda "cart before the horse". > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 11:09 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > That's one problem I always have with the books too, they tend to use a > lot > of implicit conversion. Of course, you learn a lot from making the > examples > work with option strict on. There are various ways to do it, John. You > can > use a Ctype() function to convert the object to a clsSomething like this: > Ctype(SerializeData(....), clsSomething). You can also use a DirectCast > function. > > Charlotte Foust > > > _______________________________________________ > 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 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 12:49:44 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:49:44 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> References: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Message-ID: Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 10:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, I'm (slowly) learning how to do it. Unfortunately because I work alone it is tough to get the "doing it right" part. If I do it wrong there is no one looking over my shoulder telling me to "do it this way". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 13:42:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 14:42:05 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte From cfoust at infostatsystems.com Thu Jul 19 14:01:11 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:01:11 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> References: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> Message-ID: >>It has to be easy. ROTFL There's your problem, right there!! Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 14:07:26 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:07:26 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> References: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> Message-ID: Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 14:10:04 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 21:10:04 +0200 Subject: [dba-VB] How I'm approaching the problem Message-ID: Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. From jwcolby at colbyconsulting.com Thu Jul 19 14:31:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:31:56 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719193157.E3430BD48@smtp-auth.no-ip.com> I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 14:33:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:33:25 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719193327.7EDFBBD43@smtp-auth.no-ip.com> I have found code to do that. How it works I haven't a clue but once I get it working I will show what it is. In my case it has to be local. Servers out on the internet are not usable in my business. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 3:10 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 14:36:34 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:36:34 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719193157.E3430BD48@smtp-auth.no-ip.com> References: <20070719193157.E3430BD48@smtp-auth.no-ip.com> Message-ID: Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 ebarro at verizon.net Thu Jul 19 14:49:04 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 19 Jul 2007 12:49:04 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719193327.7EDFBBD43@smtp-auth.no-ip.com> Message-ID: <0JLF00LV0Z1B32Y4@vms042.mailsrvcs.net> I have code that can query a database for its tables and the fields in those tables (SQL server-specific). -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:33 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I have found code to do that. How it works I haven't a clue but once I get it working I will show what it is. In my case it has to be local. Servers out on the internet are not usable in my business. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 3:10 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. _______________________________________________ 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.9/907 - Release Date: 7/18/2007 3:30 PM From jwcolby at colbyconsulting.com Thu Jul 19 14:56:01 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:56:01 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719195607.4216ABC02@smtp-auth.no-ip.com> >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 cfoust at infostatsystems.com Thu Jul 19 15:04:14 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 13:04:14 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719195607.4216ABC02@smtp-auth.no-ip.com> References: <20070719195607.4216ABC02@smtp-auth.no-ip.com> Message-ID: I see. You had mentioned that before but I forgot (blame my age LOL). I know about that kind of list from bitter experience, although the biggest ones I ever had to import were less than 100K names per list. But I also didn't have the benefits of .Net and had to work strictly in Access 97, which didn't make it fun. I still don't see the need to import the data into a database immediately when you could manipulate them in xml form until you got them the way you wanted and THEN import the data once and for all. You could park the rejects in another database for reference. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 16:02:26 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 17:02:26 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719210229.D676BBE9C@smtp-auth.no-ip.com> My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 4:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I see. You had mentioned that before but I forgot (blame my age LOL). I know about that kind of list from bitter experience, although the biggest ones I ever had to import were less than 100K names per list. But I also didn't have the benefits of .Net and had to work strictly in Access 97, which didn't make it fun. I still don't see the need to import the data into a database immediately when you could manipulate them in xml form until you got them the way you wanted and THEN import the data once and for all. You could park the rejects in another database for reference. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 _______________________________________________ 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 Jul 21 21:14:25 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 21 Jul 2007 19:14:25 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719210229.D676BBE9C@smtp-auth.no-ip.com> Message-ID: <0JLK002Q05ZSBFE4@l-daemon> Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. From jwcolby at colbyconsulting.com Sat Jul 21 23:51:17 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 00:51:17 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLK002Q05ZSBFE4@l-daemon> Message-ID: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. From pcs at azizaz.com Sun Jul 22 02:24:37 2007 From: pcs at azizaz.com (Borge Hansen) Date: Sun, 22 Jul 2007 17:24:37 +1000 Subject: [dba-VB] Address Processing References: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> Message-ID: <036401c7cc31$5cbad380$fa10a8c0@Albatross> Hi John, I've been following your threads on the subject of your SQL Server system on and off, the latest being: Subject: Re: [dba-VB] How I'm approaching the problem Where you wrote: "...The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity...." I am curious as to what your address processing entails...if you have been writing on this previously I missed it... Does the address processing entail returning geocode on the address? I am currently using Google's MAP API to process addresses and having them returned with a geocode including degree of accurary (street, suburb or zip).... I am using some javascript picked up somewhere on the internet.... The javascript uses a webpage textcontrol as the input for address processing (I copy and paste about 1,000 address records from an access table into the textcontrol), and outputs the data records returned from Google as tab delimited lines of text to another text control on the same webpage. So I can process about a 1,000 addresses at a time... but at present I have to manually copy and paste the processed addresses from the text control into a say Access table.... What I am after is code that allows me to use a table (Access or SQL) as input and another table for inserting the processed addresses.... Is this something you are doing? Anyone else who can help out here? Regards, Borge Hansen From jwcolby at colbyconsulting.com Sun Jul 22 11:07:17 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 12:07:17 -0400 Subject: [dba-VB] Address Processing In-Reply-To: <036401c7cc31$5cbad380$fa10a8c0@Albatross> Message-ID: <20070722160723.D36EFBD05@smtp-auth.no-ip.com> This business is about bulk mail addresses. My client buys lists of addresses from other list providers. Each list is basically a "poll" that someone answered or something similar. A million people filled out warranty cards when they bought a car, or filled out an online form when they visited a web site, or... Somehow they got their name on a list, but more importantly they gave other important information about themselves such as brands of tobacco used, soft drinks consumed, electronics purchased etc. It is really THAT information that is important about the person, because my client sells these names to advertisers targeting people who have dogs or cats (a dog / cat food mailing) or bought a certain brand of car 4 years ago (a dealership mailing). So... I get lists of names / addresses, with "demographics" information included. I pull the lists in to SQL Server. Why? Because my client then comes back to me and says "give me 100K names in these zips who purchased laundry detergent". So I have to have the info in SQL Server in order to do the where clauses on zips and demographics fields. As soon as I import the table, I immediately export the data back out for "address cleaning". These lists average about 20% "trash", addresses where the address was misspelled, no zip was given, or a completely fake address was supplied etc. So I export my own PKID, the name and address out to CSV files, up to 1 million records at a time. I send those addresses through a program that verifies the addresses. The first process is called CASS, which simply verifies that the address "matches" an address template. A second process (run at the same time, subsequent to CASS is called DPV which stands for delivery point validation. IOW, yea, it matches a template, but can it actually be delivered. The USPS provides databases of every valid address in the United States, and the addresses are run through this database to see if it is a "real address" (DPV) as opposed just "looks like a real address" (CASS). And finally, the address is then processed for NCOA or National Change of Address. That is a database (USPS) that says "yea, that person USED TO LIVE THERE but moved". So it is obvious why I do the processing. However I also need to re-process the data periodically in order to catch the moves. If John Colby moves from Connecticut to North Carolina, I want to discover that and stop sending mail to him in Connecticut and start sending it to him in NC. So every so often (monthly?) I will export the name / address back out and run it through the process again. CASS and DPV (theoretically) will get a 100% hit rate now because I already did that last time, but NCOA will catch a certain % of the people who moved. I use a dedicated program for doing this. There are too many variables for me to even consider "reinventing the wheel". These professional programs perform such functions as splitting names and addresses, standardizing abbreviations such as ST or ST. for Street etc. Those standardizing processes are required to get a hit on an address in the USPS database. If you are doing a few hundred names for your church or for some charity organization, you can visually scan the "fallout" data to see if you can pick up errors, but when processing 90 million names I never even look at the data, I just can't do that. So this professionally designed program handles a bunch of stuff in order to prepare the data for validation, performs the validation, and hands me back my PKID, name and address fields, plus about 40 other fields that tell me things about the data itself (political district, area code, etc) as well as data about why the data failed to validate in case I want to do processing on the rejects (I don't). In any event, this is not just a one shot deal. I pull the RAW data in, add a PK, Export the name / address, process that, import the resulting cleaned address data back into a DIFFERENT table, but related to the RAW data by my PK that I assigned to the raw data. Periodically I re-export / import for NCOA processing. Now when the client asks for 1 million names of people who own dogs I go to the table they tell me to, join the raw data to the address data, apply where clauses (zip to the cleaned address, demographics to the raw data), and pull the names and addresses out and export them for shipping to the purchaser of the names. We can tell the client that the data was last cleaned "X weeks ago" so that they know they are not spending money to send mail to bad addresses. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Sunday, July 22, 2007 3:25 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Address Processing Hi John, I've been following your threads on the subject of your SQL Server system on and off, the latest being: Subject: Re: [dba-VB] How I'm approaching the problem Where you wrote: "...The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity...." I am curious as to what your address processing entails...if you have been writing on this previously I missed it... Does the address processing entail returning geocode on the address? I am currently using Google's MAP API to process addresses and having them returned with a geocode including degree of accurary (street, suburb or zip).... I am using some javascript picked up somewhere on the internet.... The javascript uses a webpage textcontrol as the input for address processing (I copy and paste about 1,000 address records from an access table into the textcontrol), and outputs the data records returned from Google as tab delimited lines of text to another text control on the same webpage. So I can process about a 1,000 addresses at a time... but at present I have to manually copy and paste the processed addresses from the text control into a say Access table.... What I am after is code that allows me to use a table (Access or SQL) as input and another table for inserting the processed addresses.... Is this something you are doing? Anyone else who can help out here? Regards, Borge Hansen _______________________________________________ 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 Sun Jul 22 17:41:33 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 22 Jul 2007 15:41:33 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> Message-ID: <0JLL0046YQSWLTW1@l-daemon> Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 22 20:53:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 21:53:57 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLL0046YQSWLTW1@l-daemon> Message-ID: <20070723015404.F2E3ABCDF@smtp-auth.no-ip.com> ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 6:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try | to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ 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 Sun Jul 22 22:01:21 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 22 Jul 2007 20:01:21 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723015404.F2E3ABCDF@smtp-auth.no-ip.com> Message-ID: <0JLM00G2W2TVP6K5@l-daemon> Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 22, 2007 6:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 6:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try | to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 23 07:22:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 08:22:28 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLM00G2W2TVP6K5@l-daemon> Message-ID: <20070723122237.42363BE4A@smtp-auth.no-ip.com> Jim, Throw in the fact that I have to get real work done (process data for the client) and it really gets fun. That is why I have been working from the bottom up, getting those pieces written that allow me to actually process the lists, even if I have to manually run them from the click of a button, with hard coded constants for the parameters. It is good that I finally have a real paying project that requires SQL Server and VB.Net. Yea, having to learn them under the gun is stressful, but I have not succeeded in learning them in the past because I just didn't NEED them and I had too much other stuff to do to spend the hundreds of hours required to figure them out. Now I NEED them. I'll tell you, I really love VB.NET. As a dev language / environment it has everything that I want. That was not true before 2.0, but with the latest version it is complete enough to really do what I need. Yes, it is 10 times more complex than anything I have previously encountered, but a lot of the reason is that it provides so much more "out of the box". I am a class kind of guy and a programmer at heart, and this is very much my dream environment. It is just a matter of learning it well. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 11:01 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 22, 2007 6:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting From shamil at users.mns.ru Mon Jul 23 12:24:41 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Mon, 23 Jul 2007 21:24:41 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLM00G2W2TVP6K5@l-daemon> Message-ID: <000001c7cd4e$5ab9fcf0$6401a8c0@nant> All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> From jwcolby at colbyconsulting.com Mon Jul 23 12:37:33 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 13:37:33 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000001c7cd4e$5ab9fcf0$6401a8c0@nant> Message-ID: <20070723173742.D9657C1B3@smtp-auth.no-ip.com> Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Mon Jul 23 14:57:01 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Mon, 23 Jul 2007 23:57:01 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723173742.D9657C1B3@smtp-auth.no-ip.com> Message-ID: <001101c7cd63$a3ae3d30$6401a8c0@nant> <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 23 15:17:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 16:17:15 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070723201724.4F8A7BEC5@smtp-auth.no-ip.com> Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Tue Jul 24 02:12:21 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 11:12:21 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723201724.4F8A7BEC5@smtp-auth.no-ip.com> Message-ID: <000a01c7cdc1$fb01f460$6401a8c0@nant> Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 08:52:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 09:52:59 -0400 Subject: [dba-VB] VB.Net Message-ID: <20070724135310.20ABDBC8E@smtp-auth.no-ip.com> I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com From James at fcidms.com Tue Jul 24 09:05:45 2007 From: James at fcidms.com (James Barash) Date: Tue, 24 Jul 2007 10:05:45 -0400 Subject: [dba-VB] VB.Net In-Reply-To: <20070724135310.20ABDBC8E@smtp-auth.no-ip.com> Message-ID: <005f01c7cdfb$baf45a90$800101df@fci.local> John: You want: DateTime.Now.ToString("yyyyMMdd-hhmmss") James Barash -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 9:53 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 09:26:20 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 10:26:20 -0400 Subject: [dba-VB] VB.Net In-Reply-To: <005f01c7cdfb$baf45a90$800101df@fci.local> Message-ID: <20070724142630.E5045BC93@smtp-auth.no-ip.com> Thanks James. It turns out that I was mixing up the CASE of the characters and ending up with totally weird formatted strings as you might imagine. Once I found the help for the format for dates and used the correct characters, in the correct case (upper / lower) then it started working just fine. Thanks again for the response. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of James Barash Sent: Tuesday, July 24, 2007 10:06 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net John: You want: DateTime.Now.ToString("yyyyMMdd-hhmmss") James Barash -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 9:53 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 10:02:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 11:02:25 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000a01c7cdc1$fb01f460$6401a8c0@nant> Message-ID: <20070724150235.C5CE4BD9E@smtp-auth.no-ip.com> Shamil, >Would that have any (economical) sense for your customer to improve DB bulk loading time? I don't understand the context - would what have any economical sense? >Why you do not use 64 bit .Net Framework to run your code on the server side? My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. First, I am a one man show with a month by month budget. Second, In order to get maximum bang for my hard earned dollar I build my own systems. I was talking to the owner of the company that does my address validation and they just spend $25,000 for a DELL server with 32 megs of data and windows 2003 x64. I don't have that kind of money. When you buy a DELL (as an example) then getting Windows x64 to install is a simple click of the button on the order page. Getting windows x64 to install on a desktop is not so simple, with issues for ALL of the drivers from video, network, disk etc. When I built the workstations I use to run SQL Server I did not understand the size of the task; Now I do. I will be building a new server this fall with a server motherboard, designed and certified to run the X64 versions of windows, with drivers supplied etc. It will be a dual processor / 8 core machine which will contain 32 megs or ram to start, 64 megs eventually. I MAY be able to get Windows 2003 x64 to run on the current servers, and if I can then I will but I am not holding my breath. Even if I can, they max out at 8 megs of ram that they can address so they will still be underpowered for my purpose. >Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? I am still working through that. The third party lib, DataStreams from www.csvreader.com Has a set of objects (readers) which can read and write streams to and from files. The docs are complete but the examples are sparse! However the author is available on his forums to answer questions and generally responds within a few hours. Basically what happens is that you instantiate one of the reader objects, tell the object what data type each column will be and then pass in a stream from that object to the SQLBulkCopy object. The DataStreams reader object handles all of the opening of the file, parsing the CSV file into an array and writing the array data into the stream. It appears to handle chunks of data so that the entire file does not have to fit into memory at once. With a CSV file, typically there is a header line in the first row. DataStreams reads that in and does the mapping for you if that row exists. He also has methods for obtaining the collection of field names etc, so I am actually building code to automatically build a table in SQL Server based on the names in the field names collection, plus a PK column of my own (long autoincrement) out at the end. His code correctly feeds the data into the table IF the columns from the file are the first columns, i.e. the PK is at the end of the table, but does not correctly handle the data feed if the PK is the first field in the table (and there is no PK field in the data). Remember that I have two distinct cases. 1) Data (lists) from vendors. These may have some "PK" of their own, but I do not know what it is or whether there will be one (typically not) so I just routinely build my own. 2) Data that I export from SQL Server, process, and get back from the address validation software. Those CSVs already have a PKID because my source tables have one and I export that PKID into the CSV file when I do the export from SQL Server. Given the costs of the lib, I am very impressed with the implementation so far. He provides a record event to allow preprocessing data within each record being read before sending it off to the SQLBulkCopy. You can do anything you might imagine with such control - look for specific data values in a given field, skip the record based on such evaluations, modify the data in specific fields etc, all on-the-fly as the data moves from CSV to SQL Server. I believe it also handles fixed width files which is also on my plate. So basically I just outsourced one small but complex part of the project. It was easy to get working and seems pretty fast so I am happy with the results so far. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:05:18 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:05:18 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724160529.0F54FBD8E@smtp-auth.no-ip.com> Shamil, I have started logging the imports now so I can tell you the times to import (in time / tick counts) as soon as I do a bunch, which will be today. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:10:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:10:37 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724161047.DA2F0BC81@smtp-auth.no-ip.com> One issue I am running into is that I really want to be able to log the start / stop PKID of each record imported. I use an autoincrement in SQL Server, but I do not know how to get at the last PKID in these values "live" as the SQLBulkInsert runs. Is it possible to pull the value of a field back out of the SQLBulkInsert object? Do I have to execute a sql statement to "get" the value of the PKID of the last record before the import and the last record after the import? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com From Gustav at cactus.dk Tue Jul 24 11:12:45 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 24 Jul 2007 18:12:45 +0200 Subject: [dba-VB] How I'm approaching the problem Message-ID: Hi John Don't you subscribe to the Action Pack? The July update includes DVDs with Windows Vista Business 64 bit Windows Server 2003 R2 64 bit Windows Server 2008 Enterprise 64 bit Beta 3 That's not a running server, I know, but an important part ... /gustav >>> jwcolby at colbyconsulting.com 24-07-2007 17:02 >>> My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. From jwcolby at colbyconsulting.com Tue Jul 24 12:35:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 13:35:56 -0400 Subject: [dba-VB] The command object exception Message-ID: <20070724173606.D7354BCD1@smtp-auth.no-ip.com> I am trying to execute queries that build databases, build tables etc. When I executed the ExecuteNonQuery method with a query that built a database and the database already exists, I got an error returned of -2147217900. When I tried to execute a sql statement with a general error I got the same error returned. How do I get meaningful error codes back from ExecuteNonQuery? Try mobjCmd.ExecuteNonQuery() Catch ex As OleDbException Select Case ex.ErrorCode Case -2147217900 'database already exists so ignore the error Case Else MessageBox.Show(ex.Message) Return -3 End Select End Try John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 24 14:32:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 15:32:57 -0400 Subject: [dba-VB] Count of specific character Message-ID: <20070724193307.C3D38BE7E@smtp-auth.no-ip.com> Is there any single function that will return a count of a specific character in a string? I have a situation where (apparently) the header of a CSV file has the same field name twice. I am trying to determine what is going on, so I want to count the field separator characters in the header and the first line of real data to see if there are more fields in the header than in the data or if something else is going on. John W. Colby Colby Consulting www.ColbyConsulting.com From shamil at users.mns.ru Tue Jul 24 14:37:04 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 23:37:04 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070724150235.C5CE4BD9E@smtp-auth.no-ip.com> Message-ID: <000001c7ce2a$03a5e320$6401a8c0@nant> Hello John, <<< I don't understand the context - would what have any economical sense? >>> I meant does your customer need to make bulk loading any faster or not? You know one may fly Paris - NY using ordinary Boeing planes, one can use (in the past) Concord or even TU-144(!?) (http://en.wikipedia.org/wiki/Tupolev_Tu-144) - IOW does your customer still need Concord for their task or current very good Boeing solution is good enough for them now and for a long time in the future? I also mean we can try to find what is (if any) bottleneck of the current solution and "break" this bottleneck? Some tests (Dual Core 3MHz, 2GB, W2003 Server, simple IDE/SATA 7400rpm HDD) - the raw performance of reading a delimited by TAB char CSV file in .NET: Total Counter = 1011852 (1 million...) ElapsedTime = 3,359375 seconds ElapsedTime = 0,0559895833333333 minutes Total Counter = 10006092 (10 million...) ElapsedTime = 32,890625 seconds ElapsedTime = 0,548177083333333 minutes Total Counter = 100010952 (100 million...) ElapsedTime = 327,875 seconds ElapsedTime = 5,46458333333333 minutes Splitting of CSV file lines into array added... Total Counter = 1011852 (1 million...) ElapsedTime = 8,375 seconds ElapsedTime = 0,139583333333333 minutes ... (I didn't have time to test other cases of 10 and 100 million source file lines - please do if you have time...) Of course that is just reading the file - the open question is how closely this extreme files reading performance can be approached when such a file is bulk loaded into MS SQL Database? Join, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... I must say I'm very interested to return here next week, sorry for any inconvenience... -- Shamil P.S. Simple C# code used for testing (watch line wraps): using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long MAX_LIMIT = 1000000; // 00; string s = @"F:\Temp\XL\ConsoleApplication1\IN\testfile.txt"; long totalCounter = 0; long lineCounter = 0; DateTime startTime = DateTime.Now; while (totalCounter < MAX_LIMIT) { System.IO.TextReader rdr = new System.IO.StreamReader(s); lineCounter = 0; string inline = ""; char delimiter = (char)9; while ((inline = rdr.ReadLine())!=null) { string[] fields = inline.Split(delimiter); ++totalCounter; ++lineCounter; } rdr.Close(); } DateTime endTime = DateTime.Now ; TimeSpan elapsedTime = endTime - startTime; Console.WriteLine("File Line Counter = {0}", lineCounter.ToString()); Console.WriteLine("Total Counter = {0}", totalCounter.ToString()); Console.WriteLine("ElapsedTime = {0} seconds", elapsedTime.TotalSeconds.ToString()); Console.WriteLine("ElapsedTime = {0} minutes", elapsedTime.TotalMinutes.ToString()); } } } -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 7:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, >Would that have any (economical) sense for your customer to improve DB bulk loading time? I don't understand the context - would what have any economical sense? >Why you do not use 64 bit .Net Framework to run your code on the server side? My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. First, I am a one man show with a month by month budget. Second, In order to get maximum bang for my hard earned dollar I build my own systems. I was talking to the owner of the company that does my address validation and they just spend $25,000 for a DELL server with 32 megs of data and windows 2003 x64. I don't have that kind of money. When you buy a DELL (as an example) then getting Windows x64 to install is a simple click of the button on the order page. Getting windows x64 to install on a desktop is not so simple, with issues for ALL of the drivers from video, network, disk etc. When I built the workstations I use to run SQL Server I did not understand the size of the task; Now I do. I will be building a new server this fall with a server motherboard, designed and certified to run the X64 versions of windows, with drivers supplied etc. It will be a dual processor / 8 core machine which will contain 32 megs or ram to start, 64 megs eventually. I MAY be able to get Windows 2003 x64 to run on the current servers, and if I can then I will but I am not holding my breath. Even if I can, they max out at 8 megs of ram that they can address so they will still be underpowered for my purpose. >Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? I am still working through that. The third party lib, DataStreams from www.csvreader.com Has a set of objects (readers) which can read and write streams to and from files. The docs are complete but the examples are sparse! However the author is available on his forums to answer questions and generally responds within a few hours. Basically what happens is that you instantiate one of the reader objects, tell the object what data type each column will be and then pass in a stream from that object to the SQLBulkCopy object. The DataStreams reader object handles all of the opening of the file, parsing the CSV file into an array and writing the array data into the stream. It appears to handle chunks of data so that the entire file does not have to fit into memory at once. With a CSV file, typically there is a header line in the first row. DataStreams reads that in and does the mapping for you if that row exists. He also has methods for obtaining the collection of field names etc, so I am actually building code to automatically build a table in SQL Server based on the names in the field names collection, plus a PK column of my own (long autoincrement) out at the end. His code correctly feeds the data into the table IF the columns from the file are the first columns, i.e. the PK is at the end of the table, but does not correctly handle the data feed if the PK is the first field in the table (and there is no PK field in the data). Remember that I have two distinct cases. 1) Data (lists) from vendors. These may have some "PK" of their own, but I do not know what it is or whether there will be one (typically not) so I just routinely build my own. 2) Data that I export from SQL Server, process, and get back from the address validation software. Those CSVs already have a PKID because my source tables have one and I export that PKID into the CSV file when I do the export from SQL Server. Given the costs of the lib, I am very impressed with the implementation so far. He provides a record event to allow preprocessing data within each record being read before sending it off to the SQLBulkCopy. You can do anything you might imagine with such control - look for specific data values in a given field, skip the record based on such evaluations, modify the data in specific fields etc, all on-the-fly as the data moves from CSV to SQL Server. I believe it also handles fixed width files which is also on my plate. So basically I just outsourced one small but complex part of the project. It was easy to get working and seems pretty fast so I am happy with the results so far. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Tue Jul 24 14:54:44 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 23:54:44 +0400 Subject: [dba-VB] Count of specific character In-Reply-To: <20070724193307.C3D38BE7E@smtp-auth.no-ip.com> Message-ID: <000101c7ce2c$7b5ace60$6401a8c0@nant> Hello John, You can use System.Text.RegularExpressions (see for details in MSDN) - here is a C# sample: // count 'a' char occurrences string testString = "One car red car blue car"; MatchCollection matches = Regex.Matches(testString, "[a]"); Console.WriteLine(matches.Count.ToString()); Please take into account that Regex is not "lightning fast" - I mean experts do not recommend to rely on its speed to investigate/parse large amounts of text data in short time... If time is not an issue then Regex can do in a few (one!?) line of code many things, which manually written will take many more code lines. Although as I noted above manually written custom code could be (much) quicker than Regex to "pump through" large amounts of text data... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 11:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Count of specific character Is there any single function that will return a count of a specific character in a string? I have a situation where (apparently) the header of a CSV file has the same field name twice. I am trying to determine what is going on, so I want to count the field separator characters in the header and the first line of real data to see if there are more fields in the header than in the data or if something else is going on. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 15:29:16 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 16:29:16 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000001c7ce2a$03a5e320$6401a8c0@nant> Message-ID: <20070724202926.DD477BD76@smtp-auth.no-ip.com> Shamil, >John, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... Understood, I will answer so that it will be available for when you are back. >I meant does your customer need to make bulk loading any faster or not? The short answer is yes. The long answer is really that I did not buy the library to make the speed faster, I bought it to make the implementation (coding) faster by not having to handle this part myself. However to answer your question directly, I am moving to a model where I charge the client for each operation, i.e. for computer time. IOW, in each process that imports or exports data, the amount of time required to perform that process is logged, and will (eventually) be directly entered into a billing program. So the client will be billed for X hours of computer time, where A hours are used for import of raw data lists, B hours are used for address export, C hours are used for address validation (by a different server in my office), D hours are used to import the data back into the SQL Server database, etc. I will not be breaking the time down on the bill, I envision billing line items like $XXX for address import of raw data list XYZ $YYY for address validation of list QRS Etc. With luck (and hard work), someday soon these processes will run totally automatically, with no manual input from me. Thus I will be essentially charging for "process", not my personal time. This billing method allows the client to understand the overall costs. But by logging the actual times required for doing each part I can understand where my bottlenecks are, plan for upgrades to handle my requirements etc. So the faster it works the less I make and the more the client saves. 8-( Alternatively, the faster it runs the more lists I can run on a given machine in a given period of time. 8-) I am really trying to sell the customer on how efficient it is (vs. his old method) to import his lists, and then export / address validate / reimport them. The client does not understand the mechanics behind the process, nor does he want to or care to. What he does understand is that it used to cost him (literally) $1.25 / thousand names to get addresses validated. I can do it for $.12 / thousand names, or about 1/10th his previous cost. Not only can I do it for that, I can make a killing doing it at that cost, IF I can move the frequency up to once per month or even every three months. The lists have to be reprocessed every X time units, perhaps monthly, perhaps quarterly. Again, by being able to demonstrate efficiency, I can convince the client that is cost effective to use my service, and also cost effective to perform this service monthly instead of waiting every six months or every year. He gets to sell his business by marketing "addresses cleaned monthly", and believe me that is important to his client. I doubt he will drop his cost to pass on the cost savings so he ends up making more / thousand names since he is now paying way less to do that process. His previous provider was so expensive that he literally did the address validation on each order and passed the cost through. I want a business model where he can afford (and he CAN!) to do this process monthly on each of his lists. Thus I get an income stream that I can depend on, and I get a process that does not cost me MY TIME, but rather sells the client my computer's time. "More work, more / faster computers" instead of "more work, more of MY TIME". I want to be sitting on the beach while my computers are earning me money. So yea, it always pays to do something faster, whether in my ability to make more money on each hour of machine time, or my ability to be more efficient and sell that to the client and get more work. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, <<< I don't understand the context - would what have any economical sense? >>> I meant does your customer need to make bulk loading any faster or not? You know one may fly Paris - NY using ordinary Boeing planes, one can use (in the past) Concord or even TU-144(!?) (http://en.wikipedia.org/wiki/Tupolev_Tu-144) - IOW does your customer still need Concord for their task or current very good Boeing solution is good enough for them now and for a long time in the future? I also mean we can try to find what is (if any) bottleneck of the current solution and "break" this bottleneck? Some tests (Dual Core 3MHz, 2GB, W2003 Server, simple IDE/SATA 7400rpm HDD) - the raw performance of reading a delimited by TAB char CSV file in .NET: Total Counter = 1011852 (1 million...) ElapsedTime = 3,359375 seconds ElapsedTime = 0,0559895833333333 minutes Total Counter = 10006092 (10 million...) ElapsedTime = 32,890625 seconds ElapsedTime = 0,548177083333333 minutes Total Counter = 100010952 (100 million...) ElapsedTime = 327,875 seconds ElapsedTime = 5,46458333333333 minutes Splitting of CSV file lines into array added... Total Counter = 1011852 (1 million...) ElapsedTime = 8,375 seconds ElapsedTime = 0,139583333333333 minutes ... (I didn't have time to test other cases of 10 and 100 million source file lines - please do if you have time...) Of course that is just reading the file - the open question is how closely this extreme files reading performance can be approached when such a file is bulk loaded into MS SQL Database? Join, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... I must say I'm very interested to return here next week, sorry for any inconvenience... -- Shamil P.S. Simple C# code used for testing (watch line wraps): using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long MAX_LIMIT = 1000000; // 00; string s = @"F:\Temp\XL\ConsoleApplication1\IN\testfile.txt"; long totalCounter = 0; long lineCounter = 0; DateTime startTime = DateTime.Now; while (totalCounter < MAX_LIMIT) { System.IO.TextReader rdr = new System.IO.StreamReader(s); lineCounter = 0; string inline = ""; char delimiter = (char)9; while ((inline = rdr.ReadLine())!=null) { string[] fields = inline.Split(delimiter); ++totalCounter; ++lineCounter; } rdr.Close(); } DateTime endTime = DateTime.Now ; TimeSpan elapsedTime = endTime - startTime; Console.WriteLine("File Line Counter = {0}", lineCounter.ToString()); Console.WriteLine("Total Counter = {0}", totalCounter.ToString()); Console.WriteLine("ElapsedTime = {0} seconds", elapsedTime.TotalSeconds.ToString()); Console.WriteLine("ElapsedTime = {0} minutes", elapsedTime.TotalMinutes.ToString()); } } } From Chris.Foote at uk.thalesgroup.com Wed Jul 25 05:38:29 2007 From: Chris.Foote at uk.thalesgroup.com (Foote, Chris) Date: Wed, 25 Jul 2007 11:38:29 +0100 Subject: [dba-VB] Count of specific character Message-ID: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV > file has the same > field name twice. I am trying to determine what is going on, > so I want to > count the field separator characters in the header and the > first line of > real data to see if there are more fields in the header than > in the data or > if something else is going on. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Jul 25 08:20:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 25 Jul 2007 09:20:05 -0400 Subject: [dba-VB] Count of specific character In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Message-ID: <20070725132017.45122BC2A@smtp-auth.no-ip.com> Wow. That does work. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 6:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 DWUTKA at Marlow.com Wed Jul 25 08:08:21 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 25 Jul 2007 08:08:21 -0500 Subject: [dba-VB] Count of specific character In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> References: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Message-ID: Neat trick, you could do that with Replace in VB. Len(strTemp)-Len(Replace(strTemp,"X","")) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 5:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From ebarro at verizon.net Wed Jul 25 09:07:29 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 25 Jul 2007 07:07:29 -0700 Subject: [dba-VB] Count of specific character In-Reply-To: Message-ID: <0JLQ007KNN7CGNW3@vms046.mailsrvcs.net> And in .NET (both VB and C#)... strTemp.Length - strTemp.Replace("X", "").Length -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, July 25, 2007 6:08 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Count of specific character Neat trick, you could do that with Replace in VB. Len(strTemp)-Len(Replace(strTemp,"X","")) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 5:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.19/917 - Release Date: 7/25/2007 1:16 AM From jwcolby at colbyconsulting.com Fri Jul 27 09:49:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 27 Jul 2007 10:49:23 -0400 Subject: [dba-VB] VB.Net - Proxy Class Message-ID: <20070727144938.81890BF2D@smtp-auth.no-ip.com> I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Jul 27 10:14:13 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jul 2007 08:14:13 -0700 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727144938.81890BF2D@smtp-auth.no-ip.com> References: <20070727144938.81890BF2D@smtp-auth.no-ip.com> Message-ID: John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jul 27 10:13:27 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jul 2007 10:13:27 -0500 Subject: [dba-VB] Odd problem with VB 6 application Message-ID: This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Jul 27 11:31:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 27 Jul 2007 12:31:32 -0400 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: Message-ID: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> Charlotte, Thanks for that. In fact I am examining using back ground threads to handle the process class work, however not knowing as much as I need to about VB.Net and .Net in general I want to get the entire process running (so I can do work) and then go investigate and use threads and background workers. In the meantime, what I am think of is a "middle man" class. The form knows about the middle man and can sink its events. The middle man can sink events from any class that implements a certain interface (but I think that is the wrong terminology here). The middle man sinks events from any class that can raise those events, and just immediately raises its own event, identically named, passing the parameters on. I have something similar to in concept but not exactly the same in implementation already working in VBA. I call it a message class. A message class is instantiated. It has a method that is called to send a message. Anyone with a pointer to the message class instance can call a method of the class instance and send a message. The message class simply raises an event and passes on the message. Anyone with a pointer to the message class can sink its events and receive any message. The message class is a middleman. Each end has to know about and get a pointer to the a clsMessage instance but they do not have to know about each other specifically. clsProcess needs to send a message. It gets a pointer to a clsMessage instance, calls a method of that instance and sends the message. clsMonitor needs to monitor clsProcess. It gets a pointer to the clsMessage instance and sinks it's events. Whenever clsProcess sends a message, it is passed through clsMessage and received by clsMonitor. clsMonitor can receive messages from ANY clsProcess (or any other class that sends messages on that instance of clsMessage). clsProcess can send messages and not worry about whether anyone is listening. If some class wants to log clsProcess' messages they can, if some other class wants to display clsProcess' messages on a form, they can etc. Loosely coupled interface, implemented through a common class instance. In fact messages can be sent back and forth between two classes or 100 classes, all listening on the message channel. BTW, a demo of that is on my web site in the WithEvents demo section. So I am looking to implement a similar construct here. In .Net though I have more flexibility in implementation because there are more capabilities available. Real inheritance, casting of an object to a specific data type etc. I do not know whether I can do what I am struggling to conceptualize. I want a process class to raise events. This allows the loosely coupled interface on the sending end. I want a proxy class instance to sink those events and retransmit them I want a progress form to sink events from a specific proxy class instance and use them. This allows the loosely coupled interface in the receiving end. The proxy class in the middle is the issue. IF I could create a clsProxy instance, pass in clsProcess to that instance as an OBJECT, then cast that object to a class that can be used WithEvents in a dim statement I would be there. I do not know how to do this. I can use the message class concept, I have already implemented that in VBA. That has the disadvantage of having to set up the message class instance and passing it in to the process class and to the progress form, but it is a lot more straightforward, and I can do that right now. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, July 27, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Fri Jul 27 11:54:45 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jul 2007 09:54:45 -0700 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> References: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> Message-ID: We use custom exception handlers, for example, and other "helper" classes. In the catch of a try-catch pair, we call the exception handler and pass it the exception and pops up a message ... But only for unhandled exceptions. We handle data exceptions in the data entity classes we create and pass the exception with custom message back to the calling object. We let the calling object then call a validationhelper class to handle the exception result it got, and that's were we pop up the messagebox and allow the user the OK or cancel options. We've tried to keep the model as untangled as possible, and the results affect the UI, so we make one-step jumps rather than daisy chaining events. I'm not sure whether that equates to what you're describing or not. We may, in fact, raise an event from a usercontrol, sink it in the parent of that usercontrol and raise another event from the parent to broadcast the result, if that's what you're describing. As for interface, we have defined interface classes, for instance for iToolbars and iValidation, which when implemented insert their shells into the object implementing them. In that object, we build code appropriate to whatever the event should do in that particular object. iValidation includes an IsValid function that accepts a feedbackstyle argument. The code in the object that implements it calls into the data entity class to validate a record before trying to update it. The validate event of the dataentity accepts a datarow uses the business rules tests in the entity and returns a boolean value for whether all the tests pass on the row. The calling object gets the boolean value back and if the record is valid, it save it. If it is not valid, it calls the ValidationHelper class to handle the exception message. That keeps up from changing something in the "middle" that breaks a bunch of other things. I don't know if that helps or not, because you're coming from a slightly different direction. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 9:32 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class Charlotte, Thanks for that. In fact I am examining using back ground threads to handle the process class work, however not knowing as much as I need to about VB.Net and .Net in general I want to get the entire process running (so I can do work) and then go investigate and use threads and background workers. In the meantime, what I am think of is a "middle man" class. The form knows about the middle man and can sink its events. The middle man can sink events from any class that implements a certain interface (but I think that is the wrong terminology here). The middle man sinks events from any class that can raise those events, and just immediately raises its own event, identically named, passing the parameters on. I have something similar to in concept but not exactly the same in implementation already working in VBA. I call it a message class. A message class is instantiated. It has a method that is called to send a message. Anyone with a pointer to the message class instance can call a method of the class instance and send a message. The message class simply raises an event and passes on the message. Anyone with a pointer to the message class can sink its events and receive any message. The message class is a middleman. Each end has to know about and get a pointer to the a clsMessage instance but they do not have to know about each other specifically. clsProcess needs to send a message. It gets a pointer to a clsMessage instance, calls a method of that instance and sends the message. clsMonitor needs to monitor clsProcess. It gets a pointer to the clsMessage instance and sinks it's events. Whenever clsProcess sends a message, it is passed through clsMessage and received by clsMonitor. clsMonitor can receive messages from ANY clsProcess (or any other class that sends messages on that instance of clsMessage). clsProcess can send messages and not worry about whether anyone is listening. If some class wants to log clsProcess' messages they can, if some other class wants to display clsProcess' messages on a form, they can etc. Loosely coupled interface, implemented through a common class instance. In fact messages can be sent back and forth between two classes or 100 classes, all listening on the message channel. BTW, a demo of that is on my web site in the WithEvents demo section. So I am looking to implement a similar construct here. In .Net though I have more flexibility in implementation because there are more capabilities available. Real inheritance, casting of an object to a specific data type etc. I do not know whether I can do what I am struggling to conceptualize. I want a process class to raise events. This allows the loosely coupled interface on the sending end. I want a proxy class instance to sink those events and retransmit them I want a progress form to sink events from a specific proxy class instance and use them. This allows the loosely coupled interface in the receiving end. The proxy class in the middle is the issue. IF I could create a clsProxy instance, pass in clsProcess to that instance as an OBJECT, then cast that object to a class that can be used WithEvents in a dim statement I would be there. I do not know how to do this. I can use the message class concept, I have already implemented that in VBA. That has the disadvantage of having to set up the message class instance and passing it in to the process class and to the progress form, but it is a lot more straightforward, and I can do that right now. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, July 27, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting 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 shamil at users.mns.ru Fri Jul 27 12:56:14 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 27 Jul 2007 21:56:14 +0400 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727144938.81890BF2D@smtp-auth.no-ip.com> Message-ID: <000501c7d077$6cae5b00$6401a8c0@nant> Hello John, Beware! - you're entering tricky world of threads, events and delegates (you never know what happens next in this world I mean). Be especially careful with sending notification to the form (thread) from worker processes - as Charlotte noted here System.ComponentModel.BackgroundWorker is the most safe solution for this case while you're getting through learning curve.... Sample code without using System.ComponentModel.BackgroundWorker and not tested with WinForms - just use VB.NET console application to run it (watch line wraps): ============ Imports System.Threading Imports System.Collections.Generic Module SSTestOfEventsAndDelegates ' // Delegate declaration Public Delegate Sub TestEventDelegate(ByVal objectId As Long, ByVal msgId As Integer) ' // main object (form simulator) Public Class TestForm Private WithEvents _proxy _ As New TestProcessEventsProxy() Private _testCount As Integer = 0 Private Sub _proxy_TestEvent(ByVal objectId As Long, ByVal msgId As Integer) _ Handles _proxy.TestEvent Console.WriteLine("TestForm: Message {0}.{1} arrived.", msgId, objectId) _testCount += 1 End Sub Public Sub Test() _proxy.Test() Dim startTime As DateTime = DateTime.Now Dim ts As TimeSpan = TimeSpan.MinValue Dim currentTime As DateTime = DateTime.MinValue While (_testCount < 9) And _ (ts < New TimeSpan(50000000)) '// 5s ts = DateTime.Now - startTime System.Threading.Thread.Sleep(250) Console.WriteLine("TestForm: Waiting for events, count = {0}, timeSpan = {1} s...", _ _testCount, ts.TotalSeconds) End While End Sub End Class ' // Proxy Public Class TestProcessEventsProxy Public Event TestEvent(ByVal Id As Long, ByVal msgId As Integer) Private _senders As List(Of System.Threading.Thread) = _ New List(Of System.Threading.Thread)() Public Sub Test() For i As Integer = 1 To 3 Dim newThread As System.Threading.Thread = _ New System.Threading.Thread(AddressOf myThread) newThread.Start() _senders.Add(newThread) Next i End Sub Protected Sub myThread() Dim obj As New TestProcess(AddressOf TestEventHook) obj.Test() End Sub Public Sub TestEventHook(ByVal objectId As Long, ByVal msgId As Integer) Console.WriteLine("Proxy: Message {0}.{1} is to be retransmitted.", objectId, msgId) RaiseEvent TestEvent(objectId, msgId) Console.WriteLine("Proxy: Message {0}.{1} has been retransmitted.", objectId, msgId) End Sub End Class ' // worker process Public Class TestProcess Private Shared _id As Long = 0 Private _myId As Long Private _myDelegate As TestEventDelegate Private _myMessageId As Long = 0 Public Sub New(ByRef eventDeleGate As TestEventDelegate) _myId = Interlocked.Increment(_id) _myDelegate = eventDeleGate End Sub Public Sub Test() For i As Integer = 1 To 3 _mymessageId += 1 System.Threading.Thread.Sleep(300) Console.WriteLine("Process: Message {0}.{1} is to be sent.", _myId, _myMessageId) _myDelegate.Invoke(_myId, _myMessageId) Console.WriteLine("Process: Message {0}.{1} has been sent.", _myId, _myMessageId) Next i End Sub End Class '// test Sub Main() Dim obj As New TestForm() obj.Test() End Sub End Module My results: =========== TestForm: Waiting for events, count = 0, timeSpan = 0 s... Process: Message 2.1 is to be sent. Process: Message 1.1 is to be sent. Proxy: Message 2.1 is to be retransmitted. Proxy: Message 1.1 is to be retransmitted. TestForm: Message 1.2 arrived. Proxy: Message 2.1 has been retransmitted. Process: Message 2.1 has been sent. Process: Message 3.1 is to be sent. Proxy: Message 3.1 is to be retransmitted. TestForm: Message 1.3 arrived. Proxy: Message 3.1 has been retransmitted. Process: Message 3.1 has been sent. TestForm: Message 1.1 arrived. Proxy: Message 1.1 has been retransmitted. Process: Message 1.1 has been sent. TestForm: Waiting for events, count = 3, timeSpan = 0,25 s... Process: Message 2.2 is to be sent. Proxy: Message 2.2 is to be retransmitted. TestForm: Message 2.2 arrived. Proxy: Message 2.2 has been retransmitted. Process: Message 2.2 has been sent. Process: Message 3.2 is to be sent. Proxy: Message 3.2 is to be retransmitted. TestForm: Message 2.3 arrived. Proxy: Message 3.2 has been retransmitted. Process: Message 1.2 is to be sent. Proxy: Message 1.2 is to be retransmitted. TestForm: Message 2.1 arrived. Proxy: Message 1.2 has been retransmitted. Process: Message 1.2 has been sent. Process: Message 3.2 has been sent. TestForm: Waiting for events, count = 6, timeSpan = 0,5 s... Process: Message 2.3 is to be sent. Proxy: Message 2.3 is to be retransmitted. TestForm: Message 3.2 arrived. Proxy: Message 2.3 has been retransmitted. Process: Message 2.3 has been sent. Process: Message 1.3 is to be sent. Proxy: Message 1.3 is to be retransmitted. TestForm: Message 3.1 arrived. Proxy: Message 1.3 has been retransmitted. Process: Message 1.3 has been sent. Process: Message 3.3 is to be sent. Proxy: Message 3.3 is to be retransmitted. TestForm: Message 3.3 arrived. Proxy: Message 3.3 has been retransmitted. Process: Message 3.3 has been sent. TestForm: Waiting for events, count = 9, timeSpan = 0,75 s... Press any key to continue . . . -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 6:49 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 27 20:20:14 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Sat, 28 Jul 2007 11:20:14 +1000 Subject: [dba-VB] Odd problem with VB 6 application References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289B06@ddi-01.DDI.local> Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Sat Jul 28 03:47:38 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 28 Jul 2007 03:47:38 -0500 Subject: [dba-VB] Odd problem with VB 6 application In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D01289B06@ddi-01.DDI.local> Message-ID: Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From shamil at users.mns.ru Sat Jul 28 05:29:28 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Sat, 28 Jul 2007 14:29:28 +0400 Subject: [dba-VB] Odd problem with VB 6 application In-Reply-To: Message-ID: <000001c7d102$2d8e9fd0$6401a8c0@nant> <<< You have to disable UAC. Not sure about regserver, but I assume it's the same. >>> Rather smooth workaround is to use INNO-Setup starting latest versions - just make simple installation of your ActiveX using INNO-Setup and you'll get manifest file automatically injected in it and this manifest file will elevate the user privileges on setup and will bypass UAC trouble... Not sure it works that way for very restricted Vista users but for standard non admin users it works that way - tested... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, July 28, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 28 12:51:13 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 28 Jul 2007 13:51:13 -0400 Subject: [dba-VB] VB.Net - Can tables be streams? Message-ID: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> I have a "serializable" class that serializes the data from a form to stream. Currently the stream is written to file. I am wondering if I can write it to a table instead by substituting a different kind of stream? John W. Colby Colby Consulting www.ColbyConsulting.com From shamil at users.mns.ru Sat Jul 28 17:41:19 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Sun, 29 Jul 2007 02:41:19 +0400 Subject: [dba-VB] VB.Net - Can tables be streams? In-Reply-To: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> Message-ID: <000f01c7d168$6a3a0620$6401a8c0@nant> Hello John, You can try to use DataSet's ReadXml method to load a DataSet instance with data, which you can then persist to a table.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 28, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Can tables be streams? I have a "serializable" class that serializes the data from a form to stream. Currently the stream is written to file. I am wondering if I can write it to a table instead by substituting a different kind of stream? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mmattys at rochester.rr.com Sat Jul 28 19:39:23 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sat, 28 Jul 2007 20:39:23 -0400 Subject: [dba-VB] VB.Net - Can tables be streams? References: <000f01c7d168$6a3a0620$6401a8c0@nant> Message-ID: <002201c7d178$ea2cbe30$0202a8c0@Laptop> Reports have been coming in of strange, insane laughter coming from the Colby house ... echoing in the mountains ... Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: Sent: Saturday, July 28, 2007 6:41 PM Subject: Re: [dba-VB] VB.Net - Can tables be streams? > Hello John, > > You can try to use DataSet's ReadXml method to load a DataSet instance > with > data, which you can then persist to a table.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 28, 2007 9:51 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] VB.Net - Can tables be streams? > > I have a "serializable" class that serializes the data from a form to > stream. Currently the stream is written to file. I am wondering if I can > write it to a table instead by substituting a different kind of stream? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com From thewaddles at sbcglobal.net Sat Jul 28 19:40:18 2007 From: thewaddles at sbcglobal.net (Kevin Waddle) Date: Sat, 28 Jul 2007 17:40:18 -0700 Subject: [dba-VB] VB6 Datarepeater Code In-Reply-To: <000f01c7d168$6a3a0620$6401a8c0@nant> References: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> <000f01c7d168$6a3a0620$6401a8c0@nant> Message-ID: <001301c7d179$0a09c950$6600a8c0@TheWaddles> Hello, I am trying to recreate an Access continuous form in a VB6 exe using the datarepeater control. I have created a ActiveX control containing a TextBox and a CheckBox. These are bound to an Access mdb file. I can display and update the textbox but cannot get anything to display properly on the checkboxes. The control will display the checkbox as true only when the record is active. Does anyone have an example using the datarepeater control with a checkbox or another avenue to create a continuous form in VB6? Thank you, Kevin Chocolate moose: 1 medium size moose, 20 pounds chocolate. From mmattys at rochester.rr.com Sat Jul 28 19:54:24 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sat, 28 Jul 2007 20:54:24 -0400 Subject: [dba-VB] VB6 Datarepeater Code References: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> <000f01c7d168$6a3a0620$6401a8c0@nant> <001301c7d179$0a09c950$6600a8c0@TheWaddles> Message-ID: <003501c7d17b$060daa90$0202a8c0@Laptop> Kevin, I haven't an example, but maybe KB Article 197428 will help? http://support.microsoft.com/kb/197428 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Kevin Waddle" To: Sent: Saturday, July 28, 2007 8:40 PM Subject: [dba-VB] VB6 Datarepeater Code > Hello, > > I am trying to recreate an Access continuous form in a VB6 exe using the > datarepeater control. > > I have created a ActiveX control containing a TextBox and a CheckBox. > These are bound to an Access mdb file. > I can display and update the textbox but cannot get anything to display > properly on the checkboxes. > > The control will display the checkbox as true only when the record is > active. > > Does anyone have an example using the datarepeater control with a checkbox > or another avenue to create a continuous form in VB6? > > Thank you, > Kevin > > > Chocolate moose: 1 medium size moose, 20 pounds chocolate. > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com From michael at ddisolutions.com.au Sun Jul 29 19:10:45 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 30 Jul 2007 10:10:45 +1000 Subject: [dba-VB] Odd problem with VB 6 application References: <000001c7d102$2d8e9fd0$6401a8c0@nant> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289B07@ddi-01.DDI.local> Yeah I also use Inno for all VB6 deployments, or I used to. Most new projects are in .net these days. However I have to maintain a lot of VB6 code. I don't really want to do a full install for each minor change to a dll, know what I mean? I guess with Vista I wont have a choice. cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, 28 July 2007 8:29 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application <<< You have to disable UAC. Not sure about regserver, but I assume it's the same. >>> Rather smooth workaround is to use INNO-Setup starting latest versions - just make simple installation of your ActiveX using INNO-Setup and you'll get manifest file automatically injected in it and this manifest file will elevate the user privileges on setup and will bypass UAC trouble... Not sure it works that way for very restricted Vista users but for standard non admin users it works that way - tested... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, July 28, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 09:03:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 10:03:56 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code Message-ID: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Mon Jul 30 10:49:04 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 08:49:04 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> References: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> Message-ID: Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 11:04:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 12:04:22 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730160428.2B49BBCC8@smtp-auth.no-ip.com> LOL. Uhh.... Yea, sure... ;-) John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 11:44:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 12:44:53 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Mon Jul 30 12:03:28 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 10:03:28 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> References: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> Message-ID: No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 Mon Jul 30 12:12:29 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 13:12:29 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> Well... That is pretty hard to say but I think so. I pretty much just choose the defaults. I read somewhere that there can be issues caused by copying files from one computer to another. Something about the security kicking in because Windows XP marks the files as "coming from" a specific computer and now it is not being run on that computer. I have to wonder if it is related to that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 1:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Mon Jul 30 13:08:12 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 11:08:12 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> References: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> Message-ID: Don't know. We use source safe, so all our files get copied from the same location to the local drive. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 10:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Well... That is pretty hard to say but I think so. I pretty much just choose the defaults. I read somewhere that there can be issues caused by copying files from one computer to another. Something about the security kicking in because Windows XP marks the files as "coming from" a specific computer and now it is not being run on that computer. I have to wonder if it is related to that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 1:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 4 10:24:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 4 Jul 2007 11:24:23 -0400 Subject: [dba-VB] VB.Net - System.IO.Stream Message-ID: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> I am working with a library that wants a stream passed in. NOT a StreamReader, a plain old stream. According to the docs, Stream is supposed to be a member of System.IO but it does not appear to be. According to Microsoft's docs, Stream is supposed to be the base class and is supposed to be accessible. I cannot get at it. Does anyone know how to reference System.IO.Stream? John W. Colby Colby Consulting www.ColbyConsulting.com From chizotz at mchsi.com Wed Jul 4 12:34:48 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 4 Jul 2007 12:34:48 -0500 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> References: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> Message-ID: <5310128033.20070704123448@mchsi.com> Hi John, Stream is an abstract class so an instance can't be created. You need to create an instance of a specific type of stream then pass that. I've never used it, but I suspect what you need is a MemoryStream, you might want to check into that. Ron Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > I am working with a library that wants a stream passed in. NOT a > StreamReader, a plain old stream. According to the docs, Stream is supposed > to be a member of System.IO but it does not appear to be. According to > Microsoft's docs, Stream is supposed to be the base class and is supposed to > be accessible. I cannot get at it. > Does anyone know how to reference System.IO.Stream? --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com From gustav at cactus.dk Wed Jul 4 16:43:08 2007 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 04 Jul 2007 23:43:08 +0200 Subject: [dba-VB] Menu control Message-ID: Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From jwcolby at colbyconsulting.com Wed Jul 4 18:48:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 4 Jul 2007 19:48:37 -0400 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <5310128033.20070704123448@mchsi.com> Message-ID: <20070704234853.B108ABD83@smtp-auth.no-ip.com> Ron, Unfortunately intellisense is telling me that a type STREAM is required, and furthermore if I try to pass any of the subtypes the DLLs class constructor refuses to accept it. It seems that I cannot do a new on it but I may be able to somehow dim an instance of the base class. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen Sent: Wednesday, July 04, 2007 1:35 PM To: jwcolby Subject: Re: [dba-VB] VB.Net - System.IO.Stream Hi John, Stream is an abstract class so an instance can't be created. You need to create an instance of a specific type of stream then pass that. I've never used it, but I suspect what you need is a MemoryStream, you might want to check into that. Ron Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > I am working with a library that wants a stream passed in. NOT a > StreamReader, a plain old stream. According to the docs, Stream is > supposed to be a member of System.IO but it does not appear to be. > According to Microsoft's docs, Stream is supposed to be the base class > and is supposed to be accessible. I cannot get at it. > Does anyone know how to reference System.IO.Stream? --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From martyconnelly at shaw.ca Wed Jul 4 21:08:29 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Wed, 04 Jul 2007 19:08:29 -0700 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <20070704234853.B108ABD83@smtp-auth.no-ip.com> References: <20070704234853.B108ABD83@smtp-auth.no-ip.com> Message-ID: <468C529D.4030505@shaw.ca> I thought it was dedclared this way Imports System.IO Dim s As System.IO.Stream jwcolby wrote: >Ron, > >Unfortunately intellisense is telling me that a type STREAM is required, and >furthermore if I try to pass any of the subtypes the DLLs class constructor >refuses to accept it. It seems that I cannot do a new on it but I may be >able to somehow dim an instance of the base class. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen >Sent: Wednesday, July 04, 2007 1:35 PM >To: jwcolby >Subject: Re: [dba-VB] VB.Net - System.IO.Stream > >Hi John, > >Stream is an abstract class so an instance can't be created. You need to >create an instance of a specific type of stream then pass that. I've never >used it, but I suspect what you need is a MemoryStream, you might want to >check into that. > >Ron > > >Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > > > >>I am working with a library that wants a stream passed in. NOT a >>StreamReader, a plain old stream. According to the docs, Stream is >>supposed to be a member of System.IO but it does not appear to be. >>According to Microsoft's docs, Stream is supposed to be the base class >>and is supposed to be accessible. I cannot get at it. >> >> > > > >>Does anyone know how to reference System.IO.Stream? >> >> > > > > >--- >avast! Antivirus: Outbound message clean. >Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM >avast! - copyright (c) 1988-2007 ALWIL Software. >http://www.avast.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 > > > > > -- Marty Connelly Victoria, B.C. Canada From Jdemarco at hudsonhealthplan.org Thu Jul 5 07:02:45 2007 From: Jdemarco at hudsonhealthplan.org (Jim DeMarco) Date: Thu, 5 Jul 2007 08:02:45 -0400 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: <0B8880A20E2CF24280FA60901E108FB08F28EF@TTNEXCHSVR.hshhp.com> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 5 09:15:26 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jul 2007 16:15:26 +0200 Subject: [dba-VB] Menu control Message-ID: Hi Jim It was something like this I had in mind: http://www.divil.co.uk/net/controls/eyefinder/rendering.aspx It is for VS2005. /gustav >>> Jdemarco at hudsonhealthplan.org 05-07-2007 14:02 >>> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From cfoust at infostatsystems.com Thu Jul 5 12:12:30 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 5 Jul 2007 10:12:30 -0700 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 5 12:35:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 5 Jul 2007 13:35:53 -0400 Subject: [dba-VB] Menu control In-Reply-To: Message-ID: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> >We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Jane, you ignorant slut (to quote one of my favorite SNL skits). I must say I can't for the life of me figure out WHY you would avoid a piece of trash that takes up 1/4 of the screen in low resolution modes. But that is of course just my own opinion. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 05, 2007 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 5 15:12:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 5 Jul 2007 13:12:03 -0700 Subject: [dba-VB] Menu control In-Reply-To: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> References: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> Message-ID: Why, John, what a sweet thing to say!! LOL We finally agree on something ... The ribbon, that is. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 05, 2007 10:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control >We basically give the user multiple ways to get at menu options and we >are actively avoiding *ribbons*!! Jane, you ignorant slut (to quote one of my favorite SNL skits). I must say I can't for the life of me figure out WHY you would avoid a piece of trash that takes up 1/4 of the screen in low resolution modes. But that is of course just my own opinion. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 05, 2007 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Jdemarco at hudsonhealthplan.org Fri Jul 6 13:17:51 2007 From: Jdemarco at hudsonhealthplan.org (Jim DeMarco) Date: Fri, 6 Jul 2007 14:17:51 -0400 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: <0B8880A20E2CF24280FA60901E108FB08F2961@TTNEXCHSVR.hshhp.com> That's a nice looking control eh? I think the one I just sent you is older. Good luck, Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 05, 2007 10:15 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control Hi Jim It was something like this I had in mind: http://www.divil.co.uk/net/controls/eyefinder/rendering.aspx It is for VS2005. /gustav >>> Jdemarco at hudsonhealthplan.org 05-07-2007 14:02 >>> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Mon Jul 9 20:35:54 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Tue, 10 Jul 2007 11:35:54 +1000 Subject: [dba-VB] Menu control References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289A19@ddi-01.DDI.local> Dotnetbar is my favourite. It covers just about every UI menu/toolbar style going back to Office 2000. It also does docking windows, which I like a lot. 200 USD IIRC. Well worth it IMO. http://www.devcomponents.com/dotnetbar/ cheers Michael M Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Tue Jul 10 03:08:17 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 10 Jul 2007 10:08:17 +0200 Subject: [dba-VB] Menu control Message-ID: Hi Michael Thanks! It seems to be very comprehensive ... /gustav >>> michael at ddisolutions.com.au 10-07-2007 03:35 >>> Dotnetbar is my favourite. It covers just about every UI menu/toolbar style going back to Office 2000. It also does docking windows, which I like a lot. 200 USD IIRC. Well worth it IMO. http://www.devcomponents.com/dotnetbar/ cheers Michael M Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From Gustav at cactus.dk Tue Jul 10 11:51:14 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 10 Jul 2007 18:51:14 +0200 Subject: [dba-VB] Cheat Sheets Message-ID: Hi all "Learn Visual Studio" http://www.learnvisualstudio.net has just published this set of syntax/overview/etc cards which you may find handy and useful: We've spent a lot of time developing these free cheat sheets, to make your experience with Microsoft Visual Studio, even easier. And the best part is they're free for anyone to download. So, print 'em out, put 'em on your bulletin board, in your wallet, or near your computer to help give you a gentle nudge as you're writing code. We have 6 cheat sheets available for you to download in PDF format. Choose the one that works best for you, or grab them all, they're your's now. Take a look; ------------------------------------------------------------------------- VB Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=5cbf7baf-aef6-47da-9862-609444c12aa4 ------------------------------------------------------------------------- C# Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=ef94e215-f654-4f1f-9ff3-3a48e3d987b0 ------------------------------------------------------------------------- ASP.NET Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=6cf3ecf8-668c-4614-9248-c75529149876 ------------------------------------------------------------------------- VB Toolbars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=83ebdfe5-6e9a-47c2-be3d-ee1077148bc3 ------------------------------------------------------------------------- C#Toolbars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=2116b801-40f6-49e7-868e-c7c90cbc5a1d ------------------------------------------------------------------------- Visual Web Developer Tool Bars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=f9f74ae8-6bfb-4288-91ab-aaba042dd63d Watch for word wraps. /gustav From jwcolby at colbyconsulting.com Tue Jul 10 22:24:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 10 Jul 2007 23:24:36 -0400 Subject: [dba-VB] Build table Message-ID: <20070711032439.67F66BE14@smtp-auth.no-ip.com> I need to build a table in SQL Server given a server name, database name, table name and a list of fields. I have a rough draft as follows: Public Function mCreateTbl() As Boolean Dim strSQL As String With csvData.Columns Dim strName As String strSQL = "CREATE TABLE [" & mstrDatabaseName & "].[dbo].[" & mstrTblName & "] (" & _ "[PKID] [int] IDENTITY (1, 1) NOT NULL " For Each strName In .Names strSQL = strSQL & ",[" & strName & "] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL " Next strName strSQL = strSQL & ") ON [PRIMARY] " & _ "GO()" Dim strSQLAddKey As String strSQLAddKey = "ALTER TABLE [dbo].[" & mstrTblName & "] WITH NOCHECK ADD " & _ "CONSTRAINT [PKID] PRIMARY KEY CLUSTERED (" & _ "[PKID]() " & _ ") ON [PRIMARY] " & _ "GO()" End With End Function I have not yet even started testing it to get the strings compilable in SQL Server but if and when it comes together, what would the database objects (ADO?) look like to execute such a beast? Is anyone doing such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com From mikedorism at verizon.net Wed Jul 11 05:56:12 2007 From: mikedorism at verizon.net (Doris Manning) Date: Wed, 11 Jul 2007 06:56:12 -0400 Subject: [dba-VB] Build table In-Reply-To: <20070711032439.67F66BE14@smtp-auth.no-ip.com> References: <20070711032439.67F66BE14@smtp-auth.no-ip.com> Message-ID: <000901c7c3aa$18f4c6e0$2f01a8c0@Kermit> John, You will need an ADO Connection object and an ADO Command object. You don't need to include "GO()" in the SQL Statement. You only use that when you are working in Query Analyzer. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 10, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Build table I need to build a table in SQL Server given a server name, database name, table name and a list of fields. I have a rough draft as follows: Public Function mCreateTbl() As Boolean Dim strSQL As String With csvData.Columns Dim strName As String strSQL = "CREATE TABLE [" & mstrDatabaseName & "].[dbo].[" & mstrTblName & "] (" & _ "[PKID] [int] IDENTITY (1, 1) NOT NULL " For Each strName In .Names strSQL = strSQL & ",[" & strName & "] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL " Next strName strSQL = strSQL & ") ON [PRIMARY] " & _ "GO()" Dim strSQLAddKey As String strSQLAddKey = "ALTER TABLE [dbo].[" & mstrTblName & "] WITH NOCHECK ADD " & _ "CONSTRAINT [PKID] PRIMARY KEY CLUSTERED (" & _ "[PKID]() " & _ ") ON [PRIMARY] " & _ "GO()" End With End Function I have not yet even started testing it to get the strings compilable in SQL Server but if and when it comes together, what would the database objects (ADO?) look like to execute such a beast? Is anyone doing such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 11 09:19:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 10:19:36 -0400 Subject: [dba-VB] Visual studio help Message-ID: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Wed Jul 11 10:14:20 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 11 Jul 2007 08:14:20 -0700 Subject: [dba-VB] Visual studio help In-Reply-To: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> References: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> Message-ID: By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 11 10:51:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 11:51:28 -0400 Subject: [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Wed Jul 11 11:04:55 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 11 Jul 2007 09:04:55 -0700 Subject: [dba-VB] Visual studio help In-Reply-To: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> References: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Message-ID: Oh, that!! The filtering stuff has gotten progressively worse in VS with each version. Mine comes up by default filtered by Infragistics Software, even though the help pane itself amy have brought up the VB Language Reference information for whatever I hit F1 on. You can set the filter and it should remember it next time you hit F1, but I never bother because I rock back and forth between VB.Net and the custom help for the 3rd party tools and SQL Server. The filter seems to be only loosely coupled to the help pane, so I wouldn't depend on it for much unless you like drilling down tree views. The search tab is what I always use. You can type in the word or phrase, set you language, technology and content and see a list of search hits. That usually works best for me, kind of like searching the MSKB. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:51 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com; 'Access Developers discussion and problem solving' Subject: Re: [dba-VB] Visual studio help Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 Wed Jul 11 11:14:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:14:53 -0400 Subject: [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711161456.9C2DFBC01@smtp-auth.no-ip.com> Well, the problem is that the filter seems to control whether anything will appear. Given that the only choices are SQL stuff, if I try to search for something specific to VB.net language nothing appears. And since I cannot change the filters to anything else... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 12:05 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help Oh, that!! The filtering stuff has gotten progressively worse in VS with each version. Mine comes up by default filtered by Infragistics Software, even though the help pane itself amy have brought up the VB Language Reference information for whatever I hit F1 on. You can set the filter and it should remember it next time you hit F1, but I never bother because I rock back and forth between VB.Net and the custom help for the 3rd party tools and SQL Server. The filter seems to be only loosely coupled to the help pane, so I wouldn't depend on it for much unless you like drilling down tree views. The search tab is what I always use. You can type in the word or phrase, set you language, technology and content and see a list of search hits. That usually works best for me, kind of like searching the MSKB. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:51 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com; 'Access Developers discussion and problem solving' Subject: Re: [dba-VB] Visual studio help Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 jwcolby at colbyconsulting.com Wed Jul 11 11:29:03 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:29:03 -0400 Subject: [dba-VB] [dba-SQLServer] Visual studio help In-Reply-To: <200707111605.l6BG50a6018086@databaseadvisors.com> Message-ID: <20070711162907.4016CBE1D@smtp-auth.no-ip.com> Robert, Yep, a reinstall of MSDN fixed the problem. Thanks for the heads up John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Wednesday, July 11, 2007 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Visual studio help John, The help files for Visual Studio are not installed automatically. You have to run the install on the MSDN disk(s) that came with it to get help of any kind. Robert At 10:51 AM 7/11/2007, you wrote: >Date: Wed, 11 Jul 2007 11:51:28 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] [dba-VB] Visual studio help >To: , > , "'Access Developers discussion and > problem solving'" >Message-ID: <20070711155131.9F8C9BE74 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Yes, but if you hit F1 then it opens a help file of some sort. I can >say whether it is going to use the local help or the internet help first etc. >As for books online, well... I only know that term in terms of SQL Server. > >1) Go into code. >2) Select some something, keyword, whatever. >3) Hit F1. > >What do you see? > >I see a help window. On the top blue bar it says "Microsoft Visual >Studio >2005 Documentation". That is a good sign. > >However on the left hand side there is a Pane (or PAIN depending on >your point of view), which has a "filter by" combo. The ONLY CHOICES >(for me) >are: > >SQL Server 2005 >SQL Server Analysis Service >SQL Server... >SQL Server... >SQL Server... >Etc etc. > >I am locked in to filtering on SQL Server help. I DON'T WANT SQL >SERVER HELP, I WANT VB HELP. > >Actually I want to be able to select VB, C#, Java, SQL Server and >whatever else is appropriate in the context I am using. I am flying >Visual Studio blind, unless all I am interested in is SQL Server help >in which case I am ducky. > >John W. Colby _______________________________________________ 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 Wed Jul 11 22:03:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 23:03:42 -0400 Subject: [dba-VB] Windows 2003 x64; SQL Server 2005 X64 Message-ID: <20070712030347.0B7E8BDA9@smtp-auth.no-ip.com> Is anyone out there running Windows 2003 X64? If so would you care to comment on what was involved in getting it to happen, drivers, getting the software etc. Same question for SQl Server 2005 X64. John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 17:27:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 18:27:59 -0400 Subject: [dba-VB] VB.Net - DoEvents Message-ID: <20070712222800.DE47FBD36@smtp-auth.no-ip.com> I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 22:25:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 23:25:15 -0400 Subject: [dba-VB] Resource files Message-ID: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 23:33:27 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 00:33:27 -0400 Subject: [dba-VB] Convert C to VB Message-ID: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com From newsgrps at dalyn.co.nz Thu Jul 12 23:41:35 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 13 Jul 2007 16:41:35 +1200 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> References: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <20070713043858.EMOF11149.fep01.xtra.co.nz@Dalyn.dalyn.co.nz> John, Try this site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx Regards David Emerson Dalyn Software Ltd Wellington, New Zealand At 13/07/2007, you wrote: >I need to convert a chunk of 'C#' code to Vb. The code apparently allows >you to get an expanded list of default values for the FolderBrowserDialog. > >It isn't much and I (believe I) have mostly figured it out. > >http://www.xoc.net/works/tips/folderbrowserdialog.asp > >So far I have: > >imports System; >imports System.Reflection; > >Public Class FolderBrowserDialogEx > '[Flags()] > Public Enum CsIdl > Desktop = &H0 ' Desktop > Internet = &H1 ' Internet Explorer (icon on desktop) > Programs = &H2 '// Start Menu\Programs > Controls = &H3 ' My Computer\Control Panel > Printers = &H4 ' My Computer\Printers > Personal = &H5 ' My Documents > Favorites = &H6 ' user name\Favorites > Startup = &H7 ' Start Menu\Programs\Startup > Recent = &H8 ' user name\Recent > SendTo = &H9 ' user name\SendTo > BitBucket = &HA ' desktop\Recycle Bin > StartMenu = &HB ' user name\Start Menu > MyDocuments = &HC ' logical "My Documents" desktop icon > MyMusic = &HD ' "My Music" folder > MyVideo = &HE ' "My Videos" folder > DesktopDirectory = &H10 ' user name\Desktop > Drives = &H11 ' My Computer > Network = &H12 ' Network Neighborhood (My Network Places) > Nethood = &H13 ' user name\nethood > Fonts = &H14 ' windows\fonts > Templates = &H0015, > CommonStartMenu = &H16 ' All Users\Start Menu > CommonPrograms = &H17 ' All Users\Start Menu\Programs > CommonStartup = &H18 ' All Users\Startup > CommonDesktopDirectory = &H19 ' All Users\Desktop > AppData = &H1A ' user name\Application Data > PrintHood = &H1B ' user name\PrintHood > LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non >roaming) > AltStartup = &H1D ' non localized startup > CommonAltStartup = &H1E ' non localized common startup > CommonFavorites = &H1F > InternetCache = &H20 > Cookies = &H21 > History = &H22 > CommonAppdata = &H23 ' All Users\Application Data > Windows = &H24 ' GetWindowsDirectory() > System = &H25 ' GetSystemDirectory() > ProgramFiles = &H26 ' C:\Program Files > MyPictures = &H27 ' C:\Program Files\My Pictures > Profile = &H28 ' USERPROFILE > SystemX86 = &H29 ' x86 system directory on RISC > ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC > ProgramFilesCommon = &H2B ' C:\Program Files\Common > ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC > CommonTemplates = &H2D ' All Users\Templates > CommonDocuments = &H2E ' All Users\Documents > CommonAdminTools = &H2F ' All Users\Start >Menu\Programs\Administrative Tools > AdminTools = &H30 ' user name\Start Menu\Programs\Administrative >Tools > Connections = &H31 ' Network and Dial-up Connections > CommonMusic = &H35 ' All Users\My Music > CommonPictures = &H36 ' All Users\My Pictures > CommonVideo = &H37 ' All Users\My Video > Resources = &H38 ' Resource Direcotry > ResourcesLocalized = &H39 ' Localized Resource Direcotry > CommonOemLinks = &H3A ' Links to All Users OEM specific apps > CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application >Data\Microsoft\CD Burning > ComputersNearMe = &H3D ' Computers Near Me (computered from >Workgroup membership) > FlagCreate = &H8000 ' combine with CSIDL_ value to force folder >creation in SHGetFolderPath() > FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an >unverified folder path > FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias >versions of the pidl > FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate >per-user init (eg. upgrade) > FlagMask = &HFF00 ' mask for all possible flag values > > End Enum > > Private Sub FolderBrowserDialogEx() > End Sub > > > Public Sub SetRootFolder(ByVal fbd As >System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) > Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType > dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance >| BindingFlags.NonPublic); > fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); > End Sub >End Class > >That last chunk - SetRootFolder - just isn't cooperating. Any help much >appreciated. > >TIA. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com From ebarro at verizon.net Thu Jul 12 23:42:55 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 12 Jul 2007 21:42:55 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <0JL300K6CP3M1117@vms048.mailsrvcs.net> Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM From accessd at shaw.ca Fri Jul 13 02:37:18 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 13 Jul 2007 00:37:18 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <0JL300J4CWYZUOF0@l-daemon> Hi John: Check the following site out. You can link to it from the DBA web site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:00:16 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:00:16 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <0JL300K6CP3M1117@vms048.mailsrvcs.net> Message-ID: <20070713120017.88743BEB8@smtp-auth.no-ip.com> Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:02:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:02:59 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <0JL300J4CWYZUOF0@l-daemon> Message-ID: <20070713120300.4631CBDD9@smtp-auth.no-ip.com> Like all things, these only get you so far. In this case it didn't get me anywhere but that is another story. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, July 13, 2007 3:37 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Hi John: Check the following site out. You can link to it from the DBA web site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting 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 mikedorism at verizon.net Fri Jul 13 07:18:26 2007 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 13 Jul 2007 08:18:26 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713120017.88743BEB8@smtp-auth.no-ip.com> References: <0JL300K6CP3M1117@vms048.mailsrvcs.net> <20070713120017.88743BEB8@smtp-auth.no-ip.com> Message-ID: <000301c7c547$eaa5c1f0$2f01a8c0@Kermit> You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ 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 mikedorism at verizon.net Fri Jul 13 07:22:16 2007 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 13 Jul 2007 08:22:16 -0400 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> References: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: <000401c7c548$73d00bc0$2f01a8c0@Kermit> The "goodie images" that come with VS 2005 are the standard boring icons and bitmaps. I decided long ago to build my own "goodie image" archive. There are a lot of great online resources for icons. My favorites are (in no particular order): http://www.seoconsultants.com/windows/icons/microsoft/ http://www.coolarchive.com/icons.php http://www.iconbazaar.com/ http://www.iconarchive.com/ Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:36:39 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:36:39 -0400 Subject: [dba-VB] Resource files In-Reply-To: <000401c7c548$73d00bc0$2f01a8c0@Kermit> Message-ID: <20070713123641.1E1DBBCEC@smtp-auth.no-ip.com> Thanks for the links. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:22 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Resource files The "goodie images" that come with VS 2005 are the standard boring icons and bitmaps. I decided long ago to build my own "goodie image" archive. There are a lot of great online resources for icons. My favorites are (in no particular order): http://www.seoconsultants.com/windows/icons/microsoft/ http://www.coolarchive.com/icons.php http://www.iconbazaar.com/ http://www.iconarchive.com/ Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:37:54 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:37:54 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <000301c7c547$eaa5c1f0$2f01a8c0@Kermit> Message-ID: <20070713123755.97D58BE5F@smtp-auth.no-ip.com> Yea, I was hoping that a member who uses C# might be able to translate this. I am such a nubee that I am clueless. I can translate syntax but not much more. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:18 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Fri Jul 13 07:48:22 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 13 Jul 2007 16:48:22 +0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070712222800.DE47FBD36@smtp-auth.no-ip.com> Message-ID: <000401c7c54c$19201db0$6401a8c0@nant> Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 08:10:46 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 09:10:46 -0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <000401c7c54c$19201db0$6401a8c0@nant> Message-ID: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com From ebarro at verizon.net Fri Jul 13 09:29:10 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 13 Jul 2007 07:29:10 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713120017.88743BEB8@smtp-auth.no-ip.com> Message-ID: <0JL4008KQG8EVZ2I@vms044.mailsrvcs.net> John, This compiled for me... Public Sub SetRootFolder(ByRef fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As Type = fbd.GetType() Dim fi As FieldInfo = t.GetField("rootFolder", BindingFlags.Instance Or BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub The error in your transposition had to do with defining t as System.Windows.Forms.FolderBrowserDialog that's why it was complaining when you set it to fbd.GetType() The variable t should have been defined as System.Type as in the original C# code... public static void SetRootFolder(System.Windows.Forms.FolderBrowserDialog fbd, CsIdl csidl) { Type t = fbd.GetType(); FieldInfo fi = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); } Eric -----Original Message----- From: jwcolby [mailto:jwcolby at colbyconsulting.com] Sent: Friday, July 13, 2007 5:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: RE: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: 7/12/2007 4:08 PM From ebarro at verizon.net Fri Jul 13 09:32:57 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 13 Jul 2007 07:32:57 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713123755.97D58BE5F@smtp-auth.no-ip.com> Message-ID: <0JL40085FGEPVMNI@vms044.mailsrvcs.net> Unfortunately most C# programmers don't even want to acknowledge VB.NET as being equal in the programming world. Hence they don't even care to be "ambidexterous" when it comes to programming in .NET. VB.NET is much more forgiving and you can forego a lot of declarations that C# will balk at and ask you to implicitly define in your code before you can use it. I learned .NET using VB.NET and since then I have been using C#. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:38 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Yea, I was hoping that a member who uses C# might be able to translate this. I am such a nubee that I am clueless. I can translate syntax but not much more. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:18 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jul 13 09:56:01 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 13 Jul 2007 09:56:01 -0500 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: I've used Axialis Icon Editor a lot. Let's you pull icons out of .exes, .dll's, etc. Handy tool, and a shell32.dll has a ton of them. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 10:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From shamil at users.mns.ru Fri Jul 13 10:10:28 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 13 Jul 2007 19:10:28 +0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Message-ID: <000601c7c55f$f2cffb30$6401a8c0@nant> Hello John, I have no clear idea why you do not get your WinForms controls updated if you raise and process(sink) events to update these controls in the same thread. Do you have one main (UI/WinForms) thread calling your long running code bulk insert code or this bulk insert is executed in another worker thread? <<< I continue to be amazed at how quickly you can do things in .Net >>> Yes, I agree, .NET 2.0 with VS2005 is the "dream come true"... <<< After hundreds of hours of hacking away I have yet to bind an object to data >>> John, have a look here: http://brewder.blogspot.com/2007/03/data-binding-classes-interfaces-and.html <<< Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! >>> Yes! Waaaaaaaaaa! :) I'm also still far from getting very closely familiar with this .NET Framework "behemoth"... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Jul 13 10:38:21 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 13 Jul 2007 08:38:21 -0700 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> References: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: We just use the WinXP images for stuff like that, John. The easiest way to handle images is with an ImageList control dropped on the form. Once you have pointed the control at an image file (or several if you like), you can copy that imageList control to other forms when you need it and just point to the image in the list. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 8:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Jul 13 10:47:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 13 Jul 2007 08:47:03 -0700 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> References: <000401c7c54c$19201db0$6401a8c0@nant> <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Message-ID: Boy, do I hear that, John! Most of the books are not very helpful in learning .Net for exactly the reasons you give. It was a big help to me to have worked extensively with ADO and to have done a lot of unbound stuff, so I didn't have to rely on binding and object to a data source before starting to work with it. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 6:11 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-i n-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 11:45:31 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 12:45:31 -0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <000601c7c55f$f2cffb30$6401a8c0@nant> Message-ID: <20070713164532.A0D62BD84@smtp-auth.no-ip.com> It is all one thread atm. However the event sinks function and code steps in there. I do DoEvents inside of those event sinks (on the main form) as soon as I update the form controls (in the event sinks). It works correctly when just running, but not when stepping through code. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 11:10 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I have no clear idea why you do not get your WinForms controls updated if you raise and process(sink) events to update these controls in the same thread. Do you have one main (UI/WinForms) thread calling your long running code bulk insert code or this bulk insert is executed in another worker thread? <<< I continue to be amazed at how quickly you can do things in .Net >>> Yes, I agree, .NET 2.0 with VS2005 is the "dream come true"... <<< After hundreds of hours of hacking away I have yet to bind an object to data >>> John, have a look here: http://brewder.blogspot.com/2007/03/data-binding-classes-interfaces-and.html <<< Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! >>> Yes! Waaaaaaaaaa! :) I'm also still far from getting very closely familiar with this .NET Framework "behemoth"... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 10:27:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 11:27:57 -0400 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com From chizotz at mchsi.com Wed Jul 18 11:53:45 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 18 Jul 2007 16:53:45 +0000 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> John, I know that there is a school of thought that this approach is inappropriate, but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER hive so each user has their own set of saved values, which is most often convenient for me. This example stores (in the form close event) the location, height, and width of the form, and (in the form open event) restores the form to that size and location. You should be able to easily adapt it for your needs. Ron (all syntax in C#, but should translate easily and well to VB) using Microsoft.Win32; //necessary include to get Registry classes In form close event: /* If form is maximized, minimized, or larger than the screen in either dimension, do not save size and position information */ if(this.WindowState != FormWindowState.Maximized && this.WindowState != FormWindowState.Minimized && this.Width <= Screen.PrimaryScreen.Bounds.Width && this.Height <= Screen.PrimaryScreen.Bounds.Height) { string regPath = @"Software\Tribune\Circ\CircTools\Settings"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey.GetValue("ResettingPositions").ToString() == "0") { regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey != null) { regKey.SetValue("X", Location.X); regKey.SetValue("Y", Location.Y); regKey.SetValue("H", this.Height); regKey.SetValue("W", this.Width); } } } In form open event: string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey == null) { regKey = Registry.CurrentUser.CreateSubKey(regPath); } if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) { Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); } if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) { this.Height = (int)regKey.GetValue("H"); this.Width = (int)regKey.GetValue("W"); } ---------------------- Original Message: --------------------- From: "jwcolby" To: Subject: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 15:31:33 +0000 > I need a way to store the values in controls as the form closes, such that > the form can the load those last values when it re-opens. I do things like > enter data in controls for server, database, table, paths to files etc. I > need the form to save those values so that the next time the form opens it > can retrieve those values and I don't have to key them in again every time. > > Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a > nubee) web sites? > > TIA, > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From chizotz at mchsi.com Wed Jul 18 11:59:00 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 18 Jul 2007 16:59:00 +0000 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <071820071659.25521.469E46D3000E2673000063B1219791336303010CD2079C080C03BF969B019607080C@mchsi.com> Oops. Copy and paste error in the code I sent. The variable regPath should be the same in both the form open and form close events, and in the code I sent it wasn't. I copied the code out of a form where I do other things with the registry too, and copied the wrong line where the value of regPath is set for the form close event. Sorry. ---------------------- Original Message: --------------------- From: chizotz at mchsi.com (Ron Allen) To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 16:53:46 +0000 > John, > > I know that there is a school of thought that this approach is inappropriate, > but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER > hive so each user has their own set of saved values, which is most often > convenient for me. > > This example stores (in the form close event) the location, height, and width > of the form, and (in the form open event) restores the form to that size and > location. You should be able to easily adapt it for your needs. > > Ron > > > > (all syntax in C#, but should translate easily and well to VB) > > using Microsoft.Win32; //necessary include to get Registry classes > > In form close event: > > /* > If form is maximized, minimized, or larger than > the screen in either dimension, do not save size > and position information > */ > if(this.WindowState != FormWindowState.Maximized && > this.WindowState != FormWindowState.Minimized && > this.Width <= Screen.PrimaryScreen.Bounds.Width && > this.Height <= Screen.PrimaryScreen.Bounds.Height) > { > string regPath = @"Software\Tribune\Circ\CircTools\Settings"; > RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey.GetValue("ResettingPositions").ToString() == "0") > { > regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; > regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey != null) > { > regKey.SetValue("X", Location.X); > regKey.SetValue("Y", Location.Y); > regKey.SetValue("H", this.Height); > regKey.SetValue("W", this.Width); > } > } > } > > In form open event: > > string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; > RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey == null) > { > regKey = Registry.CurrentUser.CreateSubKey(regPath); > } > if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) > { > Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); > } > if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) > { > this.Height = (int)regKey.GetValue("H"); > this.Width = (int)regKey.GetValue("W"); > } From ebarro at verizon.net Wed Jul 18 12:06:11 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 18 Jul 2007 10:06:11 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> Message-ID: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM From cfoust at infostatsystems.com Wed Jul 18 12:05:08 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 18 Jul 2007 10:05:08 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> References: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> Message-ID: The problem with using the registry is that a lot of IT departments are locking it down and require you to use the Documents and Settings folder to store current user stuff. We use XML for this purpose. We'll have an XML file that contains a variable number of elements, which all have a ReadOnly attribute set to False as the default. We use a class to retrieve values from the file and to save values to it. Similar to what we used to do with registry settings. You could have a FormsDefaults.XML file that contains a template element with default settings in it for any form you have saved custom settings for, and then the class could create a new element for each form that had saved settings. Not hard and it doesn't require any api calls to read. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen Sent: Wednesday, July 18, 2007 9:54 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults John, I know that there is a school of thought that this approach is inappropriate, but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER hive so each user has their own set of saved values, which is most often convenient for me. This example stores (in the form close event) the location, height, and width of the form, and (in the form open event) restores the form to that size and location. You should be able to easily adapt it for your needs. Ron (all syntax in C#, but should translate easily and well to VB) using Microsoft.Win32; //necessary include to get Registry classes In form close event: /* If form is maximized, minimized, or larger than the screen in either dimension, do not save size and position information */ if(this.WindowState != FormWindowState.Maximized && this.WindowState != FormWindowState.Minimized && this.Width <= Screen.PrimaryScreen.Bounds.Width && this.Height <= Screen.PrimaryScreen.Bounds.Height) { string regPath = @"Software\Tribune\Circ\CircTools\Settings"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey.GetValue("ResettingPositions").ToString() == "0") { regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey != null) { regKey.SetValue("X", Location.X); regKey.SetValue("Y", Location.Y); regKey.SetValue("H", this.Height); regKey.SetValue("W", this.Width); } } } In form open event: string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey == null) { regKey = Registry.CurrentUser.CreateSubKey(regPath); } if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) { Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); } if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) { this.Height = (int)regKey.GetValue("H"); this.Width = (int)regKey.GetValue("W"); } ---------------------- Original Message: --------------------- From: "jwcolby" To: Subject: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 15:31:33 +0000 > I need a way to store the values in controls as the form closes, such > that the form can the load those last values when it re-opens. I do > things like enter data in controls for server, database, table, paths > to files etc. I need the form to save those values so that the next > time the form opens it can retrieve those values and I don't have to key them in again every time. > > Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE > (to a > nubee) web sites? > > TIA, > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 12:24:04 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 13:24:04 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> Message-ID: <20070718172406.C2962BD32@smtp-auth.no-ip.com> This looks cool! Thanks, John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 18, 2007 1:06 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 12:36:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 13:36:42 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> Message-ID: <20070718173644.36F99BD1F@smtp-auth.no-ip.com> Except that is a c# solution. Sigh. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 18, 2007 1:06 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Wed Jul 18 14:20:04 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 19 Jul 2007 07:20:04 +1200 Subject: [dba-VB] Object Reference not set to an Object error Message-ID: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> I use an add on from DataDynamics called ActiveReports which alows me to produce dot net reports in a similar interface to Access (sort of). I have a connection string defined in my Web.Config file. I want to set the connection string of the report to this when the report is run. I have the following code which is supposed to check whether the report has a connection string already. If the report doesn't have a connection string then I don't want to add a connection string (because there is no data for the report), otherwise I want to replace the connection string with the one in the Web.Config. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToString <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBConnection").ConnectionString End If The problem is with the first line. If there is a connection string then it is replaced. If the report doesn't have a connection string then an error is raised at the first line saying "Object reference not set to an instance of an object". My guess is that this is because no data source is set at all for the report there is no ConnectionString object to compare to. Can anyone please help with the syntax for checking whether the data source object exists (then if it does I can make the replacement to the connectionString). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From ebarro at verizon.net Wed Jul 18 14:41:12 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 18 Jul 2007 12:41:12 -0700 Subject: [dba-VB] Object Reference not set to an Object error In-Reply-To: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <0JLE00D9U40N69W0@vms046.mailsrvcs.net> Use Try...Catch Try ' Statement which can cause an exception. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS tring <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon nection").ConnectionString End If Catch x As Type ' Statements for handling the exception Finally End Try 'Any cleanup code -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Wednesday, July 18, 2007 12:20 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Object Reference not set to an Object error I use an add on from DataDynamics called ActiveReports which alows me to produce dot net reports in a similar interface to Access (sort of). I have a connection string defined in my Web.Config file. I want to set the connection string of the report to this when the report is run. I have the following code which is supposed to check whether the report has a connection string already. If the report doesn't have a connection string then I don't want to add a connection string (because there is no data for the report), otherwise I want to replace the connection string with the one in the Web.Config. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS tring <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon nection").ConnectionString End If The problem is with the first line. If there is a connection string then it is replaced. If the report doesn't have a connection string then an error is raised at the first line saying "Object reference not set to an instance of an object". My guess is that this is because no data source is set at all for the report there is no ConnectionString object to compare to. Can anyone please help with the syntax for checking whether the data source object exists (then if it does I can make the replacement to the connectionString). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM From newsgrps at dalyn.co.nz Wed Jul 18 17:15:04 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 19 Jul 2007 10:15:04 +1200 Subject: [dba-VB] Object Reference not set to an Object error In-Reply-To: <0JLE00D9U40N69W0@vms046.mailsrvcs.net> References: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> <0JLE00D9U40N69W0@vms046.mailsrvcs.net> Message-ID: <20070718221539.HJMD16296.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks Eric, Another topic to digest. David At 19/07/2007, you wrote: >Use Try...Catch > >Try > ' Statement which can cause an exception. > If CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS >tring <> "" Then > CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = >System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon >nection").ConnectionString > End If > >Catch x As Type > ' Statements for handling the exception >Finally > >End Try 'Any cleanup code > > > >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson >Sent: Wednesday, July 18, 2007 12:20 PM >To: dba-vb at databaseadvisors.com >Subject: [dba-VB] Object Reference not set to an Object error > >I use an add on from DataDynamics called ActiveReports which alows me to >produce dot net reports in a similar interface to Access (sort of). > >I have a connection string defined in my Web.Config file. I want to set the >connection string of the report to this when the report is run. I have the >following code which is supposed to check whether the report has a >connection string already. If the report doesn't have a connection string >then I don't want to add a connection string (because there is no data for >the report), otherwise I want to replace the connection string with the one >in the Web.Config. > >If CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS >tring ><> "" Then > CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString >= >System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon >nection").ConnectionString >End If > >The problem is with the first line. If there is a connection string then it >is replaced. If the report doesn't have a connection string then an error >is raised at the first line saying "Object reference not set to an instance >of an object". My guess is that this is because no data source is set at >all for the report there is no ConnectionString object to compare to. > >Can anyone please help with the syntax for checking whether the data source >object exists (then if it does I can make the replacement to the >connectionString). > > >Regards > >David Emerson >Dalyn Software Ltd >Wellington, New Zealand >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > >No virus found in this incoming message. >Checked by AVG Free Edition. >Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 >6:30 PM > > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com From shamil at users.mns.ru Wed Jul 18 20:34:44 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Thu, 19 Jul 2007 05:34:44 +0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> Message-ID: <000601c7c9a4$fc3d16f0$6401a8c0@nant> Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 7:28 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 20:57:38 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 21:57:38 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <000601c7c9a4$fc3d16f0$6401a8c0@nant> Message-ID: <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> Shamil, Funny you should mention that. I was working on just such a class earlier this afternoon - from a book called Beginning Visual Basic .NET from Wrox. That book does not mention binding the form to the class though. It actually reads / writes the values out of the controls. I like the "binding" idea. Now all I have to do is figure out how to do that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, July 18, 2007 9:35 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil From jwcolby at colbyconsulting.com Thu Jul 19 09:59:47 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 10:59:47 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> I operate under Option Strict. I have a situation where I am trying to use code from a book. That code assigns an object type to a class, i.e. Dim lcls as clsSomething = SerializeData(... SerializeData returns an object. How do I cast Serialize data to return a type clsSomething so that I don't get the "option strict disallows..." error message? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Thu Jul 19 10:09:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 08:09:03 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> References: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> Message-ID: That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:00 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion I operate under Option Strict. I have a situation where I am trying to use code from a book. That code assigns an object type to a class, i.e. Dim lcls as clsSomething = SerializeData(... SerializeData returns an object. How do I cast Serialize data to return a type clsSomething so that I don't get the "option strict disallows..." error message? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 10:27:01 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 08:27:01 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> References: <000601c7c9a4$fc3d16f0$6401a8c0@nant> <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> Message-ID: The specific "how" is use the databindings properties of the form. Typed Datasets are the easiest to work with because even in design time, they know what the properties of their source is--fields, data types, etc. We normally create a class for each typed dataset, give it whatever business rules we want to enforce at the data level, and drag the class form the toolbox onto the form or user control. That creates the binding to the form and you can then control the binding to the controls in design view or through code. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 6:58 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Shamil, Funny you should mention that. I was working on just such a class earlier this afternoon - from a book called Beginning Visual Basic .NET from Wrox. That book does not mention binding the form to the class though. It actually reads / writes the values out of the controls. I like the "binding" idea. Now all I have to do is figure out how to do that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, July 18, 2007 9:35 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 10:48:41 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 11:48:41 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719154843.48102BF92@smtp-auth.no-ip.com> I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 11:13:19 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:13:19 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719154843.48102BF92@smtp-auth.no-ip.com> References: <20070719154843.48102BF92@smtp-auth.no-ip.com> Message-ID: John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 11:24:07 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 12:24:07 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 11:44:05 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 18:44:05 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 11:47:46 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:47:46 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> References: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> Message-ID: We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 cfoust at infostatsystems.com Thu Jul 19 11:49:07 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:49:07 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 12:02:43 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 19:02:43 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte So true. Nothing beats experience. Seems like while some of us overwhelmed are fooling around, you just do it. /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:49 >>> Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 12:06:16 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:06:16 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte So true. Nothing beats experience. Seems like while some of us overwhelmed are fooling around, you just do it. /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:49 >>> Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 12:18:38 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 19:18:38 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte You retire? Give me one good reason for that. /gustav >>> cfoust at infostatsystems.com 19-07-2007 19:06 >>> I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte From cfoust at infostatsystems.com Thu Jul 19 12:30:25 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:30:25 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: Hmmn. Death? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 10:19 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte You retire? Give me one good reason for that. /gustav >>> cfoust at infostatsystems.com 19-07-2007 19:06 >>> I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 12:35:38 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 13:35:38 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Well, I'm (slowly) learning how to do it. Unfortunately because I work alone it is tough to get the "doing it right" part. If I do it wrong there is no one looking over my shoulder telling me to "do it this way". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 mmattys at rochester.rr.com Thu Jul 19 12:45:47 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Thu, 19 Jul 2007 13:45:47 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion References: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Message-ID: <010a01c7ca2c$a560e130$0202a8c0@Laptop> Ooh! Ooh Ooh! I'll do it! - Horshack from 'Welcome Back, Kotter" Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" To: Sent: Thursday, July 19, 2007 1:35 PM Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > Well, I'm (slowly) learning how to do it. Unfortunately because I work > alone it is tough to get the "doing it right" part. If I do it wrong > there > is no one looking over my shoulder telling me to "do it this way". > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 12:48 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > We're LEARNING how to do it right OJT! LOL Our senior developer was the > only one who had any previous experience with .Net and we've blown past > the > firm we hired to advise us at the start of the project. And yes, it's > been > a lot of fun being in it from the ground up. > > Charlotte > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, July 19, 2007 9:24 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > Boy I must say you lucked out getting that job. I would die for an > opportunity to learn VB.Net OJT AND though a company that apparently > really > knows how to do it right! > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 12:13 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > John, > > We use typed datasets to handle the serialization. Then we can work with > the typed dataset in design view as if it were a real table. We do NOT > hand > build that code! It was easy to generate typed datasets in > 2003 but I keep forgetting how in 2005. It is well worth exploring though > for the work it saves. > >>>I was just about to ask about binding this to a form when your next > email came in. The only question I have is, is it possible to bind to a > class where the open event of the form itself is going to load the data > into > the class? It seems kinda "cart before the horse". > > What you do is bind to the class, which has no data in it at that point. > You have a setup routine in the form that either accepts a dataset or > fills > the one it already has. That's the advantage to working with the indirect > links offered by typed datasets and wrapper classes. We create various > Get > and Fill methods (Get returns a filled instance of the class object, Fill > populates a passed in instance) to accept parameters and populate the > class > with the data requested. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, July 19, 2007 8:49 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > I used DirectCast. And it all works. AMAZING!!! > > Charlotte, you probably use this all of the time. The example code builds > a > "serializable class" with functions that do the serialization in / out to > a > data stream, and functions that get a stream from / to a file. Then you > build a properties class that inherits the serializable class, which class > then allows you to define your properties. Since the properties class > inherits the code to serialize itself, it can do so without further adoo. > > I then use that in my form to store the control data into a properties > class > instance and can now store that out to an xml file using the .net > serializable stuff embedded in the inherited "serializable class". > Likewise retrieve it later. > > I have to say that the dim statement to do the restore is a mess though! > > To save: > Dim lclsIOData As New clsIOData > PopulateIODataFromForm(lclsIOData) > Dim strFileName As String = lclsIOData.mDataFileName("FormData") > lclsIOData.mSave(strFileName) > > To restore: > Dim lclsIOData As clsIOData > lclsIOData = > DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), > GetType(clsIOData)), clsIOData) > mPopulateFormFromIOData(lclsIOData) > > It is really a reasonably small amount of code setting up the serializable > class, but once done, any data class can be serialized to xml. From what > I > can understand I could also serialize it to a table if I wanted to simply > by > having another function that opened a stream to / from a table instead of > a > file. I will leave that for another day. > > Cool stuff. > > I was just about to ask about binding this to a form when your next email > came in. The only question I have is, is it possible to bind to a class > where the open event of the form itself is going to load the data into the > class? It seems kinda "cart before the horse". > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 11:09 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > That's one problem I always have with the books too, they tend to use a > lot > of implicit conversion. Of course, you learn a lot from making the > examples > work with option strict on. There are various ways to do it, John. You > can > use a Ctype() function to convert the object to a clsSomething like this: > Ctype(SerializeData(....), clsSomething). You can also use a DirectCast > function. > > Charlotte Foust > > > _______________________________________________ > 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 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 12:49:44 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:49:44 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> References: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Message-ID: Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 10:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, I'm (slowly) learning how to do it. Unfortunately because I work alone it is tough to get the "doing it right" part. If I do it wrong there is no one looking over my shoulder telling me to "do it this way". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 13:42:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 14:42:05 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte From cfoust at infostatsystems.com Thu Jul 19 14:01:11 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:01:11 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> References: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> Message-ID: >>It has to be easy. ROTFL There's your problem, right there!! Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 14:07:26 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:07:26 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> References: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> Message-ID: Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 14:10:04 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 21:10:04 +0200 Subject: [dba-VB] How I'm approaching the problem Message-ID: Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. From jwcolby at colbyconsulting.com Thu Jul 19 14:31:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:31:56 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719193157.E3430BD48@smtp-auth.no-ip.com> I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 14:33:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:33:25 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719193327.7EDFBBD43@smtp-auth.no-ip.com> I have found code to do that. How it works I haven't a clue but once I get it working I will show what it is. In my case it has to be local. Servers out on the internet are not usable in my business. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 3:10 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 14:36:34 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:36:34 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719193157.E3430BD48@smtp-auth.no-ip.com> References: <20070719193157.E3430BD48@smtp-auth.no-ip.com> Message-ID: Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 ebarro at verizon.net Thu Jul 19 14:49:04 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 19 Jul 2007 12:49:04 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719193327.7EDFBBD43@smtp-auth.no-ip.com> Message-ID: <0JLF00LV0Z1B32Y4@vms042.mailsrvcs.net> I have code that can query a database for its tables and the fields in those tables (SQL server-specific). -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:33 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I have found code to do that. How it works I haven't a clue but once I get it working I will show what it is. In my case it has to be local. Servers out on the internet are not usable in my business. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 3:10 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. _______________________________________________ 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.9/907 - Release Date: 7/18/2007 3:30 PM From jwcolby at colbyconsulting.com Thu Jul 19 14:56:01 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:56:01 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719195607.4216ABC02@smtp-auth.no-ip.com> >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 cfoust at infostatsystems.com Thu Jul 19 15:04:14 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 13:04:14 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719195607.4216ABC02@smtp-auth.no-ip.com> References: <20070719195607.4216ABC02@smtp-auth.no-ip.com> Message-ID: I see. You had mentioned that before but I forgot (blame my age LOL). I know about that kind of list from bitter experience, although the biggest ones I ever had to import were less than 100K names per list. But I also didn't have the benefits of .Net and had to work strictly in Access 97, which didn't make it fun. I still don't see the need to import the data into a database immediately when you could manipulate them in xml form until you got them the way you wanted and THEN import the data once and for all. You could park the rejects in another database for reference. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 16:02:26 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 17:02:26 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719210229.D676BBE9C@smtp-auth.no-ip.com> My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 4:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I see. You had mentioned that before but I forgot (blame my age LOL). I know about that kind of list from bitter experience, although the biggest ones I ever had to import were less than 100K names per list. But I also didn't have the benefits of .Net and had to work strictly in Access 97, which didn't make it fun. I still don't see the need to import the data into a database immediately when you could manipulate them in xml form until you got them the way you wanted and THEN import the data once and for all. You could park the rejects in another database for reference. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 _______________________________________________ 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 Jul 21 21:14:25 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 21 Jul 2007 19:14:25 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719210229.D676BBE9C@smtp-auth.no-ip.com> Message-ID: <0JLK002Q05ZSBFE4@l-daemon> Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. From jwcolby at colbyconsulting.com Sat Jul 21 23:51:17 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 00:51:17 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLK002Q05ZSBFE4@l-daemon> Message-ID: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. From pcs at azizaz.com Sun Jul 22 02:24:37 2007 From: pcs at azizaz.com (Borge Hansen) Date: Sun, 22 Jul 2007 17:24:37 +1000 Subject: [dba-VB] Address Processing References: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> Message-ID: <036401c7cc31$5cbad380$fa10a8c0@Albatross> Hi John, I've been following your threads on the subject of your SQL Server system on and off, the latest being: Subject: Re: [dba-VB] How I'm approaching the problem Where you wrote: "...The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity...." I am curious as to what your address processing entails...if you have been writing on this previously I missed it... Does the address processing entail returning geocode on the address? I am currently using Google's MAP API to process addresses and having them returned with a geocode including degree of accurary (street, suburb or zip).... I am using some javascript picked up somewhere on the internet.... The javascript uses a webpage textcontrol as the input for address processing (I copy and paste about 1,000 address records from an access table into the textcontrol), and outputs the data records returned from Google as tab delimited lines of text to another text control on the same webpage. So I can process about a 1,000 addresses at a time... but at present I have to manually copy and paste the processed addresses from the text control into a say Access table.... What I am after is code that allows me to use a table (Access or SQL) as input and another table for inserting the processed addresses.... Is this something you are doing? Anyone else who can help out here? Regards, Borge Hansen From jwcolby at colbyconsulting.com Sun Jul 22 11:07:17 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 12:07:17 -0400 Subject: [dba-VB] Address Processing In-Reply-To: <036401c7cc31$5cbad380$fa10a8c0@Albatross> Message-ID: <20070722160723.D36EFBD05@smtp-auth.no-ip.com> This business is about bulk mail addresses. My client buys lists of addresses from other list providers. Each list is basically a "poll" that someone answered or something similar. A million people filled out warranty cards when they bought a car, or filled out an online form when they visited a web site, or... Somehow they got their name on a list, but more importantly they gave other important information about themselves such as brands of tobacco used, soft drinks consumed, electronics purchased etc. It is really THAT information that is important about the person, because my client sells these names to advertisers targeting people who have dogs or cats (a dog / cat food mailing) or bought a certain brand of car 4 years ago (a dealership mailing). So... I get lists of names / addresses, with "demographics" information included. I pull the lists in to SQL Server. Why? Because my client then comes back to me and says "give me 100K names in these zips who purchased laundry detergent". So I have to have the info in SQL Server in order to do the where clauses on zips and demographics fields. As soon as I import the table, I immediately export the data back out for "address cleaning". These lists average about 20% "trash", addresses where the address was misspelled, no zip was given, or a completely fake address was supplied etc. So I export my own PKID, the name and address out to CSV files, up to 1 million records at a time. I send those addresses through a program that verifies the addresses. The first process is called CASS, which simply verifies that the address "matches" an address template. A second process (run at the same time, subsequent to CASS is called DPV which stands for delivery point validation. IOW, yea, it matches a template, but can it actually be delivered. The USPS provides databases of every valid address in the United States, and the addresses are run through this database to see if it is a "real address" (DPV) as opposed just "looks like a real address" (CASS). And finally, the address is then processed for NCOA or National Change of Address. That is a database (USPS) that says "yea, that person USED TO LIVE THERE but moved". So it is obvious why I do the processing. However I also need to re-process the data periodically in order to catch the moves. If John Colby moves from Connecticut to North Carolina, I want to discover that and stop sending mail to him in Connecticut and start sending it to him in NC. So every so often (monthly?) I will export the name / address back out and run it through the process again. CASS and DPV (theoretically) will get a 100% hit rate now because I already did that last time, but NCOA will catch a certain % of the people who moved. I use a dedicated program for doing this. There are too many variables for me to even consider "reinventing the wheel". These professional programs perform such functions as splitting names and addresses, standardizing abbreviations such as ST or ST. for Street etc. Those standardizing processes are required to get a hit on an address in the USPS database. If you are doing a few hundred names for your church or for some charity organization, you can visually scan the "fallout" data to see if you can pick up errors, but when processing 90 million names I never even look at the data, I just can't do that. So this professionally designed program handles a bunch of stuff in order to prepare the data for validation, performs the validation, and hands me back my PKID, name and address fields, plus about 40 other fields that tell me things about the data itself (political district, area code, etc) as well as data about why the data failed to validate in case I want to do processing on the rejects (I don't). In any event, this is not just a one shot deal. I pull the RAW data in, add a PK, Export the name / address, process that, import the resulting cleaned address data back into a DIFFERENT table, but related to the RAW data by my PK that I assigned to the raw data. Periodically I re-export / import for NCOA processing. Now when the client asks for 1 million names of people who own dogs I go to the table they tell me to, join the raw data to the address data, apply where clauses (zip to the cleaned address, demographics to the raw data), and pull the names and addresses out and export them for shipping to the purchaser of the names. We can tell the client that the data was last cleaned "X weeks ago" so that they know they are not spending money to send mail to bad addresses. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Sunday, July 22, 2007 3:25 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Address Processing Hi John, I've been following your threads on the subject of your SQL Server system on and off, the latest being: Subject: Re: [dba-VB] How I'm approaching the problem Where you wrote: "...The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity...." I am curious as to what your address processing entails...if you have been writing on this previously I missed it... Does the address processing entail returning geocode on the address? I am currently using Google's MAP API to process addresses and having them returned with a geocode including degree of accurary (street, suburb or zip).... I am using some javascript picked up somewhere on the internet.... The javascript uses a webpage textcontrol as the input for address processing (I copy and paste about 1,000 address records from an access table into the textcontrol), and outputs the data records returned from Google as tab delimited lines of text to another text control on the same webpage. So I can process about a 1,000 addresses at a time... but at present I have to manually copy and paste the processed addresses from the text control into a say Access table.... What I am after is code that allows me to use a table (Access or SQL) as input and another table for inserting the processed addresses.... Is this something you are doing? Anyone else who can help out here? Regards, Borge Hansen _______________________________________________ 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 Sun Jul 22 17:41:33 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 22 Jul 2007 15:41:33 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> Message-ID: <0JLL0046YQSWLTW1@l-daemon> Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 22 20:53:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 21:53:57 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLL0046YQSWLTW1@l-daemon> Message-ID: <20070723015404.F2E3ABCDF@smtp-auth.no-ip.com> ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 6:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try | to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ 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 Sun Jul 22 22:01:21 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 22 Jul 2007 20:01:21 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723015404.F2E3ABCDF@smtp-auth.no-ip.com> Message-ID: <0JLM00G2W2TVP6K5@l-daemon> Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 22, 2007 6:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 6:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try | to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 23 07:22:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 08:22:28 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLM00G2W2TVP6K5@l-daemon> Message-ID: <20070723122237.42363BE4A@smtp-auth.no-ip.com> Jim, Throw in the fact that I have to get real work done (process data for the client) and it really gets fun. That is why I have been working from the bottom up, getting those pieces written that allow me to actually process the lists, even if I have to manually run them from the click of a button, with hard coded constants for the parameters. It is good that I finally have a real paying project that requires SQL Server and VB.Net. Yea, having to learn them under the gun is stressful, but I have not succeeded in learning them in the past because I just didn't NEED them and I had too much other stuff to do to spend the hundreds of hours required to figure them out. Now I NEED them. I'll tell you, I really love VB.NET. As a dev language / environment it has everything that I want. That was not true before 2.0, but with the latest version it is complete enough to really do what I need. Yes, it is 10 times more complex than anything I have previously encountered, but a lot of the reason is that it provides so much more "out of the box". I am a class kind of guy and a programmer at heart, and this is very much my dream environment. It is just a matter of learning it well. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 11:01 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 22, 2007 6:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting From shamil at users.mns.ru Mon Jul 23 12:24:41 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Mon, 23 Jul 2007 21:24:41 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLM00G2W2TVP6K5@l-daemon> Message-ID: <000001c7cd4e$5ab9fcf0$6401a8c0@nant> All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> From jwcolby at colbyconsulting.com Mon Jul 23 12:37:33 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 13:37:33 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000001c7cd4e$5ab9fcf0$6401a8c0@nant> Message-ID: <20070723173742.D9657C1B3@smtp-auth.no-ip.com> Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Mon Jul 23 14:57:01 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Mon, 23 Jul 2007 23:57:01 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723173742.D9657C1B3@smtp-auth.no-ip.com> Message-ID: <001101c7cd63$a3ae3d30$6401a8c0@nant> <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 23 15:17:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 16:17:15 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070723201724.4F8A7BEC5@smtp-auth.no-ip.com> Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Tue Jul 24 02:12:21 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 11:12:21 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723201724.4F8A7BEC5@smtp-auth.no-ip.com> Message-ID: <000a01c7cdc1$fb01f460$6401a8c0@nant> Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 08:52:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 09:52:59 -0400 Subject: [dba-VB] VB.Net Message-ID: <20070724135310.20ABDBC8E@smtp-auth.no-ip.com> I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com From James at fcidms.com Tue Jul 24 09:05:45 2007 From: James at fcidms.com (James Barash) Date: Tue, 24 Jul 2007 10:05:45 -0400 Subject: [dba-VB] VB.Net In-Reply-To: <20070724135310.20ABDBC8E@smtp-auth.no-ip.com> Message-ID: <005f01c7cdfb$baf45a90$800101df@fci.local> John: You want: DateTime.Now.ToString("yyyyMMdd-hhmmss") James Barash -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 9:53 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 09:26:20 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 10:26:20 -0400 Subject: [dba-VB] VB.Net In-Reply-To: <005f01c7cdfb$baf45a90$800101df@fci.local> Message-ID: <20070724142630.E5045BC93@smtp-auth.no-ip.com> Thanks James. It turns out that I was mixing up the CASE of the characters and ending up with totally weird formatted strings as you might imagine. Once I found the help for the format for dates and used the correct characters, in the correct case (upper / lower) then it started working just fine. Thanks again for the response. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of James Barash Sent: Tuesday, July 24, 2007 10:06 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net John: You want: DateTime.Now.ToString("yyyyMMdd-hhmmss") James Barash -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 9:53 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 10:02:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 11:02:25 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000a01c7cdc1$fb01f460$6401a8c0@nant> Message-ID: <20070724150235.C5CE4BD9E@smtp-auth.no-ip.com> Shamil, >Would that have any (economical) sense for your customer to improve DB bulk loading time? I don't understand the context - would what have any economical sense? >Why you do not use 64 bit .Net Framework to run your code on the server side? My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. First, I am a one man show with a month by month budget. Second, In order to get maximum bang for my hard earned dollar I build my own systems. I was talking to the owner of the company that does my address validation and they just spend $25,000 for a DELL server with 32 megs of data and windows 2003 x64. I don't have that kind of money. When you buy a DELL (as an example) then getting Windows x64 to install is a simple click of the button on the order page. Getting windows x64 to install on a desktop is not so simple, with issues for ALL of the drivers from video, network, disk etc. When I built the workstations I use to run SQL Server I did not understand the size of the task; Now I do. I will be building a new server this fall with a server motherboard, designed and certified to run the X64 versions of windows, with drivers supplied etc. It will be a dual processor / 8 core machine which will contain 32 megs or ram to start, 64 megs eventually. I MAY be able to get Windows 2003 x64 to run on the current servers, and if I can then I will but I am not holding my breath. Even if I can, they max out at 8 megs of ram that they can address so they will still be underpowered for my purpose. >Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? I am still working through that. The third party lib, DataStreams from www.csvreader.com Has a set of objects (readers) which can read and write streams to and from files. The docs are complete but the examples are sparse! However the author is available on his forums to answer questions and generally responds within a few hours. Basically what happens is that you instantiate one of the reader objects, tell the object what data type each column will be and then pass in a stream from that object to the SQLBulkCopy object. The DataStreams reader object handles all of the opening of the file, parsing the CSV file into an array and writing the array data into the stream. It appears to handle chunks of data so that the entire file does not have to fit into memory at once. With a CSV file, typically there is a header line in the first row. DataStreams reads that in and does the mapping for you if that row exists. He also has methods for obtaining the collection of field names etc, so I am actually building code to automatically build a table in SQL Server based on the names in the field names collection, plus a PK column of my own (long autoincrement) out at the end. His code correctly feeds the data into the table IF the columns from the file are the first columns, i.e. the PK is at the end of the table, but does not correctly handle the data feed if the PK is the first field in the table (and there is no PK field in the data). Remember that I have two distinct cases. 1) Data (lists) from vendors. These may have some "PK" of their own, but I do not know what it is or whether there will be one (typically not) so I just routinely build my own. 2) Data that I export from SQL Server, process, and get back from the address validation software. Those CSVs already have a PKID because my source tables have one and I export that PKID into the CSV file when I do the export from SQL Server. Given the costs of the lib, I am very impressed with the implementation so far. He provides a record event to allow preprocessing data within each record being read before sending it off to the SQLBulkCopy. You can do anything you might imagine with such control - look for specific data values in a given field, skip the record based on such evaluations, modify the data in specific fields etc, all on-the-fly as the data moves from CSV to SQL Server. I believe it also handles fixed width files which is also on my plate. So basically I just outsourced one small but complex part of the project. It was easy to get working and seems pretty fast so I am happy with the results so far. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:05:18 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:05:18 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724160529.0F54FBD8E@smtp-auth.no-ip.com> Shamil, I have started logging the imports now so I can tell you the times to import (in time / tick counts) as soon as I do a bunch, which will be today. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:10:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:10:37 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724161047.DA2F0BC81@smtp-auth.no-ip.com> One issue I am running into is that I really want to be able to log the start / stop PKID of each record imported. I use an autoincrement in SQL Server, but I do not know how to get at the last PKID in these values "live" as the SQLBulkInsert runs. Is it possible to pull the value of a field back out of the SQLBulkInsert object? Do I have to execute a sql statement to "get" the value of the PKID of the last record before the import and the last record after the import? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com From Gustav at cactus.dk Tue Jul 24 11:12:45 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 24 Jul 2007 18:12:45 +0200 Subject: [dba-VB] How I'm approaching the problem Message-ID: Hi John Don't you subscribe to the Action Pack? The July update includes DVDs with Windows Vista Business 64 bit Windows Server 2003 R2 64 bit Windows Server 2008 Enterprise 64 bit Beta 3 That's not a running server, I know, but an important part ... /gustav >>> jwcolby at colbyconsulting.com 24-07-2007 17:02 >>> My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. From jwcolby at colbyconsulting.com Tue Jul 24 12:35:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 13:35:56 -0400 Subject: [dba-VB] The command object exception Message-ID: <20070724173606.D7354BCD1@smtp-auth.no-ip.com> I am trying to execute queries that build databases, build tables etc. When I executed the ExecuteNonQuery method with a query that built a database and the database already exists, I got an error returned of -2147217900. When I tried to execute a sql statement with a general error I got the same error returned. How do I get meaningful error codes back from ExecuteNonQuery? Try mobjCmd.ExecuteNonQuery() Catch ex As OleDbException Select Case ex.ErrorCode Case -2147217900 'database already exists so ignore the error Case Else MessageBox.Show(ex.Message) Return -3 End Select End Try John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 24 14:32:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 15:32:57 -0400 Subject: [dba-VB] Count of specific character Message-ID: <20070724193307.C3D38BE7E@smtp-auth.no-ip.com> Is there any single function that will return a count of a specific character in a string? I have a situation where (apparently) the header of a CSV file has the same field name twice. I am trying to determine what is going on, so I want to count the field separator characters in the header and the first line of real data to see if there are more fields in the header than in the data or if something else is going on. John W. Colby Colby Consulting www.ColbyConsulting.com From shamil at users.mns.ru Tue Jul 24 14:37:04 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 23:37:04 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070724150235.C5CE4BD9E@smtp-auth.no-ip.com> Message-ID: <000001c7ce2a$03a5e320$6401a8c0@nant> Hello John, <<< I don't understand the context - would what have any economical sense? >>> I meant does your customer need to make bulk loading any faster or not? You know one may fly Paris - NY using ordinary Boeing planes, one can use (in the past) Concord or even TU-144(!?) (http://en.wikipedia.org/wiki/Tupolev_Tu-144) - IOW does your customer still need Concord for their task or current very good Boeing solution is good enough for them now and for a long time in the future? I also mean we can try to find what is (if any) bottleneck of the current solution and "break" this bottleneck? Some tests (Dual Core 3MHz, 2GB, W2003 Server, simple IDE/SATA 7400rpm HDD) - the raw performance of reading a delimited by TAB char CSV file in .NET: Total Counter = 1011852 (1 million...) ElapsedTime = 3,359375 seconds ElapsedTime = 0,0559895833333333 minutes Total Counter = 10006092 (10 million...) ElapsedTime = 32,890625 seconds ElapsedTime = 0,548177083333333 minutes Total Counter = 100010952 (100 million...) ElapsedTime = 327,875 seconds ElapsedTime = 5,46458333333333 minutes Splitting of CSV file lines into array added... Total Counter = 1011852 (1 million...) ElapsedTime = 8,375 seconds ElapsedTime = 0,139583333333333 minutes ... (I didn't have time to test other cases of 10 and 100 million source file lines - please do if you have time...) Of course that is just reading the file - the open question is how closely this extreme files reading performance can be approached when such a file is bulk loaded into MS SQL Database? Join, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... I must say I'm very interested to return here next week, sorry for any inconvenience... -- Shamil P.S. Simple C# code used for testing (watch line wraps): using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long MAX_LIMIT = 1000000; // 00; string s = @"F:\Temp\XL\ConsoleApplication1\IN\testfile.txt"; long totalCounter = 0; long lineCounter = 0; DateTime startTime = DateTime.Now; while (totalCounter < MAX_LIMIT) { System.IO.TextReader rdr = new System.IO.StreamReader(s); lineCounter = 0; string inline = ""; char delimiter = (char)9; while ((inline = rdr.ReadLine())!=null) { string[] fields = inline.Split(delimiter); ++totalCounter; ++lineCounter; } rdr.Close(); } DateTime endTime = DateTime.Now ; TimeSpan elapsedTime = endTime - startTime; Console.WriteLine("File Line Counter = {0}", lineCounter.ToString()); Console.WriteLine("Total Counter = {0}", totalCounter.ToString()); Console.WriteLine("ElapsedTime = {0} seconds", elapsedTime.TotalSeconds.ToString()); Console.WriteLine("ElapsedTime = {0} minutes", elapsedTime.TotalMinutes.ToString()); } } } -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 7:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, >Would that have any (economical) sense for your customer to improve DB bulk loading time? I don't understand the context - would what have any economical sense? >Why you do not use 64 bit .Net Framework to run your code on the server side? My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. First, I am a one man show with a month by month budget. Second, In order to get maximum bang for my hard earned dollar I build my own systems. I was talking to the owner of the company that does my address validation and they just spend $25,000 for a DELL server with 32 megs of data and windows 2003 x64. I don't have that kind of money. When you buy a DELL (as an example) then getting Windows x64 to install is a simple click of the button on the order page. Getting windows x64 to install on a desktop is not so simple, with issues for ALL of the drivers from video, network, disk etc. When I built the workstations I use to run SQL Server I did not understand the size of the task; Now I do. I will be building a new server this fall with a server motherboard, designed and certified to run the X64 versions of windows, with drivers supplied etc. It will be a dual processor / 8 core machine which will contain 32 megs or ram to start, 64 megs eventually. I MAY be able to get Windows 2003 x64 to run on the current servers, and if I can then I will but I am not holding my breath. Even if I can, they max out at 8 megs of ram that they can address so they will still be underpowered for my purpose. >Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? I am still working through that. The third party lib, DataStreams from www.csvreader.com Has a set of objects (readers) which can read and write streams to and from files. The docs are complete but the examples are sparse! However the author is available on his forums to answer questions and generally responds within a few hours. Basically what happens is that you instantiate one of the reader objects, tell the object what data type each column will be and then pass in a stream from that object to the SQLBulkCopy object. The DataStreams reader object handles all of the opening of the file, parsing the CSV file into an array and writing the array data into the stream. It appears to handle chunks of data so that the entire file does not have to fit into memory at once. With a CSV file, typically there is a header line in the first row. DataStreams reads that in and does the mapping for you if that row exists. He also has methods for obtaining the collection of field names etc, so I am actually building code to automatically build a table in SQL Server based on the names in the field names collection, plus a PK column of my own (long autoincrement) out at the end. His code correctly feeds the data into the table IF the columns from the file are the first columns, i.e. the PK is at the end of the table, but does not correctly handle the data feed if the PK is the first field in the table (and there is no PK field in the data). Remember that I have two distinct cases. 1) Data (lists) from vendors. These may have some "PK" of their own, but I do not know what it is or whether there will be one (typically not) so I just routinely build my own. 2) Data that I export from SQL Server, process, and get back from the address validation software. Those CSVs already have a PKID because my source tables have one and I export that PKID into the CSV file when I do the export from SQL Server. Given the costs of the lib, I am very impressed with the implementation so far. He provides a record event to allow preprocessing data within each record being read before sending it off to the SQLBulkCopy. You can do anything you might imagine with such control - look for specific data values in a given field, skip the record based on such evaluations, modify the data in specific fields etc, all on-the-fly as the data moves from CSV to SQL Server. I believe it also handles fixed width files which is also on my plate. So basically I just outsourced one small but complex part of the project. It was easy to get working and seems pretty fast so I am happy with the results so far. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Tue Jul 24 14:54:44 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 23:54:44 +0400 Subject: [dba-VB] Count of specific character In-Reply-To: <20070724193307.C3D38BE7E@smtp-auth.no-ip.com> Message-ID: <000101c7ce2c$7b5ace60$6401a8c0@nant> Hello John, You can use System.Text.RegularExpressions (see for details in MSDN) - here is a C# sample: // count 'a' char occurrences string testString = "One car red car blue car"; MatchCollection matches = Regex.Matches(testString, "[a]"); Console.WriteLine(matches.Count.ToString()); Please take into account that Regex is not "lightning fast" - I mean experts do not recommend to rely on its speed to investigate/parse large amounts of text data in short time... If time is not an issue then Regex can do in a few (one!?) line of code many things, which manually written will take many more code lines. Although as I noted above manually written custom code could be (much) quicker than Regex to "pump through" large amounts of text data... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 11:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Count of specific character Is there any single function that will return a count of a specific character in a string? I have a situation where (apparently) the header of a CSV file has the same field name twice. I am trying to determine what is going on, so I want to count the field separator characters in the header and the first line of real data to see if there are more fields in the header than in the data or if something else is going on. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 15:29:16 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 16:29:16 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000001c7ce2a$03a5e320$6401a8c0@nant> Message-ID: <20070724202926.DD477BD76@smtp-auth.no-ip.com> Shamil, >John, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... Understood, I will answer so that it will be available for when you are back. >I meant does your customer need to make bulk loading any faster or not? The short answer is yes. The long answer is really that I did not buy the library to make the speed faster, I bought it to make the implementation (coding) faster by not having to handle this part myself. However to answer your question directly, I am moving to a model where I charge the client for each operation, i.e. for computer time. IOW, in each process that imports or exports data, the amount of time required to perform that process is logged, and will (eventually) be directly entered into a billing program. So the client will be billed for X hours of computer time, where A hours are used for import of raw data lists, B hours are used for address export, C hours are used for address validation (by a different server in my office), D hours are used to import the data back into the SQL Server database, etc. I will not be breaking the time down on the bill, I envision billing line items like $XXX for address import of raw data list XYZ $YYY for address validation of list QRS Etc. With luck (and hard work), someday soon these processes will run totally automatically, with no manual input from me. Thus I will be essentially charging for "process", not my personal time. This billing method allows the client to understand the overall costs. But by logging the actual times required for doing each part I can understand where my bottlenecks are, plan for upgrades to handle my requirements etc. So the faster it works the less I make and the more the client saves. 8-( Alternatively, the faster it runs the more lists I can run on a given machine in a given period of time. 8-) I am really trying to sell the customer on how efficient it is (vs. his old method) to import his lists, and then export / address validate / reimport them. The client does not understand the mechanics behind the process, nor does he want to or care to. What he does understand is that it used to cost him (literally) $1.25 / thousand names to get addresses validated. I can do it for $.12 / thousand names, or about 1/10th his previous cost. Not only can I do it for that, I can make a killing doing it at that cost, IF I can move the frequency up to once per month or even every three months. The lists have to be reprocessed every X time units, perhaps monthly, perhaps quarterly. Again, by being able to demonstrate efficiency, I can convince the client that is cost effective to use my service, and also cost effective to perform this service monthly instead of waiting every six months or every year. He gets to sell his business by marketing "addresses cleaned monthly", and believe me that is important to his client. I doubt he will drop his cost to pass on the cost savings so he ends up making more / thousand names since he is now paying way less to do that process. His previous provider was so expensive that he literally did the address validation on each order and passed the cost through. I want a business model where he can afford (and he CAN!) to do this process monthly on each of his lists. Thus I get an income stream that I can depend on, and I get a process that does not cost me MY TIME, but rather sells the client my computer's time. "More work, more / faster computers" instead of "more work, more of MY TIME". I want to be sitting on the beach while my computers are earning me money. So yea, it always pays to do something faster, whether in my ability to make more money on each hour of machine time, or my ability to be more efficient and sell that to the client and get more work. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, <<< I don't understand the context - would what have any economical sense? >>> I meant does your customer need to make bulk loading any faster or not? You know one may fly Paris - NY using ordinary Boeing planes, one can use (in the past) Concord or even TU-144(!?) (http://en.wikipedia.org/wiki/Tupolev_Tu-144) - IOW does your customer still need Concord for their task or current very good Boeing solution is good enough for them now and for a long time in the future? I also mean we can try to find what is (if any) bottleneck of the current solution and "break" this bottleneck? Some tests (Dual Core 3MHz, 2GB, W2003 Server, simple IDE/SATA 7400rpm HDD) - the raw performance of reading a delimited by TAB char CSV file in .NET: Total Counter = 1011852 (1 million...) ElapsedTime = 3,359375 seconds ElapsedTime = 0,0559895833333333 minutes Total Counter = 10006092 (10 million...) ElapsedTime = 32,890625 seconds ElapsedTime = 0,548177083333333 minutes Total Counter = 100010952 (100 million...) ElapsedTime = 327,875 seconds ElapsedTime = 5,46458333333333 minutes Splitting of CSV file lines into array added... Total Counter = 1011852 (1 million...) ElapsedTime = 8,375 seconds ElapsedTime = 0,139583333333333 minutes ... (I didn't have time to test other cases of 10 and 100 million source file lines - please do if you have time...) Of course that is just reading the file - the open question is how closely this extreme files reading performance can be approached when such a file is bulk loaded into MS SQL Database? Join, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... I must say I'm very interested to return here next week, sorry for any inconvenience... -- Shamil P.S. Simple C# code used for testing (watch line wraps): using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long MAX_LIMIT = 1000000; // 00; string s = @"F:\Temp\XL\ConsoleApplication1\IN\testfile.txt"; long totalCounter = 0; long lineCounter = 0; DateTime startTime = DateTime.Now; while (totalCounter < MAX_LIMIT) { System.IO.TextReader rdr = new System.IO.StreamReader(s); lineCounter = 0; string inline = ""; char delimiter = (char)9; while ((inline = rdr.ReadLine())!=null) { string[] fields = inline.Split(delimiter); ++totalCounter; ++lineCounter; } rdr.Close(); } DateTime endTime = DateTime.Now ; TimeSpan elapsedTime = endTime - startTime; Console.WriteLine("File Line Counter = {0}", lineCounter.ToString()); Console.WriteLine("Total Counter = {0}", totalCounter.ToString()); Console.WriteLine("ElapsedTime = {0} seconds", elapsedTime.TotalSeconds.ToString()); Console.WriteLine("ElapsedTime = {0} minutes", elapsedTime.TotalMinutes.ToString()); } } } From Chris.Foote at uk.thalesgroup.com Wed Jul 25 05:38:29 2007 From: Chris.Foote at uk.thalesgroup.com (Foote, Chris) Date: Wed, 25 Jul 2007 11:38:29 +0100 Subject: [dba-VB] Count of specific character Message-ID: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV > file has the same > field name twice. I am trying to determine what is going on, > so I want to > count the field separator characters in the header and the > first line of > real data to see if there are more fields in the header than > in the data or > if something else is going on. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Jul 25 08:20:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 25 Jul 2007 09:20:05 -0400 Subject: [dba-VB] Count of specific character In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Message-ID: <20070725132017.45122BC2A@smtp-auth.no-ip.com> Wow. That does work. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 6:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 DWUTKA at Marlow.com Wed Jul 25 08:08:21 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 25 Jul 2007 08:08:21 -0500 Subject: [dba-VB] Count of specific character In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> References: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Message-ID: Neat trick, you could do that with Replace in VB. Len(strTemp)-Len(Replace(strTemp,"X","")) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 5:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From ebarro at verizon.net Wed Jul 25 09:07:29 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 25 Jul 2007 07:07:29 -0700 Subject: [dba-VB] Count of specific character In-Reply-To: Message-ID: <0JLQ007KNN7CGNW3@vms046.mailsrvcs.net> And in .NET (both VB and C#)... strTemp.Length - strTemp.Replace("X", "").Length -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, July 25, 2007 6:08 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Count of specific character Neat trick, you could do that with Replace in VB. Len(strTemp)-Len(Replace(strTemp,"X","")) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 5:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.19/917 - Release Date: 7/25/2007 1:16 AM From jwcolby at colbyconsulting.com Fri Jul 27 09:49:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 27 Jul 2007 10:49:23 -0400 Subject: [dba-VB] VB.Net - Proxy Class Message-ID: <20070727144938.81890BF2D@smtp-auth.no-ip.com> I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Jul 27 10:14:13 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jul 2007 08:14:13 -0700 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727144938.81890BF2D@smtp-auth.no-ip.com> References: <20070727144938.81890BF2D@smtp-auth.no-ip.com> Message-ID: John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jul 27 10:13:27 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jul 2007 10:13:27 -0500 Subject: [dba-VB] Odd problem with VB 6 application Message-ID: This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Jul 27 11:31:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 27 Jul 2007 12:31:32 -0400 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: Message-ID: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> Charlotte, Thanks for that. In fact I am examining using back ground threads to handle the process class work, however not knowing as much as I need to about VB.Net and .Net in general I want to get the entire process running (so I can do work) and then go investigate and use threads and background workers. In the meantime, what I am think of is a "middle man" class. The form knows about the middle man and can sink its events. The middle man can sink events from any class that implements a certain interface (but I think that is the wrong terminology here). The middle man sinks events from any class that can raise those events, and just immediately raises its own event, identically named, passing the parameters on. I have something similar to in concept but not exactly the same in implementation already working in VBA. I call it a message class. A message class is instantiated. It has a method that is called to send a message. Anyone with a pointer to the message class instance can call a method of the class instance and send a message. The message class simply raises an event and passes on the message. Anyone with a pointer to the message class can sink its events and receive any message. The message class is a middleman. Each end has to know about and get a pointer to the a clsMessage instance but they do not have to know about each other specifically. clsProcess needs to send a message. It gets a pointer to a clsMessage instance, calls a method of that instance and sends the message. clsMonitor needs to monitor clsProcess. It gets a pointer to the clsMessage instance and sinks it's events. Whenever clsProcess sends a message, it is passed through clsMessage and received by clsMonitor. clsMonitor can receive messages from ANY clsProcess (or any other class that sends messages on that instance of clsMessage). clsProcess can send messages and not worry about whether anyone is listening. If some class wants to log clsProcess' messages they can, if some other class wants to display clsProcess' messages on a form, they can etc. Loosely coupled interface, implemented through a common class instance. In fact messages can be sent back and forth between two classes or 100 classes, all listening on the message channel. BTW, a demo of that is on my web site in the WithEvents demo section. So I am looking to implement a similar construct here. In .Net though I have more flexibility in implementation because there are more capabilities available. Real inheritance, casting of an object to a specific data type etc. I do not know whether I can do what I am struggling to conceptualize. I want a process class to raise events. This allows the loosely coupled interface on the sending end. I want a proxy class instance to sink those events and retransmit them I want a progress form to sink events from a specific proxy class instance and use them. This allows the loosely coupled interface in the receiving end. The proxy class in the middle is the issue. IF I could create a clsProxy instance, pass in clsProcess to that instance as an OBJECT, then cast that object to a class that can be used WithEvents in a dim statement I would be there. I do not know how to do this. I can use the message class concept, I have already implemented that in VBA. That has the disadvantage of having to set up the message class instance and passing it in to the process class and to the progress form, but it is a lot more straightforward, and I can do that right now. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, July 27, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Fri Jul 27 11:54:45 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jul 2007 09:54:45 -0700 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> References: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> Message-ID: We use custom exception handlers, for example, and other "helper" classes. In the catch of a try-catch pair, we call the exception handler and pass it the exception and pops up a message ... But only for unhandled exceptions. We handle data exceptions in the data entity classes we create and pass the exception with custom message back to the calling object. We let the calling object then call a validationhelper class to handle the exception result it got, and that's were we pop up the messagebox and allow the user the OK or cancel options. We've tried to keep the model as untangled as possible, and the results affect the UI, so we make one-step jumps rather than daisy chaining events. I'm not sure whether that equates to what you're describing or not. We may, in fact, raise an event from a usercontrol, sink it in the parent of that usercontrol and raise another event from the parent to broadcast the result, if that's what you're describing. As for interface, we have defined interface classes, for instance for iToolbars and iValidation, which when implemented insert their shells into the object implementing them. In that object, we build code appropriate to whatever the event should do in that particular object. iValidation includes an IsValid function that accepts a feedbackstyle argument. The code in the object that implements it calls into the data entity class to validate a record before trying to update it. The validate event of the dataentity accepts a datarow uses the business rules tests in the entity and returns a boolean value for whether all the tests pass on the row. The calling object gets the boolean value back and if the record is valid, it save it. If it is not valid, it calls the ValidationHelper class to handle the exception message. That keeps up from changing something in the "middle" that breaks a bunch of other things. I don't know if that helps or not, because you're coming from a slightly different direction. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 9:32 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class Charlotte, Thanks for that. In fact I am examining using back ground threads to handle the process class work, however not knowing as much as I need to about VB.Net and .Net in general I want to get the entire process running (so I can do work) and then go investigate and use threads and background workers. In the meantime, what I am think of is a "middle man" class. The form knows about the middle man and can sink its events. The middle man can sink events from any class that implements a certain interface (but I think that is the wrong terminology here). The middle man sinks events from any class that can raise those events, and just immediately raises its own event, identically named, passing the parameters on. I have something similar to in concept but not exactly the same in implementation already working in VBA. I call it a message class. A message class is instantiated. It has a method that is called to send a message. Anyone with a pointer to the message class instance can call a method of the class instance and send a message. The message class simply raises an event and passes on the message. Anyone with a pointer to the message class can sink its events and receive any message. The message class is a middleman. Each end has to know about and get a pointer to the a clsMessage instance but they do not have to know about each other specifically. clsProcess needs to send a message. It gets a pointer to a clsMessage instance, calls a method of that instance and sends the message. clsMonitor needs to monitor clsProcess. It gets a pointer to the clsMessage instance and sinks it's events. Whenever clsProcess sends a message, it is passed through clsMessage and received by clsMonitor. clsMonitor can receive messages from ANY clsProcess (or any other class that sends messages on that instance of clsMessage). clsProcess can send messages and not worry about whether anyone is listening. If some class wants to log clsProcess' messages they can, if some other class wants to display clsProcess' messages on a form, they can etc. Loosely coupled interface, implemented through a common class instance. In fact messages can be sent back and forth between two classes or 100 classes, all listening on the message channel. BTW, a demo of that is on my web site in the WithEvents demo section. So I am looking to implement a similar construct here. In .Net though I have more flexibility in implementation because there are more capabilities available. Real inheritance, casting of an object to a specific data type etc. I do not know whether I can do what I am struggling to conceptualize. I want a process class to raise events. This allows the loosely coupled interface on the sending end. I want a proxy class instance to sink those events and retransmit them I want a progress form to sink events from a specific proxy class instance and use them. This allows the loosely coupled interface in the receiving end. The proxy class in the middle is the issue. IF I could create a clsProxy instance, pass in clsProcess to that instance as an OBJECT, then cast that object to a class that can be used WithEvents in a dim statement I would be there. I do not know how to do this. I can use the message class concept, I have already implemented that in VBA. That has the disadvantage of having to set up the message class instance and passing it in to the process class and to the progress form, but it is a lot more straightforward, and I can do that right now. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, July 27, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting 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 shamil at users.mns.ru Fri Jul 27 12:56:14 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 27 Jul 2007 21:56:14 +0400 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727144938.81890BF2D@smtp-auth.no-ip.com> Message-ID: <000501c7d077$6cae5b00$6401a8c0@nant> Hello John, Beware! - you're entering tricky world of threads, events and delegates (you never know what happens next in this world I mean). Be especially careful with sending notification to the form (thread) from worker processes - as Charlotte noted here System.ComponentModel.BackgroundWorker is the most safe solution for this case while you're getting through learning curve.... Sample code without using System.ComponentModel.BackgroundWorker and not tested with WinForms - just use VB.NET console application to run it (watch line wraps): ============ Imports System.Threading Imports System.Collections.Generic Module SSTestOfEventsAndDelegates ' // Delegate declaration Public Delegate Sub TestEventDelegate(ByVal objectId As Long, ByVal msgId As Integer) ' // main object (form simulator) Public Class TestForm Private WithEvents _proxy _ As New TestProcessEventsProxy() Private _testCount As Integer = 0 Private Sub _proxy_TestEvent(ByVal objectId As Long, ByVal msgId As Integer) _ Handles _proxy.TestEvent Console.WriteLine("TestForm: Message {0}.{1} arrived.", msgId, objectId) _testCount += 1 End Sub Public Sub Test() _proxy.Test() Dim startTime As DateTime = DateTime.Now Dim ts As TimeSpan = TimeSpan.MinValue Dim currentTime As DateTime = DateTime.MinValue While (_testCount < 9) And _ (ts < New TimeSpan(50000000)) '// 5s ts = DateTime.Now - startTime System.Threading.Thread.Sleep(250) Console.WriteLine("TestForm: Waiting for events, count = {0}, timeSpan = {1} s...", _ _testCount, ts.TotalSeconds) End While End Sub End Class ' // Proxy Public Class TestProcessEventsProxy Public Event TestEvent(ByVal Id As Long, ByVal msgId As Integer) Private _senders As List(Of System.Threading.Thread) = _ New List(Of System.Threading.Thread)() Public Sub Test() For i As Integer = 1 To 3 Dim newThread As System.Threading.Thread = _ New System.Threading.Thread(AddressOf myThread) newThread.Start() _senders.Add(newThread) Next i End Sub Protected Sub myThread() Dim obj As New TestProcess(AddressOf TestEventHook) obj.Test() End Sub Public Sub TestEventHook(ByVal objectId As Long, ByVal msgId As Integer) Console.WriteLine("Proxy: Message {0}.{1} is to be retransmitted.", objectId, msgId) RaiseEvent TestEvent(objectId, msgId) Console.WriteLine("Proxy: Message {0}.{1} has been retransmitted.", objectId, msgId) End Sub End Class ' // worker process Public Class TestProcess Private Shared _id As Long = 0 Private _myId As Long Private _myDelegate As TestEventDelegate Private _myMessageId As Long = 0 Public Sub New(ByRef eventDeleGate As TestEventDelegate) _myId = Interlocked.Increment(_id) _myDelegate = eventDeleGate End Sub Public Sub Test() For i As Integer = 1 To 3 _mymessageId += 1 System.Threading.Thread.Sleep(300) Console.WriteLine("Process: Message {0}.{1} is to be sent.", _myId, _myMessageId) _myDelegate.Invoke(_myId, _myMessageId) Console.WriteLine("Process: Message {0}.{1} has been sent.", _myId, _myMessageId) Next i End Sub End Class '// test Sub Main() Dim obj As New TestForm() obj.Test() End Sub End Module My results: =========== TestForm: Waiting for events, count = 0, timeSpan = 0 s... Process: Message 2.1 is to be sent. Process: Message 1.1 is to be sent. Proxy: Message 2.1 is to be retransmitted. Proxy: Message 1.1 is to be retransmitted. TestForm: Message 1.2 arrived. Proxy: Message 2.1 has been retransmitted. Process: Message 2.1 has been sent. Process: Message 3.1 is to be sent. Proxy: Message 3.1 is to be retransmitted. TestForm: Message 1.3 arrived. Proxy: Message 3.1 has been retransmitted. Process: Message 3.1 has been sent. TestForm: Message 1.1 arrived. Proxy: Message 1.1 has been retransmitted. Process: Message 1.1 has been sent. TestForm: Waiting for events, count = 3, timeSpan = 0,25 s... Process: Message 2.2 is to be sent. Proxy: Message 2.2 is to be retransmitted. TestForm: Message 2.2 arrived. Proxy: Message 2.2 has been retransmitted. Process: Message 2.2 has been sent. Process: Message 3.2 is to be sent. Proxy: Message 3.2 is to be retransmitted. TestForm: Message 2.3 arrived. Proxy: Message 3.2 has been retransmitted. Process: Message 1.2 is to be sent. Proxy: Message 1.2 is to be retransmitted. TestForm: Message 2.1 arrived. Proxy: Message 1.2 has been retransmitted. Process: Message 1.2 has been sent. Process: Message 3.2 has been sent. TestForm: Waiting for events, count = 6, timeSpan = 0,5 s... Process: Message 2.3 is to be sent. Proxy: Message 2.3 is to be retransmitted. TestForm: Message 3.2 arrived. Proxy: Message 2.3 has been retransmitted. Process: Message 2.3 has been sent. Process: Message 1.3 is to be sent. Proxy: Message 1.3 is to be retransmitted. TestForm: Message 3.1 arrived. Proxy: Message 1.3 has been retransmitted. Process: Message 1.3 has been sent. Process: Message 3.3 is to be sent. Proxy: Message 3.3 is to be retransmitted. TestForm: Message 3.3 arrived. Proxy: Message 3.3 has been retransmitted. Process: Message 3.3 has been sent. TestForm: Waiting for events, count = 9, timeSpan = 0,75 s... Press any key to continue . . . -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 6:49 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 27 20:20:14 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Sat, 28 Jul 2007 11:20:14 +1000 Subject: [dba-VB] Odd problem with VB 6 application References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289B06@ddi-01.DDI.local> Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Sat Jul 28 03:47:38 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 28 Jul 2007 03:47:38 -0500 Subject: [dba-VB] Odd problem with VB 6 application In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D01289B06@ddi-01.DDI.local> Message-ID: Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From shamil at users.mns.ru Sat Jul 28 05:29:28 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Sat, 28 Jul 2007 14:29:28 +0400 Subject: [dba-VB] Odd problem with VB 6 application In-Reply-To: Message-ID: <000001c7d102$2d8e9fd0$6401a8c0@nant> <<< You have to disable UAC. Not sure about regserver, but I assume it's the same. >>> Rather smooth workaround is to use INNO-Setup starting latest versions - just make simple installation of your ActiveX using INNO-Setup and you'll get manifest file automatically injected in it and this manifest file will elevate the user privileges on setup and will bypass UAC trouble... Not sure it works that way for very restricted Vista users but for standard non admin users it works that way - tested... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, July 28, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 28 12:51:13 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 28 Jul 2007 13:51:13 -0400 Subject: [dba-VB] VB.Net - Can tables be streams? Message-ID: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> I have a "serializable" class that serializes the data from a form to stream. Currently the stream is written to file. I am wondering if I can write it to a table instead by substituting a different kind of stream? John W. Colby Colby Consulting www.ColbyConsulting.com From shamil at users.mns.ru Sat Jul 28 17:41:19 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Sun, 29 Jul 2007 02:41:19 +0400 Subject: [dba-VB] VB.Net - Can tables be streams? In-Reply-To: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> Message-ID: <000f01c7d168$6a3a0620$6401a8c0@nant> Hello John, You can try to use DataSet's ReadXml method to load a DataSet instance with data, which you can then persist to a table.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 28, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Can tables be streams? I have a "serializable" class that serializes the data from a form to stream. Currently the stream is written to file. I am wondering if I can write it to a table instead by substituting a different kind of stream? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mmattys at rochester.rr.com Sat Jul 28 19:39:23 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sat, 28 Jul 2007 20:39:23 -0400 Subject: [dba-VB] VB.Net - Can tables be streams? References: <000f01c7d168$6a3a0620$6401a8c0@nant> Message-ID: <002201c7d178$ea2cbe30$0202a8c0@Laptop> Reports have been coming in of strange, insane laughter coming from the Colby house ... echoing in the mountains ... Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: Sent: Saturday, July 28, 2007 6:41 PM Subject: Re: [dba-VB] VB.Net - Can tables be streams? > Hello John, > > You can try to use DataSet's ReadXml method to load a DataSet instance > with > data, which you can then persist to a table.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 28, 2007 9:51 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] VB.Net - Can tables be streams? > > I have a "serializable" class that serializes the data from a form to > stream. Currently the stream is written to file. I am wondering if I can > write it to a table instead by substituting a different kind of stream? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com From thewaddles at sbcglobal.net Sat Jul 28 19:40:18 2007 From: thewaddles at sbcglobal.net (Kevin Waddle) Date: Sat, 28 Jul 2007 17:40:18 -0700 Subject: [dba-VB] VB6 Datarepeater Code In-Reply-To: <000f01c7d168$6a3a0620$6401a8c0@nant> References: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> <000f01c7d168$6a3a0620$6401a8c0@nant> Message-ID: <001301c7d179$0a09c950$6600a8c0@TheWaddles> Hello, I am trying to recreate an Access continuous form in a VB6 exe using the datarepeater control. I have created a ActiveX control containing a TextBox and a CheckBox. These are bound to an Access mdb file. I can display and update the textbox but cannot get anything to display properly on the checkboxes. The control will display the checkbox as true only when the record is active. Does anyone have an example using the datarepeater control with a checkbox or another avenue to create a continuous form in VB6? Thank you, Kevin Chocolate moose: 1 medium size moose, 20 pounds chocolate. From mmattys at rochester.rr.com Sat Jul 28 19:54:24 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sat, 28 Jul 2007 20:54:24 -0400 Subject: [dba-VB] VB6 Datarepeater Code References: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> <000f01c7d168$6a3a0620$6401a8c0@nant> <001301c7d179$0a09c950$6600a8c0@TheWaddles> Message-ID: <003501c7d17b$060daa90$0202a8c0@Laptop> Kevin, I haven't an example, but maybe KB Article 197428 will help? http://support.microsoft.com/kb/197428 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Kevin Waddle" To: Sent: Saturday, July 28, 2007 8:40 PM Subject: [dba-VB] VB6 Datarepeater Code > Hello, > > I am trying to recreate an Access continuous form in a VB6 exe using the > datarepeater control. > > I have created a ActiveX control containing a TextBox and a CheckBox. > These are bound to an Access mdb file. > I can display and update the textbox but cannot get anything to display > properly on the checkboxes. > > The control will display the checkbox as true only when the record is > active. > > Does anyone have an example using the datarepeater control with a checkbox > or another avenue to create a continuous form in VB6? > > Thank you, > Kevin > > > Chocolate moose: 1 medium size moose, 20 pounds chocolate. > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com From michael at ddisolutions.com.au Sun Jul 29 19:10:45 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 30 Jul 2007 10:10:45 +1000 Subject: [dba-VB] Odd problem with VB 6 application References: <000001c7d102$2d8e9fd0$6401a8c0@nant> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289B07@ddi-01.DDI.local> Yeah I also use Inno for all VB6 deployments, or I used to. Most new projects are in .net these days. However I have to maintain a lot of VB6 code. I don't really want to do a full install for each minor change to a dll, know what I mean? I guess with Vista I wont have a choice. cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, 28 July 2007 8:29 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application <<< You have to disable UAC. Not sure about regserver, but I assume it's the same. >>> Rather smooth workaround is to use INNO-Setup starting latest versions - just make simple installation of your ActiveX using INNO-Setup and you'll get manifest file automatically injected in it and this manifest file will elevate the user privileges on setup and will bypass UAC trouble... Not sure it works that way for very restricted Vista users but for standard non admin users it works that way - tested... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, July 28, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 09:03:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 10:03:56 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code Message-ID: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Mon Jul 30 10:49:04 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 08:49:04 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> References: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> Message-ID: Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 11:04:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 12:04:22 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730160428.2B49BBCC8@smtp-auth.no-ip.com> LOL. Uhh.... Yea, sure... ;-) John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 11:44:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 12:44:53 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Mon Jul 30 12:03:28 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 10:03:28 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> References: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> Message-ID: No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 Mon Jul 30 12:12:29 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 13:12:29 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> Well... That is pretty hard to say but I think so. I pretty much just choose the defaults. I read somewhere that there can be issues caused by copying files from one computer to another. Something about the security kicking in because Windows XP marks the files as "coming from" a specific computer and now it is not being run on that computer. I have to wonder if it is related to that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 1:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Mon Jul 30 13:08:12 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 11:08:12 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> References: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> Message-ID: Don't know. We use source safe, so all our files get copied from the same location to the local drive. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 10:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Well... That is pretty hard to say but I think so. I pretty much just choose the defaults. I read somewhere that there can be issues caused by copying files from one computer to another. Something about the security kicking in because Windows XP marks the files as "coming from" a specific computer and now it is not being run on that computer. I have to wonder if it is related to that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 1:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 4 10:24:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 4 Jul 2007 11:24:23 -0400 Subject: [dba-VB] VB.Net - System.IO.Stream Message-ID: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> I am working with a library that wants a stream passed in. NOT a StreamReader, a plain old stream. According to the docs, Stream is supposed to be a member of System.IO but it does not appear to be. According to Microsoft's docs, Stream is supposed to be the base class and is supposed to be accessible. I cannot get at it. Does anyone know how to reference System.IO.Stream? John W. Colby Colby Consulting www.ColbyConsulting.com From chizotz at mchsi.com Wed Jul 4 12:34:48 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 4 Jul 2007 12:34:48 -0500 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> References: <20070704152439.5CBE0BEBF@smtp-auth.no-ip.com> Message-ID: <5310128033.20070704123448@mchsi.com> Hi John, Stream is an abstract class so an instance can't be created. You need to create an instance of a specific type of stream then pass that. I've never used it, but I suspect what you need is a MemoryStream, you might want to check into that. Ron Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > I am working with a library that wants a stream passed in. NOT a > StreamReader, a plain old stream. According to the docs, Stream is supposed > to be a member of System.IO but it does not appear to be. According to > Microsoft's docs, Stream is supposed to be the base class and is supposed to > be accessible. I cannot get at it. > Does anyone know how to reference System.IO.Stream? --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com From gustav at cactus.dk Wed Jul 4 16:43:08 2007 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 04 Jul 2007 23:43:08 +0200 Subject: [dba-VB] Menu control Message-ID: Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From jwcolby at colbyconsulting.com Wed Jul 4 18:48:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 4 Jul 2007 19:48:37 -0400 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <5310128033.20070704123448@mchsi.com> Message-ID: <20070704234853.B108ABD83@smtp-auth.no-ip.com> Ron, Unfortunately intellisense is telling me that a type STREAM is required, and furthermore if I try to pass any of the subtypes the DLLs class constructor refuses to accept it. It seems that I cannot do a new on it but I may be able to somehow dim an instance of the base class. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen Sent: Wednesday, July 04, 2007 1:35 PM To: jwcolby Subject: Re: [dba-VB] VB.Net - System.IO.Stream Hi John, Stream is an abstract class so an instance can't be created. You need to create an instance of a specific type of stream then pass that. I've never used it, but I suspect what you need is a MemoryStream, you might want to check into that. Ron Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > I am working with a library that wants a stream passed in. NOT a > StreamReader, a plain old stream. According to the docs, Stream is > supposed to be a member of System.IO but it does not appear to be. > According to Microsoft's docs, Stream is supposed to be the base class > and is supposed to be accessible. I cannot get at it. > Does anyone know how to reference System.IO.Stream? --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From martyconnelly at shaw.ca Wed Jul 4 21:08:29 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Wed, 04 Jul 2007 19:08:29 -0700 Subject: [dba-VB] VB.Net - System.IO.Stream In-Reply-To: <20070704234853.B108ABD83@smtp-auth.no-ip.com> References: <20070704234853.B108ABD83@smtp-auth.no-ip.com> Message-ID: <468C529D.4030505@shaw.ca> I thought it was dedclared this way Imports System.IO Dim s As System.IO.Stream jwcolby wrote: >Ron, > >Unfortunately intellisense is telling me that a type STREAM is required, and >furthermore if I try to pass any of the subtypes the DLLs class constructor >refuses to accept it. It seems that I cannot do a new on it but I may be >able to somehow dim an instance of the base class. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen >Sent: Wednesday, July 04, 2007 1:35 PM >To: jwcolby >Subject: Re: [dba-VB] VB.Net - System.IO.Stream > >Hi John, > >Stream is an abstract class so an instance can't be created. You need to >create an instance of a specific type of stream then pass that. I've never >used it, but I suspect what you need is a MemoryStream, you might want to >check into that. > >Ron > > >Wednesday, July 4, 2007, 10:24:23 AM, you wrote: > > > >>I am working with a library that wants a stream passed in. NOT a >>StreamReader, a plain old stream. According to the docs, Stream is >>supposed to be a member of System.IO but it does not appear to be. >>According to Microsoft's docs, Stream is supposed to be the base class >>and is supposed to be accessible. I cannot get at it. >> >> > > > >>Does anyone know how to reference System.IO.Stream? >> >> > > > > >--- >avast! Antivirus: Outbound message clean. >Virus Database (VPS): 000754-0, 07/04/2007 Tested on: 7/4/2007 12:34:49 PM >avast! - copyright (c) 1988-2007 ALWIL Software. >http://www.avast.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 > > > > > -- Marty Connelly Victoria, B.C. Canada From Jdemarco at hudsonhealthplan.org Thu Jul 5 07:02:45 2007 From: Jdemarco at hudsonhealthplan.org (Jim DeMarco) Date: Thu, 5 Jul 2007 08:02:45 -0400 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: <0B8880A20E2CF24280FA60901E108FB08F28EF@TTNEXCHSVR.hshhp.com> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 5 09:15:26 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jul 2007 16:15:26 +0200 Subject: [dba-VB] Menu control Message-ID: Hi Jim It was something like this I had in mind: http://www.divil.co.uk/net/controls/eyefinder/rendering.aspx It is for VS2005. /gustav >>> Jdemarco at hudsonhealthplan.org 05-07-2007 14:02 >>> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From cfoust at infostatsystems.com Thu Jul 5 12:12:30 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 5 Jul 2007 10:12:30 -0700 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 5 12:35:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 5 Jul 2007 13:35:53 -0400 Subject: [dba-VB] Menu control In-Reply-To: Message-ID: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> >We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Jane, you ignorant slut (to quote one of my favorite SNL skits). I must say I can't for the life of me figure out WHY you would avoid a piece of trash that takes up 1/4 of the screen in low resolution modes. But that is of course just my own opinion. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 05, 2007 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 5 15:12:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 5 Jul 2007 13:12:03 -0700 Subject: [dba-VB] Menu control In-Reply-To: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> References: <20070705173611.B5D02BF86@smtp-auth.no-ip.com> Message-ID: Why, John, what a sweet thing to say!! LOL We finally agree on something ... The ribbon, that is. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 05, 2007 10:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control >We basically give the user multiple ways to get at menu options and we >are actively avoiding *ribbons*!! Jane, you ignorant slut (to quote one of my favorite SNL skits). I must say I can't for the life of me figure out WHY you would avoid a piece of trash that takes up 1/4 of the screen in low resolution modes. But that is of course just my own opinion. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 05, 2007 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control We use Infragistics controls, which are far from free but are very reliable and enough like Access objects to feel familiar. We are using the Outlook metaphor, which doesn't thrill me but is popular. We also have menubars at the top of the screen and context menus available. We basically give the user multiple ways to get at menu options and we are actively avoiding *ribbons*!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 2:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Jdemarco at hudsonhealthplan.org Fri Jul 6 13:17:51 2007 From: Jdemarco at hudsonhealthplan.org (Jim DeMarco) Date: Fri, 6 Jul 2007 14:17:51 -0400 Subject: [dba-VB] Menu control In-Reply-To: References: Message-ID: <0B8880A20E2CF24280FA60901E108FB08F2961@TTNEXCHSVR.hshhp.com> That's a nice looking control eh? I think the one I just sent you is older. Good luck, Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 05, 2007 10:15 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Menu control Hi Jim It was something like this I had in mind: http://www.divil.co.uk/net/controls/eyefinder/rendering.aspx It is for VS2005. /gustav >>> Jdemarco at hudsonhealthplan.org 05-07-2007 14:02 >>> Gustav, Which VB are you using. The new Office Ribbon control is now being pushed out by various third party control vendors so I'm guessing that this type of navigation is becoming mainstream. I did find a free Outlook style control from SandBar but I don't see it offered on their site, http://www.divil.co.uk/net/. I think they're charging for it now. It's a .NET tool. I have an older zip of the free version if you want to see it. Off-line request please. Jim DeMarco -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, July 04, 2007 5:43 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Mon Jul 9 20:35:54 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Tue, 10 Jul 2007 11:35:54 +1000 Subject: [dba-VB] Menu control References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289A19@ddi-01.DDI.local> Dotnetbar is my favourite. It covers just about every UI menu/toolbar style going back to Office 2000. It also does docking windows, which I like a lot. 200 USD IIRC. Well worth it IMO. http://www.devcomponents.com/dotnetbar/ cheers Michael M Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Tue Jul 10 03:08:17 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 10 Jul 2007 10:08:17 +0200 Subject: [dba-VB] Menu control Message-ID: Hi Michael Thanks! It seems to be very comprehensive ... /gustav >>> michael at ddisolutions.com.au 10-07-2007 03:35 >>> Dotnetbar is my favourite. It covers just about every UI menu/toolbar style going back to Office 2000. It also does docking windows, which I like a lot. 200 USD IIRC. Well worth it IMO. http://www.devcomponents.com/dotnetbar/ cheers Michael M Subject: [dba-VB] Menu control Hi all What kind of menu control or switchboard are you using for applications which are aimed at normal users working in an office? The Outlook-style is popular, I know, but what control to use to mimic that? Preferably free stuff. /gustav From Gustav at cactus.dk Tue Jul 10 11:51:14 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 10 Jul 2007 18:51:14 +0200 Subject: [dba-VB] Cheat Sheets Message-ID: Hi all "Learn Visual Studio" http://www.learnvisualstudio.net has just published this set of syntax/overview/etc cards which you may find handy and useful: We've spent a lot of time developing these free cheat sheets, to make your experience with Microsoft Visual Studio, even easier. And the best part is they're free for anyone to download. So, print 'em out, put 'em on your bulletin board, in your wallet, or near your computer to help give you a gentle nudge as you're writing code. We have 6 cheat sheets available for you to download in PDF format. Choose the one that works best for you, or grab them all, they're your's now. Take a look; ------------------------------------------------------------------------- VB Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=5cbf7baf-aef6-47da-9862-609444c12aa4 ------------------------------------------------------------------------- C# Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=ef94e215-f654-4f1f-9ff3-3a48e3d987b0 ------------------------------------------------------------------------- ASP.NET Language Basics ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=6cf3ecf8-668c-4614-9248-c75529149876 ------------------------------------------------------------------------- VB Toolbars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=83ebdfe5-6e9a-47c2-be3d-ee1077148bc3 ------------------------------------------------------------------------- C#Toolbars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=2116b801-40f6-49e7-868e-c7c90cbc5a1d ------------------------------------------------------------------------- Visual Web Developer Tool Bars & Menus ------------------------------------------------------------------------- http://www.learnvisualstudio.net/Email/Link.ashx?email=47a6014c-2d91-4a75-bfc1-7d3ef6073801&link=f9f74ae8-6bfb-4288-91ab-aaba042dd63d Watch for word wraps. /gustav From jwcolby at colbyconsulting.com Tue Jul 10 22:24:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 10 Jul 2007 23:24:36 -0400 Subject: [dba-VB] Build table Message-ID: <20070711032439.67F66BE14@smtp-auth.no-ip.com> I need to build a table in SQL Server given a server name, database name, table name and a list of fields. I have a rough draft as follows: Public Function mCreateTbl() As Boolean Dim strSQL As String With csvData.Columns Dim strName As String strSQL = "CREATE TABLE [" & mstrDatabaseName & "].[dbo].[" & mstrTblName & "] (" & _ "[PKID] [int] IDENTITY (1, 1) NOT NULL " For Each strName In .Names strSQL = strSQL & ",[" & strName & "] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL " Next strName strSQL = strSQL & ") ON [PRIMARY] " & _ "GO()" Dim strSQLAddKey As String strSQLAddKey = "ALTER TABLE [dbo].[" & mstrTblName & "] WITH NOCHECK ADD " & _ "CONSTRAINT [PKID] PRIMARY KEY CLUSTERED (" & _ "[PKID]() " & _ ") ON [PRIMARY] " & _ "GO()" End With End Function I have not yet even started testing it to get the strings compilable in SQL Server but if and when it comes together, what would the database objects (ADO?) look like to execute such a beast? Is anyone doing such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com From mikedorism at verizon.net Wed Jul 11 05:56:12 2007 From: mikedorism at verizon.net (Doris Manning) Date: Wed, 11 Jul 2007 06:56:12 -0400 Subject: [dba-VB] Build table In-Reply-To: <20070711032439.67F66BE14@smtp-auth.no-ip.com> References: <20070711032439.67F66BE14@smtp-auth.no-ip.com> Message-ID: <000901c7c3aa$18f4c6e0$2f01a8c0@Kermit> John, You will need an ADO Connection object and an ADO Command object. You don't need to include "GO()" in the SQL Statement. You only use that when you are working in Query Analyzer. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 10, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Build table I need to build a table in SQL Server given a server name, database name, table name and a list of fields. I have a rough draft as follows: Public Function mCreateTbl() As Boolean Dim strSQL As String With csvData.Columns Dim strName As String strSQL = "CREATE TABLE [" & mstrDatabaseName & "].[dbo].[" & mstrTblName & "] (" & _ "[PKID] [int] IDENTITY (1, 1) NOT NULL " For Each strName In .Names strSQL = strSQL & ",[" & strName & "] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL " Next strName strSQL = strSQL & ") ON [PRIMARY] " & _ "GO()" Dim strSQLAddKey As String strSQLAddKey = "ALTER TABLE [dbo].[" & mstrTblName & "] WITH NOCHECK ADD " & _ "CONSTRAINT [PKID] PRIMARY KEY CLUSTERED (" & _ "[PKID]() " & _ ") ON [PRIMARY] " & _ "GO()" End With End Function I have not yet even started testing it to get the strings compilable in SQL Server but if and when it comes together, what would the database objects (ADO?) look like to execute such a beast? Is anyone doing such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 11 09:19:36 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 10:19:36 -0400 Subject: [dba-VB] Visual studio help Message-ID: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Wed Jul 11 10:14:20 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 11 Jul 2007 08:14:20 -0700 Subject: [dba-VB] Visual studio help In-Reply-To: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> References: <20070711141940.0F966BE2C@smtp-auth.no-ip.com> Message-ID: By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 11 10:51:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 11:51:28 -0400 Subject: [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Wed Jul 11 11:04:55 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 11 Jul 2007 09:04:55 -0700 Subject: [dba-VB] Visual studio help In-Reply-To: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> References: <20070711155131.9F8C9BE74@smtp-auth.no-ip.com> Message-ID: Oh, that!! The filtering stuff has gotten progressively worse in VS with each version. Mine comes up by default filtered by Infragistics Software, even though the help pane itself amy have brought up the VB Language Reference information for whatever I hit F1 on. You can set the filter and it should remember it next time you hit F1, but I never bother because I rock back and forth between VB.Net and the custom help for the 3rd party tools and SQL Server. The filter seems to be only loosely coupled to the help pane, so I wouldn't depend on it for much unless you like drilling down tree views. The search tab is what I always use. You can type in the word or phrase, set you language, technology and content and see a list of search hits. That usually works best for me, kind of like searching the MSKB. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:51 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com; 'Access Developers discussion and problem solving' Subject: Re: [dba-VB] Visual studio help Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 Wed Jul 11 11:14:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:14:53 -0400 Subject: [dba-VB] Visual studio help In-Reply-To: Message-ID: <20070711161456.9C2DFBC01@smtp-auth.no-ip.com> Well, the problem is that the filter seems to control whether anything will appear. Given that the only choices are SQL stuff, if I try to search for something specific to VB.net language nothing appears. And since I cannot change the filters to anything else... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 12:05 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help Oh, that!! The filtering stuff has gotten progressively worse in VS with each version. Mine comes up by default filtered by Infragistics Software, even though the help pane itself amy have brought up the VB Language Reference information for whatever I hit F1 on. You can set the filter and it should remember it next time you hit F1, but I never bother because I rock back and forth between VB.Net and the custom help for the 3rd party tools and SQL Server. The filter seems to be only loosely coupled to the help pane, so I wouldn't depend on it for much unless you like drilling down tree views. The search tab is what I always use. You can type in the word or phrase, set you language, technology and content and see a list of search hits. That usually works best for me, kind of like searching the MSKB. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 8:51 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com; 'Access Developers discussion and problem solving' Subject: Re: [dba-VB] Visual studio help Yes, but if you hit F1 then it opens a help file of some sort. I can say whether it is going to use the local help or the internet help first etc. As for books online, well... I only know that term in terms of SQL Server. 1) Go into code. 2) Select some something, keyword, whatever. 3) Hit F1. What do you see? I see a help window. On the top blue bar it says "Microsoft Visual Studio 2005 Documentation". That is a good sign. However on the left hand side there is a Pane (or PAIN depending on your point of view), which has a "filter by" combo. The ONLY CHOICES (for me) are: SQL Server 2005 SQL Server Analysis Service SQL Server... SQL Server... SQL Server... Etc etc. I am locked in to filtering on SQL Server help. I DON'T WANT SQL SERVER HELP, I WANT VB HELP. Actually I want to be able to select VB, C#, Java, SQL Server and whatever else is appropriate in the context I am using. I am flying Visual Studio blind, unless all I am interested in is SQL Server help in which case I am ducky. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, July 11, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Visual studio help By SQL Server Help, do you mean BOL, John? I don't find the F1 especially usefull in VS 2005 except as a way to open the help window. I usually wind up doing a search once the help window has come up because it never seems to locate what I'm looking for otherwise. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 11, 2007 7:20 AM To: 'Access Developers discussion and problem solving'; dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Visual studio help I am still locked in to the SQL Server help when inside of visual Studio. If I hit F1 at any time, anywhere, with anything selected, help opens but it is SQL Server 2005 help. I need it to be VB.Net help, at least as the default. I cannot for the life of me determine where I can select a different default help file to open when I press F1. Does anyone out there have a clue? John W. Colby Colby Consulting 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 jwcolby at colbyconsulting.com Wed Jul 11 11:29:03 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 12:29:03 -0400 Subject: [dba-VB] [dba-SQLServer] Visual studio help In-Reply-To: <200707111605.l6BG50a6018086@databaseadvisors.com> Message-ID: <20070711162907.4016CBE1D@smtp-auth.no-ip.com> Robert, Yep, a reinstall of MSDN fixed the problem. Thanks for the heads up John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Wednesday, July 11, 2007 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Visual studio help John, The help files for Visual Studio are not installed automatically. You have to run the install on the MSDN disk(s) that came with it to get help of any kind. Robert At 10:51 AM 7/11/2007, you wrote: >Date: Wed, 11 Jul 2007 11:51:28 -0400 >From: "jwcolby" >Subject: Re: [dba-SQLServer] [dba-VB] Visual studio help >To: , > , "'Access Developers discussion and > problem solving'" >Message-ID: <20070711155131.9F8C9BE74 at smtp-auth.no-ip.com> >Content-Type: text/plain; charset="us-ascii" > >Yes, but if you hit F1 then it opens a help file of some sort. I can >say whether it is going to use the local help or the internet help first etc. >As for books online, well... I only know that term in terms of SQL Server. > >1) Go into code. >2) Select some something, keyword, whatever. >3) Hit F1. > >What do you see? > >I see a help window. On the top blue bar it says "Microsoft Visual >Studio >2005 Documentation". That is a good sign. > >However on the left hand side there is a Pane (or PAIN depending on >your point of view), which has a "filter by" combo. The ONLY CHOICES >(for me) >are: > >SQL Server 2005 >SQL Server Analysis Service >SQL Server... >SQL Server... >SQL Server... >Etc etc. > >I am locked in to filtering on SQL Server help. I DON'T WANT SQL >SERVER HELP, I WANT VB HELP. > >Actually I want to be able to select VB, C#, Java, SQL Server and >whatever else is appropriate in the context I am using. I am flying >Visual Studio blind, unless all I am interested in is SQL Server help >in which case I am ducky. > >John W. Colby _______________________________________________ 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 Wed Jul 11 22:03:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 11 Jul 2007 23:03:42 -0400 Subject: [dba-VB] Windows 2003 x64; SQL Server 2005 X64 Message-ID: <20070712030347.0B7E8BDA9@smtp-auth.no-ip.com> Is anyone out there running Windows 2003 X64? If so would you care to comment on what was involved in getting it to happen, drivers, getting the software etc. Same question for SQl Server 2005 X64. John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 17:27:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 18:27:59 -0400 Subject: [dba-VB] VB.Net - DoEvents Message-ID: <20070712222800.DE47FBD36@smtp-auth.no-ip.com> I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 22:25:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 12 Jul 2007 23:25:15 -0400 Subject: [dba-VB] Resource files Message-ID: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Jul 12 23:33:27 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 00:33:27 -0400 Subject: [dba-VB] Convert C to VB Message-ID: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com From newsgrps at dalyn.co.nz Thu Jul 12 23:41:35 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 13 Jul 2007 16:41:35 +1200 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> References: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <20070713043858.EMOF11149.fep01.xtra.co.nz@Dalyn.dalyn.co.nz> John, Try this site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx Regards David Emerson Dalyn Software Ltd Wellington, New Zealand At 13/07/2007, you wrote: >I need to convert a chunk of 'C#' code to Vb. The code apparently allows >you to get an expanded list of default values for the FolderBrowserDialog. > >It isn't much and I (believe I) have mostly figured it out. > >http://www.xoc.net/works/tips/folderbrowserdialog.asp > >So far I have: > >imports System; >imports System.Reflection; > >Public Class FolderBrowserDialogEx > '[Flags()] > Public Enum CsIdl > Desktop = &H0 ' Desktop > Internet = &H1 ' Internet Explorer (icon on desktop) > Programs = &H2 '// Start Menu\Programs > Controls = &H3 ' My Computer\Control Panel > Printers = &H4 ' My Computer\Printers > Personal = &H5 ' My Documents > Favorites = &H6 ' user name\Favorites > Startup = &H7 ' Start Menu\Programs\Startup > Recent = &H8 ' user name\Recent > SendTo = &H9 ' user name\SendTo > BitBucket = &HA ' desktop\Recycle Bin > StartMenu = &HB ' user name\Start Menu > MyDocuments = &HC ' logical "My Documents" desktop icon > MyMusic = &HD ' "My Music" folder > MyVideo = &HE ' "My Videos" folder > DesktopDirectory = &H10 ' user name\Desktop > Drives = &H11 ' My Computer > Network = &H12 ' Network Neighborhood (My Network Places) > Nethood = &H13 ' user name\nethood > Fonts = &H14 ' windows\fonts > Templates = &H0015, > CommonStartMenu = &H16 ' All Users\Start Menu > CommonPrograms = &H17 ' All Users\Start Menu\Programs > CommonStartup = &H18 ' All Users\Startup > CommonDesktopDirectory = &H19 ' All Users\Desktop > AppData = &H1A ' user name\Application Data > PrintHood = &H1B ' user name\PrintHood > LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non >roaming) > AltStartup = &H1D ' non localized startup > CommonAltStartup = &H1E ' non localized common startup > CommonFavorites = &H1F > InternetCache = &H20 > Cookies = &H21 > History = &H22 > CommonAppdata = &H23 ' All Users\Application Data > Windows = &H24 ' GetWindowsDirectory() > System = &H25 ' GetSystemDirectory() > ProgramFiles = &H26 ' C:\Program Files > MyPictures = &H27 ' C:\Program Files\My Pictures > Profile = &H28 ' USERPROFILE > SystemX86 = &H29 ' x86 system directory on RISC > ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC > ProgramFilesCommon = &H2B ' C:\Program Files\Common > ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC > CommonTemplates = &H2D ' All Users\Templates > CommonDocuments = &H2E ' All Users\Documents > CommonAdminTools = &H2F ' All Users\Start >Menu\Programs\Administrative Tools > AdminTools = &H30 ' user name\Start Menu\Programs\Administrative >Tools > Connections = &H31 ' Network and Dial-up Connections > CommonMusic = &H35 ' All Users\My Music > CommonPictures = &H36 ' All Users\My Pictures > CommonVideo = &H37 ' All Users\My Video > Resources = &H38 ' Resource Direcotry > ResourcesLocalized = &H39 ' Localized Resource Direcotry > CommonOemLinks = &H3A ' Links to All Users OEM specific apps > CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application >Data\Microsoft\CD Burning > ComputersNearMe = &H3D ' Computers Near Me (computered from >Workgroup membership) > FlagCreate = &H8000 ' combine with CSIDL_ value to force folder >creation in SHGetFolderPath() > FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an >unverified folder path > FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias >versions of the pidl > FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate >per-user init (eg. upgrade) > FlagMask = &HFF00 ' mask for all possible flag values > > End Enum > > Private Sub FolderBrowserDialogEx() > End Sub > > > Public Sub SetRootFolder(ByVal fbd As >System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) > Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType > dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance >| BindingFlags.NonPublic); > fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); > End Sub >End Class > >That last chunk - SetRootFolder - just isn't cooperating. Any help much >appreciated. > >TIA. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com From ebarro at verizon.net Thu Jul 12 23:42:55 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 12 Jul 2007 21:42:55 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <0JL300K6CP3M1117@vms048.mailsrvcs.net> Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM From accessd at shaw.ca Fri Jul 13 02:37:18 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 13 Jul 2007 00:37:18 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713043329.CCCDBBE6C@smtp-auth.no-ip.com> Message-ID: <0JL300J4CWYZUOF0@l-daemon> Hi John: Check the following site out. You can link to it from the DBA web site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:00:16 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:00:16 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <0JL300K6CP3M1117@vms048.mailsrvcs.net> Message-ID: <20070713120017.88743BEB8@smtp-auth.no-ip.com> Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:02:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:02:59 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <0JL300J4CWYZUOF0@l-daemon> Message-ID: <20070713120300.4631CBDD9@smtp-auth.no-ip.com> Like all things, these only get you so far. In this case it didn't get me anywhere but that is another story. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, July 13, 2007 3:37 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Hi John: Check the following site out. You can link to it from the DBA web site: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting 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 mikedorism at verizon.net Fri Jul 13 07:18:26 2007 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 13 Jul 2007 08:18:26 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713120017.88743BEB8@smtp-auth.no-ip.com> References: <0JL300K6CP3M1117@vms048.mailsrvcs.net> <20070713120017.88743BEB8@smtp-auth.no-ip.com> Message-ID: <000301c7c547$eaa5c1f0$2f01a8c0@Kermit> You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ 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 mikedorism at verizon.net Fri Jul 13 07:22:16 2007 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 13 Jul 2007 08:22:16 -0400 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> References: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: <000401c7c548$73d00bc0$2f01a8c0@Kermit> The "goodie images" that come with VS 2005 are the standard boring icons and bitmaps. I decided long ago to build my own "goodie image" archive. There are a lot of great online resources for icons. My favorites are (in no particular order): http://www.seoconsultants.com/windows/icons/microsoft/ http://www.coolarchive.com/icons.php http://www.iconbazaar.com/ http://www.iconarchive.com/ Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:36:39 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:36:39 -0400 Subject: [dba-VB] Resource files In-Reply-To: <000401c7c548$73d00bc0$2f01a8c0@Kermit> Message-ID: <20070713123641.1E1DBBCEC@smtp-auth.no-ip.com> Thanks for the links. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:22 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Resource files The "goodie images" that come with VS 2005 are the standard boring icons and bitmaps. I decided long ago to build my own "goodie image" archive. There are a lot of great online resources for icons. My favorites are (in no particular order): http://www.seoconsultants.com/windows/icons/microsoft/ http://www.coolarchive.com/icons.php http://www.iconbazaar.com/ http://www.iconarchive.com/ Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 11:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 07:37:54 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 08:37:54 -0400 Subject: [dba-VB] Convert C to VB In-Reply-To: <000301c7c547$eaa5c1f0$2f01a8c0@Kermit> Message-ID: <20070713123755.97D58BE5F@smtp-auth.no-ip.com> Yea, I was hoping that a member who uses C# might be able to translate this. I am such a nubee that I am clueless. I can translate syntax but not much more. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:18 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Fri Jul 13 07:48:22 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 13 Jul 2007 16:48:22 +0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070712222800.DE47FBD36@smtp-auth.no-ip.com> Message-ID: <000401c7c54c$19201db0$6401a8c0@nant> Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 08:10:46 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 09:10:46 -0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <000401c7c54c$19201db0$6401a8c0@nant> Message-ID: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com From ebarro at verizon.net Fri Jul 13 09:29:10 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 13 Jul 2007 07:29:10 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713120017.88743BEB8@smtp-auth.no-ip.com> Message-ID: <0JL4008KQG8EVZ2I@vms044.mailsrvcs.net> John, This compiled for me... Public Sub SetRootFolder(ByRef fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As Type = fbd.GetType() Dim fi As FieldInfo = t.GetField("rootFolder", BindingFlags.Instance Or BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub The error in your transposition had to do with defining t as System.Windows.Forms.FolderBrowserDialog that's why it was complaining when you set it to fbd.GetType() The variable t should have been defined as System.Type as in the original C# code... public static void SetRootFolder(System.Windows.Forms.FolderBrowserDialog fbd, CsIdl csidl) { Type t = fbd.GetType(); FieldInfo fi = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); } Eric -----Original Message----- From: jwcolby [mailto:jwcolby at colbyconsulting.com] Sent: Friday, July 13, 2007 5:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: RE: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007 9:57 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: 7/12/2007 4:08 PM From ebarro at verizon.net Fri Jul 13 09:32:57 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 13 Jul 2007 07:32:57 -0700 Subject: [dba-VB] Convert C to VB In-Reply-To: <20070713123755.97D58BE5F@smtp-auth.no-ip.com> Message-ID: <0JL40085FGEPVMNI@vms044.mailsrvcs.net> Unfortunately most C# programmers don't even want to acknowledge VB.NET as being equal in the programming world. Hence they don't even care to be "ambidexterous" when it comes to programming in .NET. VB.NET is much more forgiving and you can forego a lot of declarations that C# will balk at and ask you to implicitly define in your code before you can use it. I learned .NET using VB.NET and since then I have been using C#. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:38 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Yea, I was hoping that a member who uses C# might be able to translate this. I am such a nubee that I am clueless. I can translate syntax but not much more. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doris Manning Sent: Friday, July 13, 2007 8:18 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB You are right about the | character being an OR. A lot of times it boils down to looking up new things like "BindingFlags" in the Object Browser and seeing what class/collection they are members of. In all the code I've ever seen that uses "BindingFlags", it always has "System.Reflection." in front of it. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 8:00 AM To: ebarro at verizon.net; dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Nope, still doesn't work. VB complains about the | character. I assume that is an OR so I replaced it with the OR and then it complains about something else, specifically Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType Saying that fdb.gettype cannot be coerced into a folderbrowserdialog Which brings up a good point.. Why can't Visual Studio just pick the correct compiler for a class? IOW Visual Studio has all these compilers, why can't I just import an entire class written in C# and expect Visual Studio to use the C# compiler to compile and link that class as it would any other? Seems a natural to me! But alas... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, July 13, 2007 12:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Convert C to VB Try this.... Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic) fi.SetValue(fbd, csidl) End Sub -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 9:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Convert C to VB I need to convert a chunk of 'C#' code to Vb. The code apparently allows you to get an expanded list of default values for the FolderBrowserDialog. It isn't much and I (believe I) have mostly figured it out. http://www.xoc.net/works/tips/folderbrowserdialog.asp So far I have: imports System; imports System.Reflection; Public Class FolderBrowserDialogEx '[Flags()] Public Enum CsIdl Desktop = &H0 ' Desktop Internet = &H1 ' Internet Explorer (icon on desktop) Programs = &H2 '// Start Menu\Programs Controls = &H3 ' My Computer\Control Panel Printers = &H4 ' My Computer\Printers Personal = &H5 ' My Documents Favorites = &H6 ' user name\Favorites Startup = &H7 ' Start Menu\Programs\Startup Recent = &H8 ' user name\Recent SendTo = &H9 ' user name\SendTo BitBucket = &HA ' desktop\Recycle Bin StartMenu = &HB ' user name\Start Menu MyDocuments = &HC ' logical "My Documents" desktop icon MyMusic = &HD ' "My Music" folder MyVideo = &HE ' "My Videos" folder DesktopDirectory = &H10 ' user name\Desktop Drives = &H11 ' My Computer Network = &H12 ' Network Neighborhood (My Network Places) Nethood = &H13 ' user name\nethood Fonts = &H14 ' windows\fonts Templates = &H0015, CommonStartMenu = &H16 ' All Users\Start Menu CommonPrograms = &H17 ' All Users\Start Menu\Programs CommonStartup = &H18 ' All Users\Startup CommonDesktopDirectory = &H19 ' All Users\Desktop AppData = &H1A ' user name\Application Data PrintHood = &H1B ' user name\PrintHood LocalAppData = &H1C ' user name\Local Settings\Applicaiton Data (non roaming) AltStartup = &H1D ' non localized startup CommonAltStartup = &H1E ' non localized common startup CommonFavorites = &H1F InternetCache = &H20 Cookies = &H21 History = &H22 CommonAppdata = &H23 ' All Users\Application Data Windows = &H24 ' GetWindowsDirectory() System = &H25 ' GetSystemDirectory() ProgramFiles = &H26 ' C:\Program Files MyPictures = &H27 ' C:\Program Files\My Pictures Profile = &H28 ' USERPROFILE SystemX86 = &H29 ' x86 system directory on RISC ProgramFilesX86 = &H2A ' x86 C:\Program Files on RISC ProgramFilesCommon = &H2B ' C:\Program Files\Common ProgramFilesCommonx86 = &H2C ' x86 Program Files\Common on RISC CommonTemplates = &H2D ' All Users\Templates CommonDocuments = &H2E ' All Users\Documents CommonAdminTools = &H2F ' All Users\Start Menu\Programs\Administrative Tools AdminTools = &H30 ' user name\Start Menu\Programs\Administrative Tools Connections = &H31 ' Network and Dial-up Connections CommonMusic = &H35 ' All Users\My Music CommonPictures = &H36 ' All Users\My Pictures CommonVideo = &H37 ' All Users\My Video Resources = &H38 ' Resource Direcotry ResourcesLocalized = &H39 ' Localized Resource Direcotry CommonOemLinks = &H3A ' Links to All Users OEM specific apps CdBurnArea = &H3B ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning ComputersNearMe = &H3D ' Computers Near Me (computered from Workgroup membership) FlagCreate = &H8000 ' combine with CSIDL_ value to force folder creation in SHGetFolderPath() FlagDontVerify = &H4000 ' combine with CSIDL_ value to return an unverified folder path FlagNoAlias = &H1000 ' combine with CSIDL_ value to insure non-alias versions of the pidl FlagPerUserInit = &H800 ' combine with CSIDL_ value to indicate per-user init (eg. upgrade) FlagMask = &HFF00 ' mask for all possible flag values End Enum Private Sub FolderBrowserDialogEx() End Sub Public Sub SetRootFolder(ByVal fbd As System.Windows.Forms.FolderBrowserDialog, ByVal csidl As CsIdl) Dim t As System.Windows.Forms.FolderBrowserDialog = fbd.GetType dim fi as FieldInfo = t.GetField("rootFolder", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl); End Sub End Class That last chunk - SetRootFolder - just isn't cooperating. Any help much appreciated. TIA. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jul 13 09:56:01 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 13 Jul 2007 09:56:01 -0500 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: I've used Axialis Icon Editor a lot. Let's you pull icons out of .exes, .dll's, etc. Handy tool, and a shell32.dll has a ton of them. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 10:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From shamil at users.mns.ru Fri Jul 13 10:10:28 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 13 Jul 2007 19:10:28 +0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Message-ID: <000601c7c55f$f2cffb30$6401a8c0@nant> Hello John, I have no clear idea why you do not get your WinForms controls updated if you raise and process(sink) events to update these controls in the same thread. Do you have one main (UI/WinForms) thread calling your long running code bulk insert code or this bulk insert is executed in another worker thread? <<< I continue to be amazed at how quickly you can do things in .Net >>> Yes, I agree, .NET 2.0 with VS2005 is the "dream come true"... <<< After hundreds of hours of hacking away I have yet to bind an object to data >>> John, have a look here: http://brewder.blogspot.com/2007/03/data-binding-classes-interfaces-and.html <<< Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! >>> Yes! Waaaaaaaaaa! :) I'm also still far from getting very closely familiar with this .NET Framework "behemoth"... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Jul 13 10:38:21 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 13 Jul 2007 08:38:21 -0700 Subject: [dba-VB] Resource files In-Reply-To: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> References: <20070713032517.7BBCABE3A@smtp-auth.no-ip.com> Message-ID: We just use the WinXP images for stuff like that, John. The easiest way to handle images is with an ImageList control dropped on the form. Once you have pointed the control at an image file (or several if you like), you can copy that imageList control to other forms when you need it and just point to the image in the list. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 12, 2007 8:25 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Resource files I need a bitmap to put on a button. Specifically I need a folder icon. I know the property to use, and it opens a "resource locator" but I haven't a clue where such resource files might be. Does VS 2005 come with a resource file stuffed full of goodie images? Any tips on where to go get one? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Jul 13 10:47:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 13 Jul 2007 08:47:03 -0700 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> References: <000401c7c54c$19201db0$6401a8c0@nant> <20070713131047.8E0F8BEC6@smtp-auth.no-ip.com> Message-ID: Boy, do I hear that, John! Most of the books are not very helpful in learning .Net for exactly the reasons you give. It was a big help to me to have worked extensively with ADO and to have done a lot of unbound stuff, so I didn't have to rely on binding and object to a data source before starting to work with it. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 6:11 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-i n-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Jul 13 11:45:31 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 13 Jul 2007 12:45:31 -0400 Subject: [dba-VB] VB.Net - DoEvents In-Reply-To: <000601c7c55f$f2cffb30$6401a8c0@nant> Message-ID: <20070713164532.A0D62BD84@smtp-auth.no-ip.com> It is all one thread atm. However the event sinks function and code steps in there. I do DoEvents inside of those event sinks (on the main form) as soon as I update the form controls (in the event sinks). It works correctly when just running, but not when stepping through code. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 11:10 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I have no clear idea why you do not get your WinForms controls updated if you raise and process(sink) events to update these controls in the same thread. Do you have one main (UI/WinForms) thread calling your long running code bulk insert code or this bulk insert is executed in another worker thread? <<< I continue to be amazed at how quickly you can do things in .Net >>> Yes, I agree, .NET 2.0 with VS2005 is the "dream come true"... <<< After hundreds of hours of hacking away I have yet to bind an object to data >>> John, have a look here: http://brewder.blogspot.com/2007/03/data-binding-classes-interfaces-and.html <<< Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! >>> Yes! Waaaaaaaaaa! :) I'm also still far from getting very closely familiar with this .NET Framework "behemoth"... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 5:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Shamil, I am definitely looking at wrapping these processes in worker threads but I need to get the code working first. It turns out that if I run the code full speed, the objects on the form do update, it is just when I step through code that they do not. I really don't understand why not at this point. I am using events raised in my class to pass status info to event sinks on the form and it is all working, event sinking status events from the SQLBulkCopy class and bubbling them up to the form. I continue to be amazed at how quickly you can do things in .Net IF you already know .Net and how large the learning curve is. It is actually quite easy to do little things even with no knowledge, it is just that I do not think in "little things", I think in high level operations (top down kinda sorta) and I do not understand all of the syntax required to put the big pieces into place. I know VBA and DAO like the back of my hand. I am used to just "whacking out code" and that ain't happening in VB.Net, which is frustrating. One of my BIG BIG issues is my almost total lack of understanding of ADO, made worse by the fact that .NET ADO is even more different. Much of what I currently need .Net for is data manipulation, NOT human data entry / display. Reading / writing tables > files and vv. And of course most of the books concentrate on human data entry / display with very little time spent on how to do things directly in code. It all seems to be "drag this object out, set this property, bind it to this control", which is just useless to me right now. I need to create those objects in code, in the correct order, set the properties in code, use the results in code. After hundreds of hours of hacking away I have yet to bind an object to data, though I am finally beginning to need that for my own human interface to these projects. Once I get .NET ADO nailed I think things will start falling into place. In the meantime... Waaaaaaaaaa! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, July 13, 2007 8:48 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - DoEvents Hello John, I think this information could help you to solve your task: http://fernandof.wordpress.com/2007/04/04/implementing-multi-threading-in-wi nforms-using-the-backgroundworker-class/ http://www.knowdotnet.com/articles/backgroundworker.html -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 13, 2007 2:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - DoEvents I am running a process with a form which sinks events form a class and updates controls on the form in those events. I put DoEvents as the last line in the event sinks but the form is not refreshing, at least not while stepping through the code. Is there something else I need to do to cause the form to refresh? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 10:27:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 11:27:57 -0400 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com From chizotz at mchsi.com Wed Jul 18 11:53:45 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 18 Jul 2007 16:53:45 +0000 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> John, I know that there is a school of thought that this approach is inappropriate, but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER hive so each user has their own set of saved values, which is most often convenient for me. This example stores (in the form close event) the location, height, and width of the form, and (in the form open event) restores the form to that size and location. You should be able to easily adapt it for your needs. Ron (all syntax in C#, but should translate easily and well to VB) using Microsoft.Win32; //necessary include to get Registry classes In form close event: /* If form is maximized, minimized, or larger than the screen in either dimension, do not save size and position information */ if(this.WindowState != FormWindowState.Maximized && this.WindowState != FormWindowState.Minimized && this.Width <= Screen.PrimaryScreen.Bounds.Width && this.Height <= Screen.PrimaryScreen.Bounds.Height) { string regPath = @"Software\Tribune\Circ\CircTools\Settings"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey.GetValue("ResettingPositions").ToString() == "0") { regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey != null) { regKey.SetValue("X", Location.X); regKey.SetValue("Y", Location.Y); regKey.SetValue("H", this.Height); regKey.SetValue("W", this.Width); } } } In form open event: string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey == null) { regKey = Registry.CurrentUser.CreateSubKey(regPath); } if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) { Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); } if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) { this.Height = (int)regKey.GetValue("H"); this.Width = (int)regKey.GetValue("W"); } ---------------------- Original Message: --------------------- From: "jwcolby" To: Subject: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 15:31:33 +0000 > I need a way to store the values in controls as the form closes, such that > the form can the load those last values when it re-opens. I do things like > enter data in controls for server, database, table, paths to files etc. I > need the form to save those values so that the next time the form opens it > can retrieve those values and I don't have to key them in again every time. > > Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a > nubee) web sites? > > TIA, > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From chizotz at mchsi.com Wed Jul 18 11:59:00 2007 From: chizotz at mchsi.com (Ron Allen) Date: Wed, 18 Jul 2007 16:59:00 +0000 Subject: [dba-VB] VB.Net XML - store form defaults Message-ID: <071820071659.25521.469E46D3000E2673000063B1219791336303010CD2079C080C03BF969B019607080C@mchsi.com> Oops. Copy and paste error in the code I sent. The variable regPath should be the same in both the form open and form close events, and in the code I sent it wasn't. I copied the code out of a form where I do other things with the registry too, and copied the wrong line where the value of regPath is set for the form close event. Sorry. ---------------------- Original Message: --------------------- From: chizotz at mchsi.com (Ron Allen) To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 16:53:46 +0000 > John, > > I know that there is a school of thought that this approach is inappropriate, > but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER > hive so each user has their own set of saved values, which is most often > convenient for me. > > This example stores (in the form close event) the location, height, and width > of the form, and (in the form open event) restores the form to that size and > location. You should be able to easily adapt it for your needs. > > Ron > > > > (all syntax in C#, but should translate easily and well to VB) > > using Microsoft.Win32; //necessary include to get Registry classes > > In form close event: > > /* > If form is maximized, minimized, or larger than > the screen in either dimension, do not save size > and position information > */ > if(this.WindowState != FormWindowState.Maximized && > this.WindowState != FormWindowState.Minimized && > this.Width <= Screen.PrimaryScreen.Bounds.Width && > this.Height <= Screen.PrimaryScreen.Bounds.Height) > { > string regPath = @"Software\Tribune\Circ\CircTools\Settings"; > RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey.GetValue("ResettingPositions").ToString() == "0") > { > regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; > regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey != null) > { > regKey.SetValue("X", Location.X); > regKey.SetValue("Y", Location.Y); > regKey.SetValue("H", this.Height); > regKey.SetValue("W", this.Width); > } > } > } > > In form open event: > > string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; > RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); > if(regKey == null) > { > regKey = Registry.CurrentUser.CreateSubKey(regPath); > } > if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) > { > Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); > } > if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) > { > this.Height = (int)regKey.GetValue("H"); > this.Width = (int)regKey.GetValue("W"); > } From ebarro at verizon.net Wed Jul 18 12:06:11 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 18 Jul 2007 10:06:11 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> Message-ID: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM From cfoust at infostatsystems.com Wed Jul 18 12:05:08 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 18 Jul 2007 10:05:08 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> References: <071820071653.20917.469E4599000C7146000051B5219791336303010CD2079C080C03BF969B019607080C@mchsi.com> Message-ID: The problem with using the registry is that a lot of IT departments are locking it down and require you to use the Documents and Settings folder to store current user stuff. We use XML for this purpose. We'll have an XML file that contains a variable number of elements, which all have a ReadOnly attribute set to False as the default. We use a class to retrieve values from the file and to save values to it. Similar to what we used to do with registry settings. You could have a FormsDefaults.XML file that contains a template element with default settings in it for any form you have saved custom settings for, and then the class could create a new element for each form that had saved settings. Not hard and it doesn't require any api calls to read. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Ron Allen Sent: Wednesday, July 18, 2007 9:54 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults John, I know that there is a school of thought that this approach is inappropriate, but I use the registry for this sort of thing. I use the HKEY_CURRENT_USER hive so each user has their own set of saved values, which is most often convenient for me. This example stores (in the form close event) the location, height, and width of the form, and (in the form open event) restores the form to that size and location. You should be able to easily adapt it for your needs. Ron (all syntax in C#, but should translate easily and well to VB) using Microsoft.Win32; //necessary include to get Registry classes In form close event: /* If form is maximized, minimized, or larger than the screen in either dimension, do not save size and position information */ if(this.WindowState != FormWindowState.Maximized && this.WindowState != FormWindowState.Minimized && this.Width <= Screen.PrimaryScreen.Bounds.Width && this.Height <= Screen.PrimaryScreen.Bounds.Height) { string regPath = @"Software\Tribune\Circ\CircTools\Settings"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey.GetValue("ResettingPositions").ToString() == "0") { regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey != null) { regKey.SetValue("X", Location.X); regKey.SetValue("Y", Location.Y); regKey.SetValue("H", this.Height); regKey.SetValue("W", this.Width); } } } In form open event: string regPath = @"Software\Tribune\Circ\CircTools\Forms\Main\Position"; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(regPath, true); if(regKey == null) { regKey = Registry.CurrentUser.CreateSubKey(regPath); } if(regKey.GetValue("X") != null && regKey.GetValue("Y") != null) { Location = new Point((int)regKey.GetValue("X"), (int)regKey.GetValue("Y")); } if(regKey.GetValue("H") != null && regKey.GetValue("W") != null) { this.Height = (int)regKey.GetValue("H"); this.Width = (int)regKey.GetValue("W"); } ---------------------- Original Message: --------------------- From: "jwcolby" To: Subject: [dba-VB] VB.Net XML - store form defaults Date: Wed, 18 Jul 2007 15:31:33 +0000 > I need a way to store the values in controls as the form closes, such > that the form can the load those last values when it re-opens. I do > things like enter data in controls for server, database, table, paths > to files etc. I need the form to save those values so that the next > time the form opens it can retrieve those values and I don't have to key them in again every time. > > Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE > (to a > nubee) web sites? > > TIA, > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 12:24:04 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 13:24:04 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> Message-ID: <20070718172406.C2962BD32@smtp-auth.no-ip.com> This looks cool! Thanks, John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 18, 2007 1:06 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 12:36:42 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 13:36:42 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <0JLD006Q9WUGKIL4@vms048.mailsrvcs.net> Message-ID: <20070718173644.36F99BD1F@smtp-auth.no-ip.com> Except that is a c# solution. Sigh. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Wednesday, July 18, 2007 1:06 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults http://www.codeproject.com/useritems/EasySettings.asp -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 8:28 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Wed Jul 18 14:20:04 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 19 Jul 2007 07:20:04 +1200 Subject: [dba-VB] Object Reference not set to an Object error Message-ID: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> I use an add on from DataDynamics called ActiveReports which alows me to produce dot net reports in a similar interface to Access (sort of). I have a connection string defined in my Web.Config file. I want to set the connection string of the report to this when the report is run. I have the following code which is supposed to check whether the report has a connection string already. If the report doesn't have a connection string then I don't want to add a connection string (because there is no data for the report), otherwise I want to replace the connection string with the one in the Web.Config. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToString <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBConnection").ConnectionString End If The problem is with the first line. If there is a connection string then it is replaced. If the report doesn't have a connection string then an error is raised at the first line saying "Object reference not set to an instance of an object". My guess is that this is because no data source is set at all for the report there is no ConnectionString object to compare to. Can anyone please help with the syntax for checking whether the data source object exists (then if it does I can make the replacement to the connectionString). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From ebarro at verizon.net Wed Jul 18 14:41:12 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 18 Jul 2007 12:41:12 -0700 Subject: [dba-VB] Object Reference not set to an Object error In-Reply-To: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <0JLE00D9U40N69W0@vms046.mailsrvcs.net> Use Try...Catch Try ' Statement which can cause an exception. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS tring <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon nection").ConnectionString End If Catch x As Type ' Statements for handling the exception Finally End Try 'Any cleanup code -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Wednesday, July 18, 2007 12:20 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Object Reference not set to an Object error I use an add on from DataDynamics called ActiveReports which alows me to produce dot net reports in a similar interface to Access (sort of). I have a connection string defined in my Web.Config file. I want to set the connection string of the report to this when the report is run. I have the following code which is supposed to check whether the report has a connection string already. If the report doesn't have a connection string then I don't want to add a connection string (because there is no data for the report), otherwise I want to replace the connection string with the one in the Web.Config. If CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS tring <> "" Then CType(rpt.DataSource, DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon nection").ConnectionString End If The problem is with the first line. If there is a connection string then it is replaced. If the report doesn't have a connection string then an error is raised at the first line saying "Object reference not set to an instance of an object". My guess is that this is because no data source is set at all for the report there is no ConnectionString object to compare to. Can anyone please help with the syntax for checking whether the data source object exists (then if it does I can make the replacement to the connectionString). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 6:30 PM From newsgrps at dalyn.co.nz Wed Jul 18 17:15:04 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 19 Jul 2007 10:15:04 +1200 Subject: [dba-VB] Object Reference not set to an Object error In-Reply-To: <0JLE00D9U40N69W0@vms046.mailsrvcs.net> References: <20070718192405.BHCN23876.fep02.xtra.co.nz@Dalyn.dalyn.co.nz> <0JLE00D9U40N69W0@vms046.mailsrvcs.net> Message-ID: <20070718221539.HJMD16296.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks Eric, Another topic to digest. David At 19/07/2007, you wrote: >Use Try...Catch > >Try > ' Statement which can cause an exception. > If CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS >tring <> "" Then > CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString = >System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon >nection").ConnectionString > End If > >Catch x As Type > ' Statements for handling the exception >Finally > >End Try 'Any cleanup code > > > >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson >Sent: Wednesday, July 18, 2007 12:20 PM >To: dba-vb at databaseadvisors.com >Subject: [dba-VB] Object Reference not set to an Object error > >I use an add on from DataDynamics called ActiveReports which alows me to >produce dot net reports in a similar interface to Access (sort of). > >I have a connection string defined in my Web.Config file. I want to set the >connection string of the report to this when the report is run. I have the >following code which is supposed to check whether the report has a >connection string already. If the report doesn't have a connection string >then I don't want to add a connection string (because there is no data for >the report), otherwise I want to replace the connection string with the one >in the Web.Config. > >If CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString.ToS >tring ><> "" Then > CType(rpt.DataSource, >DataDynamics.ActiveReports.DataSources.SqlDBDataSource).ConnectionString >= >System.Web.Configuration.WebConfigurationManager.ConnectionStrings("IFADBCon >nection").ConnectionString >End If > >The problem is with the first line. If there is a connection string then it >is replaced. If the report doesn't have a connection string then an error >is raised at the first line saying "Object reference not set to an instance >of an object". My guess is that this is because no data source is set at >all for the report there is no ConnectionString object to compare to. > >Can anyone please help with the syntax for checking whether the data source >object exists (then if it does I can make the replacement to the >connectionString). > > >Regards > >David Emerson >Dalyn Software Ltd >Wellington, New Zealand >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > >No virus found in this incoming message. >Checked by AVG Free Edition. >Version: 7.5.476 / Virus Database: 269.10.8/906 - Release Date: 7/17/2007 >6:30 PM > > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com From shamil at users.mns.ru Wed Jul 18 20:34:44 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Thu, 19 Jul 2007 05:34:44 +0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070718152800.25AD6BC02@smtp-auth.no-ip.com> Message-ID: <000601c7c9a4$fc3d16f0$6401a8c0@nant> Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 7:28 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net XML - store form defaults I need a way to store the values in controls as the form closes, such that the form can the load those last values when it re-opens. I do things like enter data in controls for server, database, table, paths to files etc. I need the form to save those values so that the next time the form opens it can retrieve those values and I don't have to key them in again every time. Does anyone has any code for doing that, or hotlinks to UNDERSTANDABLE (to a nubee) web sites? TIA, John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Jul 18 20:57:38 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 18 Jul 2007 21:57:38 -0400 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <000601c7c9a4$fc3d16f0$6401a8c0@nant> Message-ID: <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> Shamil, Funny you should mention that. I was working on just such a class earlier this afternoon - from a book called Beginning Visual Basic .NET from Wrox. That book does not mention binding the form to the class though. It actually reads / writes the values out of the controls. I like the "binding" idea. Now all I have to do is figure out how to do that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, July 18, 2007 9:35 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil From jwcolby at colbyconsulting.com Thu Jul 19 09:59:47 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 10:59:47 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> I operate under Option Strict. I have a situation where I am trying to use code from a book. That code assigns an object type to a class, i.e. Dim lcls as clsSomething = SerializeData(... SerializeData returns an object. How do I cast Serialize data to return a type clsSomething so that I don't get the "option strict disallows..." error message? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Thu Jul 19 10:09:03 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 08:09:03 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> References: <20070719145948.7D2F5BEE5@smtp-auth.no-ip.com> Message-ID: That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:00 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion I operate under Option Strict. I have a situation where I am trying to use code from a book. That code assigns an object type to a class, i.e. Dim lcls as clsSomething = SerializeData(... SerializeData returns an object. How do I cast Serialize data to return a type clsSomething so that I don't get the "option strict disallows..." error message? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 10:27:01 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 08:27:01 -0700 Subject: [dba-VB] VB.Net XML - store form defaults In-Reply-To: <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> References: <000601c7c9a4$fc3d16f0$6401a8c0@nant> <20070719015740.7B6B6BC0A@smtp-auth.no-ip.com> Message-ID: The specific "how" is use the databindings properties of the form. Typed Datasets are the easiest to work with because even in design time, they know what the properties of their source is--fields, data types, etc. We normally create a class for each typed dataset, give it whatever business rules we want to enforce at the data level, and drag the class form the toolbox onto the form or user control. That creates the binding to the form and you can then control the binding to the controls in design view or through code. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, July 18, 2007 6:58 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Shamil, Funny you should mention that. I was working on just such a class earlier this afternoon - from a book called Beginning Visual Basic .NET from Wrox. That book does not mention binding the form to the class though. It actually reads / writes the values out of the controls. I like the "binding" idea. Now all I have to do is figure out how to do that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, July 18, 2007 9:35 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net XML - store form defaults Hello John, It's rather easy on .NET (there could be dozen ways to do that) - simplest IMO and the most appropriate for you because you are a bounder and you like custom classes :) : - create custom class preferably with public setters and getters for the properties values you use; - bind your form to this custom class; - run you application and edit bound to your custom class form fields' values; - use System.Xml.Serialization.XmlSerializer and TextWriter/StreamWriter and TextReader/StreamReader to save/restore (serialize to/desterilize from) defaults to/from text(xml) file... - next time you start your app your class static method will read serialized XML, will desterilize it into class instance and will bind your form to the properties of this class instance... That's it. Should be less than 10 lines of code to serialize/desterilize defaults to/from xml file... -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 10:48:41 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 11:48:41 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719154843.48102BF92@smtp-auth.no-ip.com> I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 11:13:19 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:13:19 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719154843.48102BF92@smtp-auth.no-ip.com> References: <20070719154843.48102BF92@smtp-auth.no-ip.com> Message-ID: John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 11:24:07 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 12:24:07 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 11:44:05 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 18:44:05 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 11:47:46 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:47:46 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> References: <20070719162412.62DF7BF97@smtp-auth.no-ip.com> Message-ID: We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 cfoust at infostatsystems.com Thu Jul 19 11:49:07 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 09:49:07 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 12:02:43 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 19:02:43 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte So true. Nothing beats experience. Seems like while some of us overwhelmed are fooling around, you just do it. /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:49 >>> Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust From cfoust at infostatsystems.com Thu Jul 19 12:06:16 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:06:16 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte So true. Nothing beats experience. Seems like while some of us overwhelmed are fooling around, you just do it. /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:49 >>> Hmmn. Was that a hint, hint, hint I just heard?? I'll have to build a sample when I have a spare moment. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 9:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte This sounds really clever! Would love to see an example ... /gustav >>> cfoust at infostatsystems.com 19-07-2007 18:13 >>> John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 12:18:38 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 19:18:38 +0200 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion Message-ID: Hi Charlotte You retire? Give me one good reason for that. /gustav >>> cfoust at infostatsystems.com 19-07-2007 19:06 >>> I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte From cfoust at infostatsystems.com Thu Jul 19 12:30:25 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:30:25 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: References: Message-ID: Hmmn. Death? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 10:19 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Hi Charlotte You retire? Give me one good reason for that. /gustav >>> cfoust at infostatsystems.com 19-07-2007 19:06 >>> I'm fortunate enough to be working in it converting old Access apps to VB.Net winforms apps. That gives me a way to parlay my Access experience into .Net skills and get paid while I do it. I'd never be able to pick up .Net on my own. I'd have to hide in bed with the blankets over my head and wait for retirement to find me! LOL Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 12:35:38 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 13:35:38 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: Message-ID: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Well, I'm (slowly) learning how to do it. Unfortunately because I work alone it is tough to get the "doing it right" part. If I do it wrong there is no one looking over my shoulder telling me to "do it this way". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 mmattys at rochester.rr.com Thu Jul 19 12:45:47 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Thu, 19 Jul 2007 13:45:47 -0400 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion References: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Message-ID: <010a01c7ca2c$a560e130$0202a8c0@Laptop> Ooh! Ooh Ooh! I'll do it! - Horshack from 'Welcome Back, Kotter" Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" To: Sent: Thursday, July 19, 2007 1:35 PM Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > Well, I'm (slowly) learning how to do it. Unfortunately because I work > alone it is tough to get the "doing it right" part. If I do it wrong > there > is no one looking over my shoulder telling me to "do it this way". > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 12:48 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > We're LEARNING how to do it right OJT! LOL Our senior developer was the > only one who had any previous experience with .Net and we've blown past > the > firm we hired to advise us at the start of the project. And yes, it's > been > a lot of fun being in it from the ground up. > > Charlotte > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, July 19, 2007 9:24 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > Boy I must say you lucked out getting that job. I would die for an > opportunity to learn VB.Net OJT AND though a company that apparently > really > knows how to do it right! > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 12:13 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > John, > > We use typed datasets to handle the serialization. Then we can work with > the typed dataset in design view as if it were a real table. We do NOT > hand > build that code! It was easy to generate typed datasets in > 2003 but I keep forgetting how in 2005. It is well worth exploring though > for the work it saves. > >>>I was just about to ask about binding this to a form when your next > email came in. The only question I have is, is it possible to bind to a > class where the open event of the form itself is going to load the data > into > the class? It seems kinda "cart before the horse". > > What you do is bind to the class, which has no data in it at that point. > You have a setup routine in the form that either accepts a dataset or > fills > the one it already has. That's the advantage to working with the indirect > links offered by typed datasets and wrapper classes. We create various > Get > and Fill methods (Get returns a filled instance of the class object, Fill > populates a passed in instance) to accept parameters and populate the > class > with the data requested. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, July 19, 2007 8:49 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > I used DirectCast. And it all works. AMAZING!!! > > Charlotte, you probably use this all of the time. The example code builds > a > "serializable class" with functions that do the serialization in / out to > a > data stream, and functions that get a stream from / to a file. Then you > build a properties class that inherits the serializable class, which class > then allows you to define your properties. Since the properties class > inherits the code to serialize itself, it can do so without further adoo. > > I then use that in my form to store the control data into a properties > class > instance and can now store that out to an xml file using the .net > serializable stuff embedded in the inherited "serializable class". > Likewise retrieve it later. > > I have to say that the dim statement to do the restore is a mess though! > > To save: > Dim lclsIOData As New clsIOData > PopulateIODataFromForm(lclsIOData) > Dim strFileName As String = lclsIOData.mDataFileName("FormData") > lclsIOData.mSave(strFileName) > > To restore: > Dim lclsIOData As clsIOData > lclsIOData = > DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), > GetType(clsIOData)), clsIOData) > mPopulateFormFromIOData(lclsIOData) > > It is really a reasonably small amount of code setting up the serializable > class, but once done, any data class can be serialized to xml. From what > I > can understand I could also serialize it to a table if I wanted to simply > by > having another function that opened a stream to / from a table instead of > a > file. I will leave that for another day. > > Cool stuff. > > I was just about to ask about binding this to a form when your next email > came in. The only question I have is, is it possible to bind to a class > where the open event of the form itself is going to load the data into the > class? It seems kinda "cart before the horse". > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, July 19, 2007 11:09 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion > > That's one problem I always have with the books too, they tend to use a > lot > of implicit conversion. Of course, you learn a lot from making the > examples > work with option strict on. There are various ways to do it, John. You > can > use a Ctype() function to convert the object to a clsSomething like this: > Ctype(SerializeData(....), clsSomething). You can also use a DirectCast > function. > > Charlotte Foust > > > _______________________________________________ > 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 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 12:49:44 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 10:49:44 -0700 Subject: [dba-VB] VB.Net - Option Strict disallows implicit conversion In-Reply-To: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> References: <20070719173540.A8FCABD66@smtp-auth.no-ip.com> Message-ID: Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 10:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, I'm (slowly) learning how to do it. Unfortunately because I work alone it is tough to get the "doing it right" part. If I do it wrong there is no one looking over my shoulder telling me to "do it this way". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion We're LEARNING how to do it right OJT! LOL Our senior developer was the only one who had any previous experience with .Net and we've blown past the firm we hired to advise us at the start of the project. And yes, it's been a lot of fun being in it from the ground up. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 9:24 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Boy I must say you lucked out getting that job. I would die for an opportunity to learn VB.Net OJT AND though a company that apparently really knows how to do it right! John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 12:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion John, We use typed datasets to handle the serialization. Then we can work with the typed dataset in design view as if it were a real table. We do NOT hand build that code! It was easy to generate typed datasets in 2003 but I keep forgetting how in 2005. It is well worth exploring though for the work it saves. >>I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". What you do is bind to the class, which has no data in it at that point. You have a setup routine in the form that either accepts a dataset or fills the one it already has. That's the advantage to working with the indirect links offered by typed datasets and wrapper classes. We create various Get and Fill methods (Get returns a filled instance of the class object, Fill populates a passed in instance) to accept parameters and populate the class with the data requested. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 8:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion I used DirectCast. And it all works. AMAZING!!! Charlotte, you probably use this all of the time. The example code builds a "serializable class" with functions that do the serialization in / out to a data stream, and functions that get a stream from / to a file. Then you build a properties class that inherits the serializable class, which class then allows you to define your properties. Since the properties class inherits the code to serialize itself, it can do so without further adoo. I then use that in my form to store the control data into a properties class instance and can now store that out to an xml file using the .net serializable stuff embedded in the inherited "serializable class". Likewise retrieve it later. I have to say that the dim statement to do the restore is a mess though! To save: Dim lclsIOData As New clsIOData PopulateIODataFromForm(lclsIOData) Dim strFileName As String = lclsIOData.mDataFileName("FormData") lclsIOData.mSave(strFileName) To restore: Dim lclsIOData As clsIOData lclsIOData = DirectCast(clsSerializableData.Load(clsIOData.mDataFileName("FormData"), GetType(clsIOData)), clsIOData) mPopulateFormFromIOData(lclsIOData) It is really a reasonably small amount of code setting up the serializable class, but once done, any data class can be serialized to xml. From what I can understand I could also serialize it to a table if I wanted to simply by having another function that opened a stream to / from a table instead of a file. I will leave that for another day. Cool stuff. I was just about to ask about binding this to a form when your next email came in. The only question I have is, is it possible to bind to a class where the open event of the form itself is going to load the data into the class? It seems kinda "cart before the horse". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 11:09 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion That's one problem I always have with the books too, they tend to use a lot of implicit conversion. Of course, you learn a lot from making the examples work with option strict on. There are various ways to do it, John. You can use a Ctype() function to convert the object to a clsSomething like this: Ctype(SerializeData(....), clsSomething). You can also use a DirectCast function. Charlotte Foust _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 13:42:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 14:42:05 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte From cfoust at infostatsystems.com Thu Jul 19 14:01:11 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:01:11 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> References: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> Message-ID: >>It has to be easy. ROTFL There's your problem, right there!! Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 14:07:26 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:07:26 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> References: <20070719184207.1E768BDF7@smtp-auth.no-ip.com> Message-ID: Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jul 19 14:10:04 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 19 Jul 2007 21:10:04 +0200 Subject: [dba-VB] How I'm approaching the problem Message-ID: Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. From jwcolby at colbyconsulting.com Thu Jul 19 14:31:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:31:56 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719193157.E3430BD48@smtp-auth.no-ip.com> I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 14:33:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:33:25 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719193327.7EDFBBD43@smtp-auth.no-ip.com> I have found code to do that. How it works I haven't a clue but once I get it working I will show what it is. In my case it has to be local. Servers out on the internet are not usable in my business. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 3:10 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jul 19 14:36:34 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 12:36:34 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719193157.E3430BD48@smtp-auth.no-ip.com> References: <20070719193157.E3430BD48@smtp-auth.no-ip.com> Message-ID: Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 ebarro at verizon.net Thu Jul 19 14:49:04 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 19 Jul 2007 12:49:04 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719193327.7EDFBBD43@smtp-auth.no-ip.com> Message-ID: <0JLF00LV0Z1B32Y4@vms042.mailsrvcs.net> I have code that can query a database for its tables and the fields in those tables (SQL server-specific). -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:33 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I have found code to do that. How it works I haven't a clue but once I get it working I will show what it is. In my case it has to be local. Servers out on the internet are not usable in my business. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, July 19, 2007 3:10 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John How would you build a list of available server instances? These could in theory be spread all over the Internet not only at the default port 1433. If you could limit the address range and assume port 1433, you would still need a port scanner routine to look up all on-line instances. /gustav >>> jwcolby at colbyconsulting.com 19-07-2007 20:42 >>> I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. _______________________________________________ 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.9/907 - Release Date: 7/18/2007 3:30 PM From jwcolby at colbyconsulting.com Thu Jul 19 14:56:01 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 15:56:01 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719195607.4216ABC02@smtp-auth.no-ip.com> >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 cfoust at infostatsystems.com Thu Jul 19 15:04:14 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 19 Jul 2007 13:04:14 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719195607.4216ABC02@smtp-auth.no-ip.com> References: <20070719195607.4216ABC02@smtp-auth.no-ip.com> Message-ID: I see. You had mentioned that before but I forgot (blame my age LOL). I know about that kind of list from bitter experience, although the biggest ones I ever had to import were less than 100K names per list. But I also didn't have the benefits of .Net and had to work strictly in Access 97, which didn't make it fun. I still don't see the need to import the data into a database immediately when you could manipulate them in xml form until you got them the way you wanted and THEN import the data once and for all. You could park the rejects in another database for reference. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Jul 19 16:02:26 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 19 Jul 2007 17:02:26 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: Message-ID: <20070719210229.D676BBE9C@smtp-auth.no-ip.com> My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 4:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I see. You had mentioned that before but I forgot (blame my age LOL). I know about that kind of list from bitter experience, although the biggest ones I ever had to import were less than 100K names per list. But I also didn't have the benefits of .Net and had to work strictly in Access 97, which didn't make it fun. I still don't see the need to import the data into a database immediately when you could manipulate them in xml form until you got them the way you wanted and THEN import the data once and for all. You could park the rejects in another database for reference. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem >Why import them and then export them back out right away? Because these lists can come from anywhere. I don't know until they are in the database what the field names even are. ATM I am building a table that maps "their" field name to my field name, then using that table to do the export back out to CSV for address processing. Furthermore these lists ALWAYS have name / address fields PLUS 10 to 600 OTHER fields which are demographics. Stuff like age / income, race, age, number of children, preferences in products etc. These are marketing lists, collected from all over the universe. Thus the data has to be imported into a raw data table because I use that demographics information for where clauses in selection queries. The name / address has to go back out for address processing because who knows if the addresses were EVER valid? We get mis-spellings, but we also get intentional bad data - John Colby at 1234 None of your business lane. Obviously we don't want to spend money sending mail to "none of your business Lane". Remember, these lists come from all over the (United States) universe. We have no clue as to the validity of the address. If the address is bad (non-deliverable) then the entire data record is tossed. Once I export and do address validation, then we know that we can at least deliver mail to the address. We still don't know that the person really lives there, or even that the name is valid. It might be "Micky Mouse" at 1723 Twin Pines Drive. Or the person might have lived there 10 years ago when they took a survey about smoking (for example) but moved 3 months later... My job is to attempt to filter the trash as best I can, and address validation is the one major filter point that really works, but it only works on the address itself. OTOH, some of the lists I get are "pre-validated" in some fashion. For example I just got a list of 100 million deeds. The data is "guaranteed to be correct" although even then the guarantee is not absolute. But it is far better than "micky mouse at 1234 none of your business way". Have you ever joined a web site where they INSISTED on getting your full name, address, phone, email, etc. and wouldn't save the form unless you filled in each and every field? And have you ever said to yourself - "I want to join this place but I do not want them having all of that". I have, and guess what I use? Micky mouse at 1234 None of your business way... So when they sell that name to the wrong person I don't get mail from them. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Why import them and then export them back out right away? You could build the hash in a calculated column of a dataset before you import it in the first place, I think. Read it into a typeddataset and add a calculated column for the hash. The import the enhanced typeddataset into your table, which includes a column for the hash code. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 12:32 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem I will be doing a lot of processing. There are several scenarios as to the "source". It all starts with raw data files brought in from DVDs containing text files. Once imported to a database they are immediately exported back out for address processing. Once processed they are immediately reimported, in my current method I import into a separate database. I also build a hash of the address, family and person which goes into 3 fields in the address database / table. Sometime in the future, those hashes will be compared across the databases to see where the various objects match, a person in this table is the same as a person in that table. An address in this table is the same as an address in that table. That will allow me to build a normalized system where I can "see" data about the same person, family or address across lists. Additionally, the address lists will be exported back out for address processing periodically (monthly?) to find moves. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 3:07 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Are you doing any processing on the data, besides importing it into a table? Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 11:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] How I'm approaching the problem The problem with that is it takes a LOT of explaining to even get started. I am trying to develop a system where I can select a SQL Server instance on the network. Once I select a server, I need to select a database if one exists, or build one if it does not exist. Once I select (or build) a database I need to select a table if one exists or build one if it does not exist. Imagine the following scenario: I have a directory of CSV files that I need to import into SQL Server. I need to specify the server instance, the database, and a table into which I want to import the data. The server instance has to already exist obviously. However the database may or may not already exist. I need to select the server instance and create the db if none already else select the db. Either way I have then selected a db and then need to see if a table exists, if not create it. In the end select it. So... I have a form. On the form I have: 1) A control to specify the path to the database files. 2) A control to select a server instance. 3) A control to select a database. 4) A control to select a table. 5) A control to specify a path to the DATA files to be imported. #2 above needs code (and a combo as the control) to select the server. #3 above needs code and a combo as the control to select a database within that server #4 above needs code and a combo to select a table within that database 1 and 5 already have controls and code to select a directory. The entire form needs (already has as of today) code to store the current settings as the form closes and read back out when the form opens. A byproduct of the way I work (I need to get real work done) is that I often build systems like this bottom up instead of top down, though I think top down. Thus I build code that does the bottom piece, passing in hard coded values for server / database / table and then come back and either EDIT those values for the next set of data or BUILD the pieces to select those data dynamically (where I am now). So I have a program already in place that imports an entire directory of CSV files into a server / database / table. The server / database / table pieces are passed in but hard coded in the form classes header. I am now trying to create the user interface to allow me to use controls to browse the server / database / tables. This seems like something that .NET would just have as a class. Dim a clsDBBrowser tree control and click on the node, and back comes the values in a form that could be used in an ADO connect string. Given that I do not see that this is true, I am building my own (not a tree control atm, but separate combos). A tree that looks identical to what already exists in SQL Server (except with a server node) would be so much cleaner. So there you have it, what I am trying to accomplish and how I am going about it. I have found code to obtain a server list and am working on getting it functioning. Why does it NEVER "just work"? Once that is working I have seen hints of code that obtains a list of databases in a server, tables in a database etc. I am working my way down the food chain as we speak. In each case except the server I need to be able to "type in" a value if I don't see what I need. The database will just be created (I have code to do that) but the table has to be created based on the first row of a CSV file (I have code written to do that as well). Bits and pieces written, filling in the rest. LOTS of work. However once I get this finished, I will have a system where I can "find / describe" a server / database / table structure, specify where the files come from and sit back as the files import. I do this import on a weekly basis, often more often than that. It has to be easy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, July 19, 2007 1:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Option Strict disallows implicit conversion Well, if you were REALLY lucky, you'd have someone saying "that works, but I think I'd do it this way". There isn't a single right way, there are just more suitable ways for the present problem. That's what can get really maddening. Of course you do have this list to play in, and it might help others to see how you're approaching a problem too. Charlotte _______________________________________________ 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 _______________________________________________ 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 Jul 21 21:14:25 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 21 Jul 2007 19:14:25 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070719210229.D676BBE9C@smtp-auth.no-ip.com> Message-ID: <0JLK002Q05ZSBFE4@l-daemon> Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. From jwcolby at colbyconsulting.com Sat Jul 21 23:51:17 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 00:51:17 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLK002Q05ZSBFE4@l-daemon> Message-ID: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. From pcs at azizaz.com Sun Jul 22 02:24:37 2007 From: pcs at azizaz.com (Borge Hansen) Date: Sun, 22 Jul 2007 17:24:37 +1000 Subject: [dba-VB] Address Processing References: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> Message-ID: <036401c7cc31$5cbad380$fa10a8c0@Albatross> Hi John, I've been following your threads on the subject of your SQL Server system on and off, the latest being: Subject: Re: [dba-VB] How I'm approaching the problem Where you wrote: "...The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity...." I am curious as to what your address processing entails...if you have been writing on this previously I missed it... Does the address processing entail returning geocode on the address? I am currently using Google's MAP API to process addresses and having them returned with a geocode including degree of accurary (street, suburb or zip).... I am using some javascript picked up somewhere on the internet.... The javascript uses a webpage textcontrol as the input for address processing (I copy and paste about 1,000 address records from an access table into the textcontrol), and outputs the data records returned from Google as tab delimited lines of text to another text control on the same webpage. So I can process about a 1,000 addresses at a time... but at present I have to manually copy and paste the processed addresses from the text control into a say Access table.... What I am after is code that allows me to use a table (Access or SQL) as input and another table for inserting the processed addresses.... Is this something you are doing? Anyone else who can help out here? Regards, Borge Hansen From jwcolby at colbyconsulting.com Sun Jul 22 11:07:17 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 12:07:17 -0400 Subject: [dba-VB] Address Processing In-Reply-To: <036401c7cc31$5cbad380$fa10a8c0@Albatross> Message-ID: <20070722160723.D36EFBD05@smtp-auth.no-ip.com> This business is about bulk mail addresses. My client buys lists of addresses from other list providers. Each list is basically a "poll" that someone answered or something similar. A million people filled out warranty cards when they bought a car, or filled out an online form when they visited a web site, or... Somehow they got their name on a list, but more importantly they gave other important information about themselves such as brands of tobacco used, soft drinks consumed, electronics purchased etc. It is really THAT information that is important about the person, because my client sells these names to advertisers targeting people who have dogs or cats (a dog / cat food mailing) or bought a certain brand of car 4 years ago (a dealership mailing). So... I get lists of names / addresses, with "demographics" information included. I pull the lists in to SQL Server. Why? Because my client then comes back to me and says "give me 100K names in these zips who purchased laundry detergent". So I have to have the info in SQL Server in order to do the where clauses on zips and demographics fields. As soon as I import the table, I immediately export the data back out for "address cleaning". These lists average about 20% "trash", addresses where the address was misspelled, no zip was given, or a completely fake address was supplied etc. So I export my own PKID, the name and address out to CSV files, up to 1 million records at a time. I send those addresses through a program that verifies the addresses. The first process is called CASS, which simply verifies that the address "matches" an address template. A second process (run at the same time, subsequent to CASS is called DPV which stands for delivery point validation. IOW, yea, it matches a template, but can it actually be delivered. The USPS provides databases of every valid address in the United States, and the addresses are run through this database to see if it is a "real address" (DPV) as opposed just "looks like a real address" (CASS). And finally, the address is then processed for NCOA or National Change of Address. That is a database (USPS) that says "yea, that person USED TO LIVE THERE but moved". So it is obvious why I do the processing. However I also need to re-process the data periodically in order to catch the moves. If John Colby moves from Connecticut to North Carolina, I want to discover that and stop sending mail to him in Connecticut and start sending it to him in NC. So every so often (monthly?) I will export the name / address back out and run it through the process again. CASS and DPV (theoretically) will get a 100% hit rate now because I already did that last time, but NCOA will catch a certain % of the people who moved. I use a dedicated program for doing this. There are too many variables for me to even consider "reinventing the wheel". These professional programs perform such functions as splitting names and addresses, standardizing abbreviations such as ST or ST. for Street etc. Those standardizing processes are required to get a hit on an address in the USPS database. If you are doing a few hundred names for your church or for some charity organization, you can visually scan the "fallout" data to see if you can pick up errors, but when processing 90 million names I never even look at the data, I just can't do that. So this professionally designed program handles a bunch of stuff in order to prepare the data for validation, performs the validation, and hands me back my PKID, name and address fields, plus about 40 other fields that tell me things about the data itself (political district, area code, etc) as well as data about why the data failed to validate in case I want to do processing on the rejects (I don't). In any event, this is not just a one shot deal. I pull the RAW data in, add a PK, Export the name / address, process that, import the resulting cleaned address data back into a DIFFERENT table, but related to the RAW data by my PK that I assigned to the raw data. Periodically I re-export / import for NCOA processing. Now when the client asks for 1 million names of people who own dogs I go to the table they tell me to, join the raw data to the address data, apply where clauses (zip to the cleaned address, demographics to the raw data), and pull the names and addresses out and export them for shipping to the purchaser of the names. We can tell the client that the data was last cleaned "X weeks ago" so that they know they are not spending money to send mail to bad addresses. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Sunday, July 22, 2007 3:25 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Address Processing Hi John, I've been following your threads on the subject of your SQL Server system on and off, the latest being: Subject: Re: [dba-VB] How I'm approaching the problem Where you wrote: "...The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity...." I am curious as to what your address processing entails...if you have been writing on this previously I missed it... Does the address processing entail returning geocode on the address? I am currently using Google's MAP API to process addresses and having them returned with a geocode including degree of accurary (street, suburb or zip).... I am using some javascript picked up somewhere on the internet.... The javascript uses a webpage textcontrol as the input for address processing (I copy and paste about 1,000 address records from an access table into the textcontrol), and outputs the data records returned from Google as tab delimited lines of text to another text control on the same webpage. So I can process about a 1,000 addresses at a time... but at present I have to manually copy and paste the processed addresses from the text control into a say Access table.... What I am after is code that allows me to use a table (Access or SQL) as input and another table for inserting the processed addresses.... Is this something you are doing? Anyone else who can help out here? Regards, Borge Hansen _______________________________________________ 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 Sun Jul 22 17:41:33 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 22 Jul 2007 15:41:33 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070722045123.9F473BCA7@smtp-auth.no-ip.com> Message-ID: <0JLL0046YQSWLTW1@l-daemon> Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Jul 22 20:53:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 22 Jul 2007 21:53:57 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLL0046YQSWLTW1@l-daemon> Message-ID: <20070723015404.F2E3ABCDF@smtp-auth.no-ip.com> ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 6:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try | to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ 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 Sun Jul 22 22:01:21 2007 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 22 Jul 2007 20:01:21 -0700 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723015404.F2E3ABCDF@smtp-auth.no-ip.com> Message-ID: <0JLM00G2W2TVP6K5@l-daemon> Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 22, 2007 6:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 6:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Just a note; I have been working on bank hardware and software installation for about two years and have worked with and in conversation with many of the senior software techs, when updating their systems. And yes they do use XML almost exclusively for transferring data from Cashers stations, desktops and bank machines to their centralized storage and banking systems. It is so that regardless of what type of OS or hardware being used information can be transferred seamlessly back and forth. The transport and/or VPN are all heavy encrypted as you would expect. I am sorry you felt insulted by the comments but it was totally meant in a fun way and not in any way designed as a disparaging remark. At worse it was supposed to bring a smile... but I was hoping you would get a laugh out of it. I must definitely be more careful in the future when a comment could potentially be taken in more than one way. I think in your case it would not be of any advance to use XML for data manipulation as it would just add an extra layer of complexity and for what reason. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 21, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem LOL. I have been doing this stuff in SQL Server and VB.Net for about a year now and so far have not even used a form except to have a button to push. So much for bound. Bound is only applicable when the data is being entered / displayed. Mine is not. When you deal with 90 million records you don't "view it" (though I can if I want to, it is in SQL Server). >As for the quantity of record handling capabilities of XML, Banks use XML... XML is designed for pushing data around between systems. I would be very surprised if banks did much if any data storage or manipulation in XML. Banks have many different systems, none of which talk to each other. XML is a widely recognized standard, designed for pushing data around between systems that otherwise don't talk well, and is a natural fit (for that). Banks also have entire departments with monthly budgets for servers, people and entire buildings to house said departments which could buy my entire house (in CASH) every week. I am one person, with one client using this stuff. I run all my stuff on dual core desktop machines. If you think this is not an issue let me put it this way. AN ACTUAL DATA FILE FROM A CUSTOMER: ACTUAL FIELD NAMES - Data size (characters) FIPS CODE - 5 FIPS SUB CODE 3 MUNICIPALITY CODE 3 APN UNFORMATTED 13 APN FORMATTED 13 MORTGAGE INTEREST RATE TYPE CODE 3 There are NINETY columns with names like this. Now, you can see that the data is MINISCULE compared to the size of the field names. NOW, turn that into XML. Now store NINETY MILLION RECORDS LIKE THAT. Now MANIPULATE NINETY MILLION XML RECORDS like that in a desktop machine with 4 gig of ram. >As for the quantity of record handling capabilities of XML, Banks use XML... That is an incredibly ignorant statement. enough said. I actually use XML as we speak, to store process log data out to files on my machine. It is quick, easy and standard. But it is tiny amounts of data, perhaps a Kbyte per file processed. John <> XML Not true. I just choose not to take 70 gigabytes of raw data in a nice neat | delimited CSV file and turn it into 700 gigabytes of XML and then try | to process that in 2 gigabytes of process memory on a desktop machine. THAT sounds like a recipe for tying up my server for the next... Oh... Two weeks. It takes me roughly 90 seconds per file to import each CSV file into a SQL Server database. I have to get it in to SQL Server, that is what my client hires me to do. The fact that I export the name / address back out for address processing immediately is irrelevant, I will do so every month for the rest of eternity. Why on god's green earth would I screw around turning this into a MONSTER XML file (or files) just so I could preprocess a handful of fields? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Saturday, July 21, 2007 10:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: Given: XML = unbound John = Bound Therefore: John <> XML As for the quantity of record handling capabilities of XML, Banks use XML... enough said. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, July 19, 2007 2:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem My view of XML is that it just isn't viable for large data sets. These data sets contain 5 to 100 MILLION records, with 10 to 700 fields. Now think about XML where each field is wrapped with begin / end field name tags. Any given data table starts out at 300 megs of DATA. Now wrap that in 2 Gigs of XML trash... Now multiply by 100 files... I actually do end up parking the rejects, the client wants them for some reason. Eventually I will quietly delete them (they have never asked for me to use them in any way). In the end though the name / address stuff has to be processed separately. I cannot simply merge it back in because (remember the 600 other fields) it turns the inevitable table scan into a 24 hour experience. Also the original address may be valid and they just moved. Stuff like that. This is a HUGE process, although each individual piece is not so big. It is the sheer size of the data that makes it hard to manage. It turns out that the import into SQL server is time consuming but not tough once I bought a library to do that. At least the ones I have done so far are now easy. The lib pulls the data into arrays and processes chunks. I haven't seen the code but I suspect that it does X records at a time. The resulting tables are large. My biggest is 65 million records, 740 fields. My next biggest is 98 million records, 149 fields. In the end, the name / address table is the same size regardless of which raw table the data came from. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 23 07:22:28 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 08:22:28 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLM00G2W2TVP6K5@l-daemon> Message-ID: <20070723122237.42363BE4A@smtp-auth.no-ip.com> Jim, Throw in the fact that I have to get real work done (process data for the client) and it really gets fun. That is why I have been working from the bottom up, getting those pieces written that allow me to actually process the lists, even if I have to manually run them from the click of a button, with hard coded constants for the parameters. It is good that I finally have a real paying project that requires SQL Server and VB.Net. Yea, having to learn them under the gun is stressful, but I have not succeeded in learning them in the past because I just didn't NEED them and I had too much other stuff to do to spend the hundreds of hours required to figure them out. Now I NEED them. I'll tell you, I really love VB.NET. As a dev language / environment it has everything that I want. That was not true before 2.0, but with the latest version it is complete enough to really do what I need. Yes, it is 10 times more complex than anything I have previously encountered, but a lot of the reason is that it provides so much more "out of the box". I am a class kind of guy and a programmer at heart, and this is very much my dream environment. It is just a matter of learning it well. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, July 22, 2007 11:01 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, July 22, 2007 6:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem ;-) Sorry if I snapped buddy. This whole system is just a tad overwhelming. There are soooo many pieces and steps and things to do. I am writing a system in VB.Net to automate the process, where on a form I can specify the server, name of a new database and table, and a directory where the files are stored and the software will do the import from all these files into SQL Server. I am building another piece that exports a table (or fields in a table) out to a set of files in a directory, kind of the inverse of the first piece. By running those two pieces in order, I can import, export, address validate, re-import all in one operation. The I can also schedule the export / address validate / import on a periodic basis, with luck completely automated. All of this has to have process logging so that if anything fails I can go see what failed, and where in the process. It also has to do logging to my billing database so that all this stuff gets billed to my client automatically, whenever any piece of the process runs. I am perhaps overly sensitive for a variety of reasons starting with the fact that I have gotten a lot of flack on the SQL Server list about not understanding enough SQL Server to do this stuff (true, but when has that ever stopped me), how the wizards are toys meant for beginners and my needs far exceed their capabilities (also true) etc. I am struggling with learning two entire new systems - SQL Server and VB.Net / ADO.Net AND doing it on hardware / software that truly is inadequate (or barely adequate) for the task. These databases are HUGE by any datasets I have ever encountered in the past. I am accustomed to doing systems with hundreds of tables but under a million records in the largest table. Here it is a handful of tables but tens of millions of records in each one. Desktop machines with 32 bit OS / Sql Server just don't cut it. On the bright side the quad core machines are out and a price war is on. The price of memory is dropping like a rock, and I can now build a dual processor 8 core system with 32 and up to 64 gb of ram for a "reasonable" price. It appears that I will be doing so before the end of the year. I found 64 bit SQL Server at a price I could afford and now if I can get a copy of Windows 2003 x64 at a price I can afford (and get it to install and run - drivers are still an issue) I should finally have a SQL Server system that will have the oomph to handle my data. I am a one man show, trying to do a pretty huge job (in my universe anyway) and I am a little stressed. But things are finally coming together. John W. Colby Colby Consulting From shamil at users.mns.ru Mon Jul 23 12:24:41 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Mon, 23 Jul 2007 21:24:41 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <0JLM00G2W2TVP6K5@l-daemon> Message-ID: <000001c7cd4e$5ab9fcf0$6401a8c0@nant> All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> From jwcolby at colbyconsulting.com Mon Jul 23 12:37:33 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 13:37:33 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000001c7cd4e$5ab9fcf0$6401a8c0@nant> Message-ID: <20070723173742.D9657C1B3@smtp-auth.no-ip.com> Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Mon Jul 23 14:57:01 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Mon, 23 Jul 2007 23:57:01 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723173742.D9657C1B3@smtp-auth.no-ip.com> Message-ID: <001101c7cd63$a3ae3d30$6401a8c0@nant> <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 23 15:17:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 23 Jul 2007 16:17:15 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070723201724.4F8A7BEC5@smtp-auth.no-ip.com> Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Tue Jul 24 02:12:21 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 11:12:21 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070723201724.4F8A7BEC5@smtp-auth.no-ip.com> Message-ID: <000a01c7cdc1$fb01f460$6401a8c0@nant> Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 08:52:59 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 09:52:59 -0400 Subject: [dba-VB] VB.Net Message-ID: <20070724135310.20ABDBC8E@smtp-auth.no-ip.com> I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com From James at fcidms.com Tue Jul 24 09:05:45 2007 From: James at fcidms.com (James Barash) Date: Tue, 24 Jul 2007 10:05:45 -0400 Subject: [dba-VB] VB.Net In-Reply-To: <20070724135310.20ABDBC8E@smtp-auth.no-ip.com> Message-ID: <005f01c7cdfb$baf45a90$800101df@fci.local> John: You want: DateTime.Now.ToString("yyyyMMdd-hhmmss") James Barash -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 9:53 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 09:26:20 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 10:26:20 -0400 Subject: [dba-VB] VB.Net In-Reply-To: <005f01c7cdfb$baf45a90$800101df@fci.local> Message-ID: <20070724142630.E5045BC93@smtp-auth.no-ip.com> Thanks James. It turns out that I was mixing up the CASE of the characters and ending up with totally weird formatted strings as you might imagine. Once I found the help for the format for dates and used the correct characters, in the correct case (upper / lower) then it started working just fine. Thanks again for the response. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of James Barash Sent: Tuesday, July 24, 2007 10:06 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net John: You want: DateTime.Now.ToString("yyyyMMdd-hhmmss") James Barash -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 9:53 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net I need to format a date as "YYYYMMYY-HHMMSS" and turn into a string to include at the end of a filename. There does not seem to be a format property for the DateTime.Now itself. In VBA I would use format("FmtString",now()) but that doesn't work (no format keyword apparently). There is a format method of the string object but it still requires an object to format which seems counter intuitive, it should just format the string object that it is a method of. So how do I accomplish what I am trying to do here? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 10:02:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 11:02:25 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000a01c7cdc1$fb01f460$6401a8c0@nant> Message-ID: <20070724150235.C5CE4BD9E@smtp-auth.no-ip.com> Shamil, >Would that have any (economical) sense for your customer to improve DB bulk loading time? I don't understand the context - would what have any economical sense? >Why you do not use 64 bit .Net Framework to run your code on the server side? My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. First, I am a one man show with a month by month budget. Second, In order to get maximum bang for my hard earned dollar I build my own systems. I was talking to the owner of the company that does my address validation and they just spend $25,000 for a DELL server with 32 megs of data and windows 2003 x64. I don't have that kind of money. When you buy a DELL (as an example) then getting Windows x64 to install is a simple click of the button on the order page. Getting windows x64 to install on a desktop is not so simple, with issues for ALL of the drivers from video, network, disk etc. When I built the workstations I use to run SQL Server I did not understand the size of the task; Now I do. I will be building a new server this fall with a server motherboard, designed and certified to run the X64 versions of windows, with drivers supplied etc. It will be a dual processor / 8 core machine which will contain 32 megs or ram to start, 64 megs eventually. I MAY be able to get Windows 2003 x64 to run on the current servers, and if I can then I will but I am not holding my breath. Even if I can, they max out at 8 megs of ram that they can address so they will still be underpowered for my purpose. >Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? I am still working through that. The third party lib, DataStreams from www.csvreader.com Has a set of objects (readers) which can read and write streams to and from files. The docs are complete but the examples are sparse! However the author is available on his forums to answer questions and generally responds within a few hours. Basically what happens is that you instantiate one of the reader objects, tell the object what data type each column will be and then pass in a stream from that object to the SQLBulkCopy object. The DataStreams reader object handles all of the opening of the file, parsing the CSV file into an array and writing the array data into the stream. It appears to handle chunks of data so that the entire file does not have to fit into memory at once. With a CSV file, typically there is a header line in the first row. DataStreams reads that in and does the mapping for you if that row exists. He also has methods for obtaining the collection of field names etc, so I am actually building code to automatically build a table in SQL Server based on the names in the field names collection, plus a PK column of my own (long autoincrement) out at the end. His code correctly feeds the data into the table IF the columns from the file are the first columns, i.e. the PK is at the end of the table, but does not correctly handle the data feed if the PK is the first field in the table (and there is no PK field in the data). Remember that I have two distinct cases. 1) Data (lists) from vendors. These may have some "PK" of their own, but I do not know what it is or whether there will be one (typically not) so I just routinely build my own. 2) Data that I export from SQL Server, process, and get back from the address validation software. Those CSVs already have a PKID because my source tables have one and I export that PKID into the CSV file when I do the export from SQL Server. Given the costs of the lib, I am very impressed with the implementation so far. He provides a record event to allow preprocessing data within each record being read before sending it off to the SQLBulkCopy. You can do anything you might imagine with such control - look for specific data values in a given field, skip the record based on such evaluations, modify the data in specific fields etc, all on-the-fly as the data moves from CSV to SQL Server. I believe it also handles fixed width files which is also on my plate. So basically I just outsourced one small but complex part of the project. It was easy to get working and seems pretty fast so I am happy with the results so far. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:05:18 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:05:18 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724160529.0F54FBD8E@smtp-auth.no-ip.com> Shamil, I have started logging the imports now so I can tell you the times to import (in time / tick counts) as soon as I do a bunch, which will be today. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 11:10:37 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 12:10:37 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <001101c7cd63$a3ae3d30$6401a8c0@nant> Message-ID: <20070724161047.DA2F0BC81@smtp-auth.no-ip.com> One issue I am running into is that I really want to be able to log the start / stop PKID of each record imported. I use an autoincrement in SQL Server, but I do not know how to get at the last PKID in these values "live" as the SQLBulkInsert runs. Is it possible to pull the value of a field back out of the SQLBulkInsert object? Do I have to execute a sql statement to "get" the value of the PKID of the last record before the import and the last record after the import? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com From Gustav at cactus.dk Tue Jul 24 11:12:45 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 24 Jul 2007 18:12:45 +0200 Subject: [dba-VB] How I'm approaching the problem Message-ID: Hi John Don't you subscribe to the Action Pack? The July update includes DVDs with Windows Vista Business 64 bit Windows Server 2003 R2 64 bit Windows Server 2008 Enterprise 64 bit Beta 3 That's not a running server, I know, but an important part ... /gustav >>> jwcolby at colbyconsulting.com 24-07-2007 17:02 >>> My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. From jwcolby at colbyconsulting.com Tue Jul 24 12:35:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 13:35:56 -0400 Subject: [dba-VB] The command object exception Message-ID: <20070724173606.D7354BCD1@smtp-auth.no-ip.com> I am trying to execute queries that build databases, build tables etc. When I executed the ExecuteNonQuery method with a query that built a database and the database already exists, I got an error returned of -2147217900. When I tried to execute a sql statement with a general error I got the same error returned. How do I get meaningful error codes back from ExecuteNonQuery? Try mobjCmd.ExecuteNonQuery() Catch ex As OleDbException Select Case ex.ErrorCode Case -2147217900 'database already exists so ignore the error Case Else MessageBox.Show(ex.Message) Return -3 End Select End Try John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Jul 24 14:32:57 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 15:32:57 -0400 Subject: [dba-VB] Count of specific character Message-ID: <20070724193307.C3D38BE7E@smtp-auth.no-ip.com> Is there any single function that will return a count of a specific character in a string? I have a situation where (apparently) the header of a CSV file has the same field name twice. I am trying to determine what is going on, so I want to count the field separator characters in the header and the first line of real data to see if there are more fields in the header than in the data or if something else is going on. John W. Colby Colby Consulting www.ColbyConsulting.com From shamil at users.mns.ru Tue Jul 24 14:37:04 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 23:37:04 +0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <20070724150235.C5CE4BD9E@smtp-auth.no-ip.com> Message-ID: <000001c7ce2a$03a5e320$6401a8c0@nant> Hello John, <<< I don't understand the context - would what have any economical sense? >>> I meant does your customer need to make bulk loading any faster or not? You know one may fly Paris - NY using ordinary Boeing planes, one can use (in the past) Concord or even TU-144(!?) (http://en.wikipedia.org/wiki/Tupolev_Tu-144) - IOW does your customer still need Concord for their task or current very good Boeing solution is good enough for them now and for a long time in the future? I also mean we can try to find what is (if any) bottleneck of the current solution and "break" this bottleneck? Some tests (Dual Core 3MHz, 2GB, W2003 Server, simple IDE/SATA 7400rpm HDD) - the raw performance of reading a delimited by TAB char CSV file in .NET: Total Counter = 1011852 (1 million...) ElapsedTime = 3,359375 seconds ElapsedTime = 0,0559895833333333 minutes Total Counter = 10006092 (10 million...) ElapsedTime = 32,890625 seconds ElapsedTime = 0,548177083333333 minutes Total Counter = 100010952 (100 million...) ElapsedTime = 327,875 seconds ElapsedTime = 5,46458333333333 minutes Splitting of CSV file lines into array added... Total Counter = 1011852 (1 million...) ElapsedTime = 8,375 seconds ElapsedTime = 0,139583333333333 minutes ... (I didn't have time to test other cases of 10 and 100 million source file lines - please do if you have time...) Of course that is just reading the file - the open question is how closely this extreme files reading performance can be approached when such a file is bulk loaded into MS SQL Database? Join, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... I must say I'm very interested to return here next week, sorry for any inconvenience... -- Shamil P.S. Simple C# code used for testing (watch line wraps): using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long MAX_LIMIT = 1000000; // 00; string s = @"F:\Temp\XL\ConsoleApplication1\IN\testfile.txt"; long totalCounter = 0; long lineCounter = 0; DateTime startTime = DateTime.Now; while (totalCounter < MAX_LIMIT) { System.IO.TextReader rdr = new System.IO.StreamReader(s); lineCounter = 0; string inline = ""; char delimiter = (char)9; while ((inline = rdr.ReadLine())!=null) { string[] fields = inline.Split(delimiter); ++totalCounter; ++lineCounter; } rdr.Close(); } DateTime endTime = DateTime.Now ; TimeSpan elapsedTime = endTime - startTime; Console.WriteLine("File Line Counter = {0}", lineCounter.ToString()); Console.WriteLine("Total Counter = {0}", totalCounter.ToString()); Console.WriteLine("ElapsedTime = {0} seconds", elapsedTime.TotalSeconds.ToString()); Console.WriteLine("ElapsedTime = {0} minutes", elapsedTime.TotalMinutes.ToString()); } } } -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 7:02 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, >Would that have any (economical) sense for your customer to improve DB bulk loading time? I don't understand the context - would what have any economical sense? >Why you do not use 64 bit .Net Framework to run your code on the server side? My understanding is that in order to run anything in 64 bit mode I have to have 64 bit Windows and 64 bit SQL Server. I only have 32 bit installed at this time. I have obtained a copy of 64 bit SQL Server and am looking for 64 bit Windows 2003. I have several problems here. First, I am a one man show with a month by month budget. Second, In order to get maximum bang for my hard earned dollar I build my own systems. I was talking to the owner of the company that does my address validation and they just spend $25,000 for a DELL server with 32 megs of data and windows 2003 x64. I don't have that kind of money. When you buy a DELL (as an example) then getting Windows x64 to install is a simple click of the button on the order page. Getting windows x64 to install on a desktop is not so simple, with issues for ALL of the drivers from video, network, disk etc. When I built the workstations I use to run SQL Server I did not understand the size of the task; Now I do. I will be building a new server this fall with a server motherboard, designed and certified to run the X64 versions of windows, with drivers supplied etc. It will be a dual processor / 8 core machine which will contain 32 megs or ram to start, 64 megs eventually. I MAY be able to get Windows 2003 x64 to run on the current servers, and if I can then I will but I am not holding my breath. Even if I can, they max out at 8 megs of ram that they can address so they will still be underpowered for my purpose. >Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? I am still working through that. The third party lib, DataStreams from www.csvreader.com Has a set of objects (readers) which can read and write streams to and from files. The docs are complete but the examples are sparse! However the author is available on his forums to answer questions and generally responds within a few hours. Basically what happens is that you instantiate one of the reader objects, tell the object what data type each column will be and then pass in a stream from that object to the SQLBulkCopy object. The DataStreams reader object handles all of the opening of the file, parsing the CSV file into an array and writing the array data into the stream. It appears to handle chunks of data so that the entire file does not have to fit into memory at once. With a CSV file, typically there is a header line in the first row. DataStreams reads that in and does the mapping for you if that row exists. He also has methods for obtaining the collection of field names etc, so I am actually building code to automatically build a table in SQL Server based on the names in the field names collection, plus a PK column of my own (long autoincrement) out at the end. His code correctly feeds the data into the table IF the columns from the file are the first columns, i.e. the PK is at the end of the table, but does not correctly handle the data feed if the PK is the first field in the table (and there is no PK field in the data). Remember that I have two distinct cases. 1) Data (lists) from vendors. These may have some "PK" of their own, but I do not know what it is or whether there will be one (typically not) so I just routinely build my own. 2) Data that I export from SQL Server, process, and get back from the address validation software. Those CSVs already have a PKID because my source tables have one and I export that PKID into the CSV file when I do the export from SQL Server. Given the costs of the lib, I am very impressed with the implementation so far. He provides a record event to allow preprocessing data within each record being read before sending it off to the SQLBulkCopy. You can do anything you might imagine with such control - look for specific data values in a given field, skip the record based on such evaluations, modify the data in specific fields etc, all on-the-fly as the data moves from CSV to SQL Server. I believe it also handles fixed width files which is also on my plate. So basically I just outsourced one small but complex part of the project. It was easy to get working and seems pretty fast so I am happy with the results so far. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, Would that have any (economical) sense for your customer to improve DB bulk loading time? Why you do not use 64 bit .Net Framework to run your code on the server side? Do you need to do any mapping in your code between third-party data reader (IDataReader) object and SqlBilkCopy SqlBulkCopyColumnMappingCollection or the sequence of the fields in the source CSV file is the same as the sequence of the fields in the target database table? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 12:17 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Well... The SQL Server system is an AMD X64 3.8 ghz with 4 gig ram running Windows 2003. It is using a Raid 6 array with a dedicated controller. The actual VB.Net program is running on my laptop a Dell m90 which is a dual proc Intel with 2 gig of ram running Windows XP Pro. Thus the raw data files come off the server into the laptop across a 1 gbit LAN, the laptop does the text processing and feeds the data back to the SQL Server for storing in the database. All of this will be effected by things like the number of fields, type of fields written to in SQL Server (what the data actually is and data type of the destination field), indexes that exist on the table etc. Mine are very rough timings done by using the clock at the beginning / end of the bulk import. The custom library that I use was optimized (according to the author) by using arrays to store the data coming out of the text file, on the way to the SQL Server. Again I haven't seen his code (I can pay more money to get source but I don't need that), so I can't really comment on the "how" of what he is doing. I do know that I open the file using his lib and pass a resulting stream (property of his reader object) to the SQLBulkCopy. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 3:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem <<< I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. >>> Yes, that's speedy! Do you use any special hardware? Here are some results of using SQLDMO.BulkCopy under C#/VB.NET: SQLDMO.BulkCopy ================ BCP export - 141 seconds 1,216,138 reported rows BCP Import - 174 seconds 1,256,819 reported rows Extrapolating to 100 million records: BCP Export: 141*100,000,000/1,216,138 = 11594,17 seconds = 3.22 hours ~= 3h10m BCP Import: 173*1000,000,000/1,256,819 = 12844,48 seconds = 3,85 hours ~= 3h50min Well performance will probably degrade and total time will be higher... These results are not that quick as on your system for SQLBulkCopy but this my test PC is "pretty simple" for these days Dual Core Pentium 3GHz and 2GB RAM and simple 7400 rpm harddisk.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 23, 2007 9:38 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Shamil, I am likewise using SQLBulkCopy to import data from CSV files using a third party library to handle the conversion of the file to a stream and vv. I am quite impressed. Using my hand written code for doing something similar I was getting between around 1k records / second loading "row by row" whereas using SQLBulkCopy and this third party lib I am getting about 16K records / second = about 60 seconds for 1 million records. That is quite usable. I am doing tables of 50 to 100 million records so the total process can still run 60 to 90 minutes but it was taking 2 days. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, July 23, 2007 1:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem All, To keep "XML - go/no go discussion on" I just wanted to post some real stats on MS SQL 2000/2005 and XML I have got today out of the project I'm working currently on - this is a real database (84 tables), real production data, quantity of source rows in DB = [RowsQty]/3. The test gets data from MS SQL db tables via stored procedures into in memory List<...> collections via SqlReader (.NET) etc. - usual modern multi-tier architecture. Test PC is Intel Dual Core 3Mhz + 2GM RAM with MS Windows 2003 Server - nothing special for these days. In more details the test does the following: MS SQL 2000 Database -> SqlDataReader (.NET) -> DL custom classes/list (C#) -> BL custom classes/list (C#) -> XmlSerializer (.NET) -> XML file (written via TextWriter (.NET) -> deserialize using XmlSerailizer and TextReader (..NET) -> serialize into another XML file using XmlSerializer and TextWriter (.NET) Below are some results sorted descending by elapsed time in seconds (Note: table names are "censored" - it's a real project and I'm not sure customer will like to see real table names published) Performance of this test looks here very impressive - have a look of stats (Note: results are cross tested by using serialized data to store back into db then extract again etc. - no mistakes here. And BTW loading these data using stored procedures row by row takes quite some time (several hours) but when loading these data using special .NET Framework class (System.Data.SqlClient.SqlBulkCopy), which is working much like BCP then the loading of this db takes less than 10 minutes - total qty of rows in all tables is 1,131,004 (one million...) Elapsed time for this test: 122,421875 seconds (2 minutes), total elements (rows) processed - 3,393,012 (three million...) I will be experimenting more in the coming days (end of August probably) and I will post more results... And this is not pure experimenting/"mad scientist games" - this code will be used in production for stress testing, for data replication etc. etc. Finally stats: DB -> Memory -> XML file -> Memory -> another Xml File (to use in first cross-test): TableName Elapsed Time (s) RowsQty ====== ========== ===== Table53 20.7500000 260286 Table71 12.6562500 327819 Table29 08.2500000 105000 Table79 07.4843750 204243 Table80 07.3750000 299556 Table84 06.7656250 262908 Table82 06.6718750 263337 Table75 06.5000000 250155 Table37 05.4062500 318555 Table68 04.0156250 189810 Table69 03.7500000 83490 Table72 03.1562500 74598 Table81 03.0312500 199287 Table73 02.8281250 135150 Table38 02.6406250 108636 Table30 01.8593750 108726 Here are individual steps stats: Database -> custom objects in List<...> Elapsed Time(s) RowsQty ========== ====== 05.9218750 86762 03.7656250 109273 02.6406250 35000 02.2968750 68081 02.2812500 99852 02.2343750 87636 02.1875000 87779 02.0312500 83385 01.7656250 106185 01.4062500 24866 01.3906250 63270 01.2343750 27830 01.0468750 45050 01.0312500 66429 Memory (custom objects) -> XML files ElapsedTime(s) RowsQty ========= ======= 08.8750000 86762 05.0468750 109273 03.2812500 35000 02.9375000 99852 02.7187500 83385 02.6718750 68081 02.5156250 87779 02.4687500 87636 02.1250000 106185 01.5000000 27830 01.4218750 63270 01.1562500 66429 01.00000 24866 00.9687500 45050 00.8750000 36212 00.6718750 36242 XML File -> Memory (custom objects) ElapsedTime(s) RowsQty ======= ===== 05.9531250 86762 03.8437500 109273 02.5156250 68081 02.3281250 35000 02.1562500 99852 02.0625000 87636 01.9687500 87779 01.7500000 83385 01.5156250 106185 01.2031250 63270 01.0156250 27830 00.8437500 66429 00.8125000 45050 00.7812500 36212 And here is "microscopic" generic DAL, which is built using only three(!) ADO.NET classes SqlConnection, SqlCommand, IDataReader used here: public int ExecuteNonQuery(DbCommand cmd) { return ExecuteNonQuery(cmd, false); } public IDataReader ExecuteReader(DbCommand cmd) { return ExecuteReader(cmd, CommandBehavior.Default); } public IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior) { return cmd.ExecuteReader(behavior); } That's it. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, July 23, 2007 7:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hi John: You have taken on a massively complex project single-handedly. When I was working full-time for a company and a similar sized project appeared I assign at least 2 people to the project. It seems that 2 people can do the work of three when they work together. MS SQL people tend to think their a little better than the standard Access grunts. Why that is so I have no idea. Considering that MS SQL developers have the luxury of working with a faster and better product that is much easier to obtain positive results than from an equally complex project written totally in Access. That is why I write most of my new apps in a combination of Access FE and MS SQL BE because I get the best of all worlds. MS SQL is more rugged than the MDB, handles unbound connections without the absolute need for a complex locking scheme as MS SQL is designed to work it this type of environment. It internally handles locking, multi-access to a single record or group of records. It is a professional level DB and is actually easier to work with. Unfortunately, ADO is the best connection protocol for performance and reliability but if you do not know it, it is just another major item to learn. If we throw learn .Net from scratch into the mix and you have to hold on with both hands just to keep your sanity. I am amazed at how far you have come in such a short time. Nothing like a baptism in fire... If you are a little stressed, it is to be expected. Hope your day has gone well. Regards Jim <<< tail of thread trimmed>> _______________________________________________ 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at users.mns.ru Tue Jul 24 14:54:44 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 24 Jul 2007 23:54:44 +0400 Subject: [dba-VB] Count of specific character In-Reply-To: <20070724193307.C3D38BE7E@smtp-auth.no-ip.com> Message-ID: <000101c7ce2c$7b5ace60$6401a8c0@nant> Hello John, You can use System.Text.RegularExpressions (see for details in MSDN) - here is a C# sample: // count 'a' char occurrences string testString = "One car red car blue car"; MatchCollection matches = Regex.Matches(testString, "[a]"); Console.WriteLine(matches.Count.ToString()); Please take into account that Regex is not "lightning fast" - I mean experts do not recommend to rely on its speed to investigate/parse large amounts of text data in short time... If time is not an issue then Regex can do in a few (one!?) line of code many things, which manually written will take many more code lines. Although as I noted above manually written custom code could be (much) quicker than Regex to "pump through" large amounts of text data... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, July 24, 2007 11:33 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Count of specific character Is there any single function that will return a count of a specific character in a string? I have a situation where (apparently) the header of a CSV file has the same field name twice. I am trying to determine what is going on, so I want to count the field separator characters in the header and the first line of real data to see if there are more fields in the header than in the data or if something else is going on. John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Jul 24 15:29:16 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 24 Jul 2007 16:29:16 -0400 Subject: [dba-VB] How I'm approaching the problem In-Reply-To: <000001c7ce2a$03a5e320$6401a8c0@nant> Message-ID: <20070724202926.DD477BD76@smtp-auth.no-ip.com> Shamil, >John, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... Understood, I will answer so that it will be available for when you are back. >I meant does your customer need to make bulk loading any faster or not? The short answer is yes. The long answer is really that I did not buy the library to make the speed faster, I bought it to make the implementation (coding) faster by not having to handle this part myself. However to answer your question directly, I am moving to a model where I charge the client for each operation, i.e. for computer time. IOW, in each process that imports or exports data, the amount of time required to perform that process is logged, and will (eventually) be directly entered into a billing program. So the client will be billed for X hours of computer time, where A hours are used for import of raw data lists, B hours are used for address export, C hours are used for address validation (by a different server in my office), D hours are used to import the data back into the SQL Server database, etc. I will not be breaking the time down on the bill, I envision billing line items like $XXX for address import of raw data list XYZ $YYY for address validation of list QRS Etc. With luck (and hard work), someday soon these processes will run totally automatically, with no manual input from me. Thus I will be essentially charging for "process", not my personal time. This billing method allows the client to understand the overall costs. But by logging the actual times required for doing each part I can understand where my bottlenecks are, plan for upgrades to handle my requirements etc. So the faster it works the less I make and the more the client saves. 8-( Alternatively, the faster it runs the more lists I can run on a given machine in a given period of time. 8-) I am really trying to sell the customer on how efficient it is (vs. his old method) to import his lists, and then export / address validate / reimport them. The client does not understand the mechanics behind the process, nor does he want to or care to. What he does understand is that it used to cost him (literally) $1.25 / thousand names to get addresses validated. I can do it for $.12 / thousand names, or about 1/10th his previous cost. Not only can I do it for that, I can make a killing doing it at that cost, IF I can move the frequency up to once per month or even every three months. The lists have to be reprocessed every X time units, perhaps monthly, perhaps quarterly. Again, by being able to demonstrate efficiency, I can convince the client that is cost effective to use my service, and also cost effective to perform this service monthly instead of waiting every six months or every year. He gets to sell his business by marketing "addresses cleaned monthly", and believe me that is important to his client. I doubt he will drop his cost to pass on the cost savings so he ends up making more / thousand names since he is now paying way less to do that process. His previous provider was so expensive that he literally did the address validation on each order and passed the cost through. I want a business model where he can afford (and he CAN!) to do this process monthly on each of his lists. Thus I get an income stream that I can depend on, and I get a process that does not cost me MY TIME, but rather sells the client my computer's time. "More work, more / faster computers" instead of "more work, more of MY TIME". I want to be sitting on the beach while my computers are earning me money. So yea, it always pays to do something faster, whether in my ability to make more money on each hour of machine time, or my ability to be more efficient and sell that to the client and get more work. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, July 24, 2007 3:37 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] How I'm approaching the problem Hello John, <<< I don't understand the context - would what have any economical sense? >>> I meant does your customer need to make bulk loading any faster or not? You know one may fly Paris - NY using ordinary Boeing planes, one can use (in the past) Concord or even TU-144(!?) (http://en.wikipedia.org/wiki/Tupolev_Tu-144) - IOW does your customer still need Concord for their task or current very good Boeing solution is good enough for them now and for a long time in the future? I also mean we can try to find what is (if any) bottleneck of the current solution and "break" this bottleneck? Some tests (Dual Core 3MHz, 2GB, W2003 Server, simple IDE/SATA 7400rpm HDD) - the raw performance of reading a delimited by TAB char CSV file in .NET: Total Counter = 1011852 (1 million...) ElapsedTime = 3,359375 seconds ElapsedTime = 0,0559895833333333 minutes Total Counter = 10006092 (10 million...) ElapsedTime = 32,890625 seconds ElapsedTime = 0,548177083333333 minutes Total Counter = 100010952 (100 million...) ElapsedTime = 327,875 seconds ElapsedTime = 5,46458333333333 minutes Splitting of CSV file lines into array added... Total Counter = 1011852 (1 million...) ElapsedTime = 8,375 seconds ElapsedTime = 0,139583333333333 minutes ... (I didn't have time to test other cases of 10 and 100 million source file lines - please do if you have time...) Of course that is just reading the file - the open question is how closely this extreme files reading performance can be approached when such a file is bulk loaded into MS SQL Database? Join, I'm sorry I have to suspend my participation in this thread for several days - very urgent project is here waiting for release... I must say I'm very interested to return here next week, sorry for any inconvenience... -- Shamil P.S. Simple C# code used for testing (watch line wraps): using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long MAX_LIMIT = 1000000; // 00; string s = @"F:\Temp\XL\ConsoleApplication1\IN\testfile.txt"; long totalCounter = 0; long lineCounter = 0; DateTime startTime = DateTime.Now; while (totalCounter < MAX_LIMIT) { System.IO.TextReader rdr = new System.IO.StreamReader(s); lineCounter = 0; string inline = ""; char delimiter = (char)9; while ((inline = rdr.ReadLine())!=null) { string[] fields = inline.Split(delimiter); ++totalCounter; ++lineCounter; } rdr.Close(); } DateTime endTime = DateTime.Now ; TimeSpan elapsedTime = endTime - startTime; Console.WriteLine("File Line Counter = {0}", lineCounter.ToString()); Console.WriteLine("Total Counter = {0}", totalCounter.ToString()); Console.WriteLine("ElapsedTime = {0} seconds", elapsedTime.TotalSeconds.ToString()); Console.WriteLine("ElapsedTime = {0} minutes", elapsedTime.TotalMinutes.ToString()); } } } From Chris.Foote at uk.thalesgroup.com Wed Jul 25 05:38:29 2007 From: Chris.Foote at uk.thalesgroup.com (Foote, Chris) Date: Wed, 25 Jul 2007 11:38:29 +0100 Subject: [dba-VB] Count of specific character Message-ID: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV > file has the same > field name twice. I am trying to determine what is going on, > so I want to > count the field separator characters in the header and the > first line of > real data to see if there are more fields in the header than > in the data or > if something else is going on. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Jul 25 08:20:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 25 Jul 2007 09:20:05 -0400 Subject: [dba-VB] Count of specific character In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Message-ID: <20070725132017.45122BC2A@smtp-auth.no-ip.com> Wow. That does work. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 6:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 DWUTKA at Marlow.com Wed Jul 25 08:08:21 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 25 Jul 2007 08:08:21 -0500 Subject: [dba-VB] Count of specific character In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> References: <7303A459C921B5499AF732CCEEAD2B7F064D1110@craws161660.int.rdel.co.uk> Message-ID: Neat trick, you could do that with Replace in VB. Len(strTemp)-Len(Replace(strTemp,"X","")) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 5:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From ebarro at verizon.net Wed Jul 25 09:07:29 2007 From: ebarro at verizon.net (Eric Barro) Date: Wed, 25 Jul 2007 07:07:29 -0700 Subject: [dba-VB] Count of specific character In-Reply-To: Message-ID: <0JLQ007KNN7CGNW3@vms046.mailsrvcs.net> And in .NET (both VB and C#)... strTemp.Length - strTemp.Replace("X", "").Length -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, July 25, 2007 6:08 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Count of specific character Neat trick, you could do that with Replace in VB. Len(strTemp)-Len(Replace(strTemp,"X","")) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Foote, Chris Sent: Wednesday, July 25, 2007 5:38 AM To: 'dba-vb at databaseadvisors.com' Subject: Re: [dba-VB] Count of specific character Morning John! I do not know of any specific special function to do this, but there's a trick I use in Excel using the SUBSTITUTE function. I use LEN to get the number of characters in the original string. Use SUBSTITUTE to replace the character I need to count with "" (nothing). LEN the results and subtract this from the original LEN. Hope this helps! Regards Chris Foote > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of jwcolby > Sent: Tuesday, July 24, 2007 8:33 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Count of specific character > > > Is there any single function that will return a count of a specific > character in a string? > > I have a situation where (apparently) the header of a CSV file has the > same field name twice. I am trying to determine what is going on, so > I want to count the field separator characters in the header and the > first line of real data to see if there are more fields in the header > than in the data or if something else is going on. > > John W. Colby > Colby Consulting > 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.19/917 - Release Date: 7/25/2007 1:16 AM From jwcolby at colbyconsulting.com Fri Jul 27 09:49:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 27 Jul 2007 10:49:23 -0400 Subject: [dba-VB] VB.Net - Proxy Class Message-ID: <20070727144938.81890BF2D@smtp-auth.no-ip.com> I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Jul 27 10:14:13 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jul 2007 08:14:13 -0700 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727144938.81890BF2D@smtp-auth.no-ip.com> References: <20070727144938.81890BF2D@smtp-auth.no-ip.com> Message-ID: John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jul 27 10:13:27 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jul 2007 10:13:27 -0500 Subject: [dba-VB] Odd problem with VB 6 application Message-ID: This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Jul 27 11:31:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 27 Jul 2007 12:31:32 -0400 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: Message-ID: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> Charlotte, Thanks for that. In fact I am examining using back ground threads to handle the process class work, however not knowing as much as I need to about VB.Net and .Net in general I want to get the entire process running (so I can do work) and then go investigate and use threads and background workers. In the meantime, what I am think of is a "middle man" class. The form knows about the middle man and can sink its events. The middle man can sink events from any class that implements a certain interface (but I think that is the wrong terminology here). The middle man sinks events from any class that can raise those events, and just immediately raises its own event, identically named, passing the parameters on. I have something similar to in concept but not exactly the same in implementation already working in VBA. I call it a message class. A message class is instantiated. It has a method that is called to send a message. Anyone with a pointer to the message class instance can call a method of the class instance and send a message. The message class simply raises an event and passes on the message. Anyone with a pointer to the message class can sink its events and receive any message. The message class is a middleman. Each end has to know about and get a pointer to the a clsMessage instance but they do not have to know about each other specifically. clsProcess needs to send a message. It gets a pointer to a clsMessage instance, calls a method of that instance and sends the message. clsMonitor needs to monitor clsProcess. It gets a pointer to the clsMessage instance and sinks it's events. Whenever clsProcess sends a message, it is passed through clsMessage and received by clsMonitor. clsMonitor can receive messages from ANY clsProcess (or any other class that sends messages on that instance of clsMessage). clsProcess can send messages and not worry about whether anyone is listening. If some class wants to log clsProcess' messages they can, if some other class wants to display clsProcess' messages on a form, they can etc. Loosely coupled interface, implemented through a common class instance. In fact messages can be sent back and forth between two classes or 100 classes, all listening on the message channel. BTW, a demo of that is on my web site in the WithEvents demo section. So I am looking to implement a similar construct here. In .Net though I have more flexibility in implementation because there are more capabilities available. Real inheritance, casting of an object to a specific data type etc. I do not know whether I can do what I am struggling to conceptualize. I want a process class to raise events. This allows the loosely coupled interface on the sending end. I want a proxy class instance to sink those events and retransmit them I want a progress form to sink events from a specific proxy class instance and use them. This allows the loosely coupled interface in the receiving end. The proxy class in the middle is the issue. IF I could create a clsProxy instance, pass in clsProcess to that instance as an OBJECT, then cast that object to a class that can be used WithEvents in a dim statement I would be there. I do not know how to do this. I can use the message class concept, I have already implemented that in VBA. That has the disadvantage of having to set up the message class instance and passing it in to the process class and to the progress form, but it is a lot more straightforward, and I can do that right now. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, July 27, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Fri Jul 27 11:54:45 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jul 2007 09:54:45 -0700 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> References: <20070727163148.73B6BBE23@smtp-auth.no-ip.com> Message-ID: We use custom exception handlers, for example, and other "helper" classes. In the catch of a try-catch pair, we call the exception handler and pass it the exception and pops up a message ... But only for unhandled exceptions. We handle data exceptions in the data entity classes we create and pass the exception with custom message back to the calling object. We let the calling object then call a validationhelper class to handle the exception result it got, and that's were we pop up the messagebox and allow the user the OK or cancel options. We've tried to keep the model as untangled as possible, and the results affect the UI, so we make one-step jumps rather than daisy chaining events. I'm not sure whether that equates to what you're describing or not. We may, in fact, raise an event from a usercontrol, sink it in the parent of that usercontrol and raise another event from the parent to broadcast the result, if that's what you're describing. As for interface, we have defined interface classes, for instance for iToolbars and iValidation, which when implemented insert their shells into the object implementing them. In that object, we build code appropriate to whatever the event should do in that particular object. iValidation includes an IsValid function that accepts a feedbackstyle argument. The code in the object that implements it calls into the data entity class to validate a record before trying to update it. The validate event of the dataentity accepts a datarow uses the business rules tests in the entity and returns a boolean value for whether all the tests pass on the row. The calling object gets the boolean value back and if the record is valid, it save it. If it is not valid, it calls the ValidationHelper class to handle the exception message. That keeps up from changing something in the "middle" that breaks a bunch of other things. I don't know if that helps or not, because you're coming from a slightly different direction. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 9:32 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class Charlotte, Thanks for that. In fact I am examining using back ground threads to handle the process class work, however not knowing as much as I need to about VB.Net and .Net in general I want to get the entire process running (so I can do work) and then go investigate and use threads and background workers. In the meantime, what I am think of is a "middle man" class. The form knows about the middle man and can sink its events. The middle man can sink events from any class that implements a certain interface (but I think that is the wrong terminology here). The middle man sinks events from any class that can raise those events, and just immediately raises its own event, identically named, passing the parameters on. I have something similar to in concept but not exactly the same in implementation already working in VBA. I call it a message class. A message class is instantiated. It has a method that is called to send a message. Anyone with a pointer to the message class instance can call a method of the class instance and send a message. The message class simply raises an event and passes on the message. Anyone with a pointer to the message class can sink its events and receive any message. The message class is a middleman. Each end has to know about and get a pointer to the a clsMessage instance but they do not have to know about each other specifically. clsProcess needs to send a message. It gets a pointer to a clsMessage instance, calls a method of that instance and sends the message. clsMonitor needs to monitor clsProcess. It gets a pointer to the clsMessage instance and sinks it's events. Whenever clsProcess sends a message, it is passed through clsMessage and received by clsMonitor. clsMonitor can receive messages from ANY clsProcess (or any other class that sends messages on that instance of clsMessage). clsProcess can send messages and not worry about whether anyone is listening. If some class wants to log clsProcess' messages they can, if some other class wants to display clsProcess' messages on a form, they can etc. Loosely coupled interface, implemented through a common class instance. In fact messages can be sent back and forth between two classes or 100 classes, all listening on the message channel. BTW, a demo of that is on my web site in the WithEvents demo section. So I am looking to implement a similar construct here. In .Net though I have more flexibility in implementation because there are more capabilities available. Real inheritance, casting of an object to a specific data type etc. I do not know whether I can do what I am struggling to conceptualize. I want a process class to raise events. This allows the loosely coupled interface on the sending end. I want a proxy class instance to sink those events and retransmit them I want a progress form to sink events from a specific proxy class instance and use them. This allows the loosely coupled interface in the receiving end. The proxy class in the middle is the issue. IF I could create a clsProxy instance, pass in clsProcess to that instance as an OBJECT, then cast that object to a class that can be used WithEvents in a dim statement I would be there. I do not know how to do this. I can use the message class concept, I have already implemented that in VBA. That has the disadvantage of having to set up the message class instance and passing it in to the process class and to the progress form, but it is a lot more straightforward, and I can do that right now. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, July 27, 2007 11:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net - Proxy Class John, We use a System.ComponentModel.backgroundworker for stuff like this--progress bars, etc. There is a System.ComponentModel delegate called DoWorkEventHandler that may be what you're looking for. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 7:49 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting 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 shamil at users.mns.ru Fri Jul 27 12:56:14 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Fri, 27 Jul 2007 21:56:14 +0400 Subject: [dba-VB] VB.Net - Proxy Class In-Reply-To: <20070727144938.81890BF2D@smtp-auth.no-ip.com> Message-ID: <000501c7d077$6cae5b00$6401a8c0@nant> Hello John, Beware! - you're entering tricky world of threads, events and delegates (you never know what happens next in this world I mean). Be especially careful with sending notification to the form (thread) from worker processes - as Charlotte noted here System.ComponentModel.BackgroundWorker is the most safe solution for this case while you're getting through learning curve.... Sample code without using System.ComponentModel.BackgroundWorker and not tested with WinForms - just use VB.NET console application to run it (watch line wraps): ============ Imports System.Threading Imports System.Collections.Generic Module SSTestOfEventsAndDelegates ' // Delegate declaration Public Delegate Sub TestEventDelegate(ByVal objectId As Long, ByVal msgId As Integer) ' // main object (form simulator) Public Class TestForm Private WithEvents _proxy _ As New TestProcessEventsProxy() Private _testCount As Integer = 0 Private Sub _proxy_TestEvent(ByVal objectId As Long, ByVal msgId As Integer) _ Handles _proxy.TestEvent Console.WriteLine("TestForm: Message {0}.{1} arrived.", msgId, objectId) _testCount += 1 End Sub Public Sub Test() _proxy.Test() Dim startTime As DateTime = DateTime.Now Dim ts As TimeSpan = TimeSpan.MinValue Dim currentTime As DateTime = DateTime.MinValue While (_testCount < 9) And _ (ts < New TimeSpan(50000000)) '// 5s ts = DateTime.Now - startTime System.Threading.Thread.Sleep(250) Console.WriteLine("TestForm: Waiting for events, count = {0}, timeSpan = {1} s...", _ _testCount, ts.TotalSeconds) End While End Sub End Class ' // Proxy Public Class TestProcessEventsProxy Public Event TestEvent(ByVal Id As Long, ByVal msgId As Integer) Private _senders As List(Of System.Threading.Thread) = _ New List(Of System.Threading.Thread)() Public Sub Test() For i As Integer = 1 To 3 Dim newThread As System.Threading.Thread = _ New System.Threading.Thread(AddressOf myThread) newThread.Start() _senders.Add(newThread) Next i End Sub Protected Sub myThread() Dim obj As New TestProcess(AddressOf TestEventHook) obj.Test() End Sub Public Sub TestEventHook(ByVal objectId As Long, ByVal msgId As Integer) Console.WriteLine("Proxy: Message {0}.{1} is to be retransmitted.", objectId, msgId) RaiseEvent TestEvent(objectId, msgId) Console.WriteLine("Proxy: Message {0}.{1} has been retransmitted.", objectId, msgId) End Sub End Class ' // worker process Public Class TestProcess Private Shared _id As Long = 0 Private _myId As Long Private _myDelegate As TestEventDelegate Private _myMessageId As Long = 0 Public Sub New(ByRef eventDeleGate As TestEventDelegate) _myId = Interlocked.Increment(_id) _myDelegate = eventDeleGate End Sub Public Sub Test() For i As Integer = 1 To 3 _mymessageId += 1 System.Threading.Thread.Sleep(300) Console.WriteLine("Process: Message {0}.{1} is to be sent.", _myId, _myMessageId) _myDelegate.Invoke(_myId, _myMessageId) Console.WriteLine("Process: Message {0}.{1} has been sent.", _myId, _myMessageId) Next i End Sub End Class '// test Sub Main() Dim obj As New TestForm() obj.Test() End Sub End Module My results: =========== TestForm: Waiting for events, count = 0, timeSpan = 0 s... Process: Message 2.1 is to be sent. Process: Message 1.1 is to be sent. Proxy: Message 2.1 is to be retransmitted. Proxy: Message 1.1 is to be retransmitted. TestForm: Message 1.2 arrived. Proxy: Message 2.1 has been retransmitted. Process: Message 2.1 has been sent. Process: Message 3.1 is to be sent. Proxy: Message 3.1 is to be retransmitted. TestForm: Message 1.3 arrived. Proxy: Message 3.1 has been retransmitted. Process: Message 3.1 has been sent. TestForm: Message 1.1 arrived. Proxy: Message 1.1 has been retransmitted. Process: Message 1.1 has been sent. TestForm: Waiting for events, count = 3, timeSpan = 0,25 s... Process: Message 2.2 is to be sent. Proxy: Message 2.2 is to be retransmitted. TestForm: Message 2.2 arrived. Proxy: Message 2.2 has been retransmitted. Process: Message 2.2 has been sent. Process: Message 3.2 is to be sent. Proxy: Message 3.2 is to be retransmitted. TestForm: Message 2.3 arrived. Proxy: Message 3.2 has been retransmitted. Process: Message 1.2 is to be sent. Proxy: Message 1.2 is to be retransmitted. TestForm: Message 2.1 arrived. Proxy: Message 1.2 has been retransmitted. Process: Message 1.2 has been sent. Process: Message 3.2 has been sent. TestForm: Waiting for events, count = 6, timeSpan = 0,5 s... Process: Message 2.3 is to be sent. Proxy: Message 2.3 is to be retransmitted. TestForm: Message 3.2 arrived. Proxy: Message 2.3 has been retransmitted. Process: Message 2.3 has been sent. Process: Message 1.3 is to be sent. Proxy: Message 1.3 is to be retransmitted. TestForm: Message 3.1 arrived. Proxy: Message 1.3 has been retransmitted. Process: Message 1.3 has been sent. Process: Message 3.3 is to be sent. Proxy: Message 3.3 is to be retransmitted. TestForm: Message 3.3 arrived. Proxy: Message 3.3 has been retransmitted. Process: Message 3.3 has been sent. TestForm: Waiting for events, count = 9, timeSpan = 0,75 s... Press any key to continue . . . -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, July 27, 2007 6:49 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Proxy Class I have a situation where I want to have a generic status form which updates progress information for some very similar processes. In all cases a process class needs to raise events and the events need to be sunk in the progress form. Each event then updates one specific control on the progress form. Events: Current file FileComplete FilesToProcess LinesComplete Status My problem is that AFAIK in order to sink events, an object has to be dimmed WithEvents and the type of object has to be specified. Thus the progress form would have to be told in its header that it was working with a specific class, and thus the progress form is no longer generic. I know that I can not use events and simply have the class open an instance of the progress form directly, and directly manipulate the controls but I would prefer to have a loosely coupled interface in the process class where it can just raise events and if there is anyone who cares, it can process those events. Can I use something like a proxy class where the proxy class knows about process class and retransmits its events. The progress form knows about the proxy class. Thus the progress form is loaded and passed in a proxy class. That proxy class has been defined and hard coded to dim a specific object which sources the events of interest? This seems like an inheritance thing for the proxy class. Design a ProgressProxy class which has code to source specific named events. Create a clsProcessProxy which inherits the ProgressProxy class. In this class hard code the object which is the original event source. Name this object a generic name so that the object itself can be changed, but the event sinks never change and simply then call up to the parent (inherited ProgressProxy) to retransmit the event. clsProcess > clsProcessProxy inherits ProgressProxy > frmProgress (dims a clsProcessProxy and is passed in an instance to set its local copy to) Does any of this make sense? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Fri Jul 27 20:20:14 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Sat, 28 Jul 2007 11:20:14 +1000 Subject: [dba-VB] Odd problem with VB 6 application References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289B06@ddi-01.DDI.local> Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Sat Jul 28 03:47:38 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 28 Jul 2007 03:47:38 -0500 Subject: [dba-VB] Odd problem with VB 6 application In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D01289B06@ddi-01.DDI.local> Message-ID: Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From shamil at users.mns.ru Sat Jul 28 05:29:28 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Sat, 28 Jul 2007 14:29:28 +0400 Subject: [dba-VB] Odd problem with VB 6 application In-Reply-To: Message-ID: <000001c7d102$2d8e9fd0$6401a8c0@nant> <<< You have to disable UAC. Not sure about regserver, but I assume it's the same. >>> Rather smooth workaround is to use INNO-Setup starting latest versions - just make simple installation of your ActiveX using INNO-Setup and you'll get manifest file automatically injected in it and this manifest file will elevate the user privileges on setup and will bypass UAC trouble... Not sure it works that way for very restricted Vista users but for standard non admin users it works that way - tested... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, July 28, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Jul 28 12:51:13 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 28 Jul 2007 13:51:13 -0400 Subject: [dba-VB] VB.Net - Can tables be streams? Message-ID: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> I have a "serializable" class that serializes the data from a form to stream. Currently the stream is written to file. I am wondering if I can write it to a table instead by substituting a different kind of stream? John W. Colby Colby Consulting www.ColbyConsulting.com From shamil at users.mns.ru Sat Jul 28 17:41:19 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Sun, 29 Jul 2007 02:41:19 +0400 Subject: [dba-VB] VB.Net - Can tables be streams? In-Reply-To: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> Message-ID: <000f01c7d168$6a3a0620$6401a8c0@nant> Hello John, You can try to use DataSet's ReadXml method to load a DataSet instance with data, which you can then persist to a table.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, July 28, 2007 9:51 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net - Can tables be streams? I have a "serializable" class that serializes the data from a form to stream. Currently the stream is written to file. I am wondering if I can write it to a table instead by substituting a different kind of stream? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mmattys at rochester.rr.com Sat Jul 28 19:39:23 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sat, 28 Jul 2007 20:39:23 -0400 Subject: [dba-VB] VB.Net - Can tables be streams? References: <000f01c7d168$6a3a0620$6401a8c0@nant> Message-ID: <002201c7d178$ea2cbe30$0202a8c0@Laptop> Reports have been coming in of strange, insane laughter coming from the Colby house ... echoing in the mountains ... Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: Sent: Saturday, July 28, 2007 6:41 PM Subject: Re: [dba-VB] VB.Net - Can tables be streams? > Hello John, > > You can try to use DataSet's ReadXml method to load a DataSet instance > with > data, which you can then persist to a table.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Saturday, July 28, 2007 9:51 PM > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] VB.Net - Can tables be streams? > > I have a "serializable" class that serializes the data from a form to > stream. Currently the stream is written to file. I am wondering if I can > write it to a table instead by substituting a different kind of stream? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com From thewaddles at sbcglobal.net Sat Jul 28 19:40:18 2007 From: thewaddles at sbcglobal.net (Kevin Waddle) Date: Sat, 28 Jul 2007 17:40:18 -0700 Subject: [dba-VB] VB6 Datarepeater Code In-Reply-To: <000f01c7d168$6a3a0620$6401a8c0@nant> References: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> <000f01c7d168$6a3a0620$6401a8c0@nant> Message-ID: <001301c7d179$0a09c950$6600a8c0@TheWaddles> Hello, I am trying to recreate an Access continuous form in a VB6 exe using the datarepeater control. I have created a ActiveX control containing a TextBox and a CheckBox. These are bound to an Access mdb file. I can display and update the textbox but cannot get anything to display properly on the checkboxes. The control will display the checkbox as true only when the record is active. Does anyone have an example using the datarepeater control with a checkbox or another avenue to create a continuous form in VB6? Thank you, Kevin Chocolate moose: 1 medium size moose, 20 pounds chocolate. From mmattys at rochester.rr.com Sat Jul 28 19:54:24 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sat, 28 Jul 2007 20:54:24 -0400 Subject: [dba-VB] VB6 Datarepeater Code References: <20070728175114.3C2CEBCAE@smtp-auth.no-ip.com> <000f01c7d168$6a3a0620$6401a8c0@nant> <001301c7d179$0a09c950$6600a8c0@TheWaddles> Message-ID: <003501c7d17b$060daa90$0202a8c0@Laptop> Kevin, I haven't an example, but maybe KB Article 197428 will help? http://support.microsoft.com/kb/197428 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Kevin Waddle" To: Sent: Saturday, July 28, 2007 8:40 PM Subject: [dba-VB] VB6 Datarepeater Code > Hello, > > I am trying to recreate an Access continuous form in a VB6 exe using the > datarepeater control. > > I have created a ActiveX control containing a TextBox and a CheckBox. > These are bound to an Access mdb file. > I can display and update the textbox but cannot get anything to display > properly on the checkboxes. > > The control will display the checkbox as true only when the record is > active. > > Does anyone have an example using the datarepeater control with a checkbox > or another avenue to create a continuous form in VB6? > > Thank you, > Kevin > > > Chocolate moose: 1 medium size moose, 20 pounds chocolate. > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com From michael at ddisolutions.com.au Sun Jul 29 19:10:45 2007 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 30 Jul 2007 10:10:45 +1000 Subject: [dba-VB] Odd problem with VB 6 application References: <000001c7d102$2d8e9fd0$6401a8c0@nant> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01289B07@ddi-01.DDI.local> Yeah I also use Inno for all VB6 deployments, or I used to. Most new projects are in .net these days. However I have to maintain a lot of VB6 code. I don't really want to do a full install for each minor change to a dll, know what I mean? I guess with Vista I wont have a choice. cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Saturday, 28 July 2007 8:29 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application <<< You have to disable UAC. Not sure about regserver, but I assume it's the same. >>> Rather smooth workaround is to use INNO-Setup starting latest versions - just make simple installation of your ActiveX using INNO-Setup and you'll get manifest file automatically injected in it and this manifest file will elevate the user privileges on setup and will bypass UAC trouble... Not sure it works that way for very restricted Vista users but for standard non admin users it works that way - tested... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, July 28, 2007 12:48 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Ya, I'm just dying to start using Vista! When will people learn that the tighter the security, the less user friendly it is! ;) Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Friday, July 27, 2007 8:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Odd problem with VB 6 application Hi Drew, Interesting. I only use early binding so the exe must be registered anyway. However I ran into a situation a few weeks ago in a TS environment (2003 or 2K I don't remember) where I had released an update of the ax.exe and after the client copied the exe to the server somehow the registry entry was set in such a way that only he could run the ax.exe! He says he can't remember what he did ;-/ Normally, unless I break compatability (stuff happens), just copying the new ax.exe is enough. BTW, just wait till your users move to Vista. Regsvr32 will not run by default even when you are logged on as local admin... ;-) You have to disable UAC. Not sure about regserver, but I assume it's the same. cheers Michael M To: dba-vb at databaseadvisors.com Subject: [dba-VB] Odd problem with VB 6 application This is just an FYI to the VB list. A week ago I made a modification to a system I've been working on called the ISFE. The ISFE was monitoring for new requests and a few other things, but that background process was slowing the interface down a bit. The modification I made took those processes and put it in another .exe (and the two talk through window messages, something I posted on the AccessD list). Anyhow, a few days ago, someone submitted a request saying they were getting the following error message 'Unexpected Application Error; quitting'. Here's what caused the problem. The new 'monitor' application was setup as an ActiveX .exe, because I created a generic 'event' class that each monitor event was built on (implemented). The main application tells the monitor application what monitors to start (based on the users role) by sending the class name. The monitor application then used CreateObject with that string. Can only do that in an ActiveX .exe. Turns out, however, that a standard User in a 2000 or later environment cannot start an ActiveX .exe for the first time, because the ActiveX .exe tries to register itself, and users with the basic User permissions don't have the ability to do so. If a power user or admin runs the program first, then the users can run it...go figure. Just figured I'd pass this along in case anyone else is using VB 6 still. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 09:03:56 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 10:03:56 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code Message-ID: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Mon Jul 30 10:49:04 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 08:49:04 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> References: <20070730140402.49F7FBD39@smtp-auth.no-ip.com> Message-ID: Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 11:04:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 12:04:22 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730160428.2B49BBCC8@smtp-auth.no-ip.com> LOL. Uhh.... Yea, sure... ;-) John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Jul 30 11:44:53 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 12:44:53 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Mon Jul 30 12:03:28 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 10:03:28 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> References: <20070730164459.25D59BDEB@smtp-auth.no-ip.com> Message-ID: No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 Mon Jul 30 12:12:29 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 30 Jul 2007 13:12:29 -0400 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: Message-ID: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> Well... That is pretty hard to say but I think so. I pretty much just choose the defaults. I read somewhere that there can be issues caused by copying files from one computer to another. Something about the security kicking in because Windows XP marks the files as "coming from" a specific computer and now it is not being run on that computer. I have to wonder if it is related to that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 1:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 cfoust at infostatsystems.com Mon Jul 30 13:08:12 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 30 Jul 2007 11:08:12 -0700 Subject: [dba-VB] VB.Net / VS - Can't step code In-Reply-To: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> References: <20070730171235.0BBCDBD39@smtp-auth.no-ip.com> Message-ID: Don't know. We use source safe, so all our files get copied from the same location to the local drive. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 10:12 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Well... That is pretty hard to say but I think so. I pretty much just choose the defaults. I read somewhere that there can be issues caused by copying files from one computer to another. Something about the security kicking in because Windows XP marks the files as "coming from" a specific computer and now it is not being run on that computer. I have to wonder if it is related to that. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 1:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code No, I meant the installation itself, same languages, same preferences, same properties. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 9:45 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code In fact no. On the laptop the projects directory is under My Documents\visual studio 2005. On the desktop it is under E:\VisualStudio2005. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 30, 2007 11:49 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net / VS - Can't step code Do you have VS set up exactly the same on both machines? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, July 30, 2007 7:04 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net / VS - Can't step code I wrote a project in VS on my laptop. I then transferred the entire project over to my desktop and am trying to run / develop from there. The single step is not working on the desktop where it does on the laptop. Has anyone ever seen this? John W. Colby Colby Consulting 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 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com