From newsgrps at dalyn.co.nz Thu Nov 1 12:10:52 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 02 Nov 2007 06:10:52 +1300 Subject: [dba-VB] Web Developer wanted VB Dot Net Message-ID: <20071101170935.GIOL18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Group, I have had one response to my previous message, but the company I am working for would like a few options. If anyone else is interested please email me off line. I have an access program that has been converted to a Web site written using Visual Studio 2003 and VB.Net. The conversion was done by another developer as a favour for the company that owns the software. We are now looking for a web developer that can do the following: 1) Continue to maintain the web version. This should be basic maintenance of the screens. The database is SQL2000 and I can maintain this. The reports are developed using DataDynamics Active Report. I can also maintain these. What I can't do is the actual web site maintenance. Medium term we would be looking to upgrade this to Visual Studio 2005. 2) The company has another project that they want converted from a desk top version to the web. This project would involve interaction with the developer of the desk top version - he is also not familiar with web development. This would be a major project. 3) There would be other web projects that would come up as well. Based on my previous experience with this company, there would be ongoing work required on a regular basis. The company that we would be working for is based in Chicago. However, I have been developing for them for over 10 years and I am in NZ. If you are interested in more information please email me off line with a phone number and a suitable time to call (preferably your afternoon if you are in America due to the time difference) Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From jwcolby at colbyconsulting.com Tue Nov 13 06:42:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 07:42:30 -0500 Subject: [dba-VB] Iterating class properties Message-ID: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Nov 13 07:34:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 08:34:22 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: <00e701c825f9$e75ff890$6c7aa8c0@M90> In answer to my own question, I found this... http://articles.techrepublic.com.com/5100-22-1050654.html#comments It could be very useful in some circumstances. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Nov 13 07:54:18 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 08:54:18 -0500 Subject: [dba-VB] SP to create C# classes Message-ID: <00e901c825fc$b018f0f0$6c7aa8c0@M90> I ran across this this morning. http://www.sqlservercentral.com/scripts/Miscellaneous/31997/ I have not tested it yet but thought that someone might find it useful. John W. Colby Colby Consulting www.ColbyConsulting.com From dwaters at usinternet.com Tue Nov 13 09:07:21 2007 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 13 Nov 2007 09:07:21 -0600 Subject: [dba-VB] VB.Net / C# Guidelines Message-ID: <001f01c82606$e454ef90$0200a8c0@danwaters> VB City is offering a free download (100 pages) of coding guidelines. http://submain.com/?nav=products.guidelines From mmattys at rochester.rr.com Tue Nov 13 09:16:34 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Tue, 13 Nov 2007 10:16:34 -0500 Subject: [dba-VB] VB.Net / C# Guidelines References: <001f01c82606$e454ef90$0200a8c0@danwaters> Message-ID: <008b01c82608$2e9b6970$0202a8c0@Laptop> Hi Dan, Thanks. I'm planning on buying VS 2008 when it comes out. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Dan Waters" To: Sent: Tuesday, November 13, 2007 10:07 AM Subject: [dba-VB] VB.Net / C# Guidelines > VB City is offering a free download (100 pages) of coding guidelines. > > http://submain.com/?nav=products.guidelines > > > > > > _______________________________________________ > 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 Tue Nov 13 09:38:31 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Nov 2007 07:38:31 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: What exactly are you trying to do, John? A tool like CodeGen should take care of creating the XML for you, but I don't really understand your question. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 4:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Tue Nov 13 10:54:54 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 13 Nov 2007 10:54:54 -0600 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 jwcolby at colbyconsulting.com Tue Nov 13 11:14:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 12:14:25 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: <000d01c82618$a4be3aa0$6c7aa8c0@M90> Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ 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 Tue Nov 13 11:24:31 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Nov 2007 09:24:31 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: <000d01c82618$a4be3aa0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> <000d01c82618$a4be3aa0$6c7aa8c0@M90> Message-ID: John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 Nov 13 11:46:12 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 12:46:12 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: References: <00e301c825f2$a8d035b0$6c7aa8c0@M90><000d01c82618$a4be3aa0$6c7aa8c0@M90> Message-ID: <001301c8261d$15602a30$6c7aa8c0@M90> Well, I asked you this question earlier and didn't really receive a usable response. If I have a class and want to persist it to a table, how do I do so? I can persist it to an XML file, though even there I still do not know how to get the data type tags to embed in the XML file. So to persist a class to a table I would have to persist it to an XML file, discover how to write the data type tags out to the XML file, then read the data back in to SQL Server. Why would I do that if I could read the class properties and data types directly then use a data adapter or write SQL to build the table. In fact I got so far as to export to XML and then pull back in to a data adapter but the adapter threw an error when I tried to save to SQL Server because the table did not already exist. Even in this case I was missing the data type information because no one could point me to how to export the data type to XML as well. I am importing files from CSV and flat files. In many cases I get a "spec" that tells me the field names and values, but in some cases I don't even get that, just the name and "starts at / ends at" (fixed width files). People throw anything into these files and it is my job to recover the data. John W. Colby 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: Tuesday, November 13, 2007 12:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 Tue Nov 13 12:53:26 2007 From: ebarro at verizon.net (Eric Barro) Date: Tue, 13 Nov 2007 10:53:26 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: Message-ID: <0JRG0046HKH2IFD3@vms040.mailsrvcs.net> .NET handles this well Drew. In VB Dim wd as Widget = New Widget() Wd.Height = 10 In C# Widet wd = new Widget(); Wd.Height = 10; -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 8:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ From DWUTKA at Marlow.com Tue Nov 13 14:13:50 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 13 Nov 2007 14:13:50 -0600 Subject: [dba-VB] Iterating class properties In-Reply-To: <0JRG0046HKH2IFD3@vms040.mailsrvcs.net> Message-ID: Ummmmm, not what I was saying. In VB 6, with my classes property, I can go: Wd.Height or wd.Properties("Height") Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Tuesday, November 13, 2007 12:53 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties .NET handles this well Drew. In VB Dim wd as Widget = New Widget() Wd.Height = 10 In C# Widet wd = new Widget(); Wd.Height = 10; -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 8:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Tue Nov 13 14:53:39 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 13 Nov 2007 23:53:39 +0300 Subject: [dba-VB] Iterating class properties In-Reply-To: <001301c8261d$15602a30$6c7aa8c0@M90> Message-ID: <000601c82637$44ca1410$6401a8c0@nant> Hello John, The answer is System.Reflection namespace: Imports System.Reflection Module Module1 Public Class Test Public ReadOnly Property One() As String Get Return "test" End Get End Property Private _prp2 As String Public WriteOnly Property Two() As String Set(ByVal value As String) _prp2 = value End Set End Property Public ReadOnly Property Three() As Double Get Return One + _prp2 End Get End Property End Class Sub Main() Dim a As Assembly = System.Reflection.Assembly.GetExecutingAssembly() For Each t As Type In _ System.Reflection.Assembly.GetExecutingAssembly().GetTypes() If t.ToString.EndsWith("Test") Then Console.WriteLine(t.ToString()) For Each m As MemberInfo In t.GetMembers() If m.MemberType = MemberTypes.Property Then Console.WriteLine(" " + m.Name) End If Next End If Next End Sub End Module HTH. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 8:46 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Well, I asked you this question earlier and didn't really receive a usable response. If I have a class and want to persist it to a table, how do I do so? I can persist it to an XML file, though even there I still do not know how to get the data type tags to embed in the XML file. So to persist a class to a table I would have to persist it to an XML file, discover how to write the data type tags out to the XML file, then read the data back in to SQL Server. Why would I do that if I could read the class properties and data types directly then use a data adapter or write SQL to build the table. In fact I got so far as to export to XML and then pull back in to a data adapter but the adapter threw an error when I tried to save to SQL Server because the table did not already exist. Even in this case I was missing the data type information because no one could point me to how to export the data type to XML as well. I am importing files from CSV and flat files. In many cases I get a "spec" that tells me the field names and values, but in some cases I don't even get that, just the name and "starts at / ends at" (fixed width files). People throw anything into these files and it is my job to recover the data. John W. Colby 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: Tuesday, November 13, 2007 12:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Nov 19 13:29:13 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 19 Nov 2007 14:29:13 -0500 Subject: [dba-VB] Action Pack Subscribers Message-ID: <00d101c82ae2$784fcb90$6c7aa8c0@M90> For those of you doing Web stuff I just found this: https://partner.microsoft.com/us/40047166 John W. Colby Colby Consulting www.ColbyConsulting.com From carbonnb at gmail.com Wed Nov 21 07:02:59 2007 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Wed, 21 Nov 2007 08:02:59 -0500 Subject: [dba-VB] Download VS2008 Express Editions Message-ID: Here is a link to let you download the new VS 2008 Express editions from MS. http://www.microsoft.com/express/download/ Currently the following versions are available: VB 2008 Web Developer 2008 C# 2008 C++ 2008 SQL Server 2005, but apparently it will be updated to SQL Server 2008 when it's available. Now all I gotta do is find the time to learn it :( -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From wdhindman at dejpolsystems.com Wed Nov 21 10:33:50 2007 From: wdhindman at dejpolsystems.com (William Hindman) Date: Wed, 21 Nov 2007 11:33:50 -0500 Subject: [dba-VB] Download VS2008 Express Editions References: Message-ID: <000f01c82c5c$4c799930$ef706c4c@jisshowsbs.local> ...I've spent all morning installing, configuring, and getting my feet wet in vswd'8 ...love it so far ...I dl'd the iso image with all of the editions and burned a cd ...have to take a look at the vb and c# versions this weekend. William ----- Original Message ----- From: "Bryan Carbonnell" To: Sent: Wednesday, November 21, 2007 8:02 AM Subject: [dba-VB] Download VS2008 Express Editions > Here is a link to let you download the new VS 2008 Express editions from > MS. > > http://www.microsoft.com/express/download/ > > Currently the following versions are available: > VB 2008 > Web Developer 2008 > C# 2008 > C++ 2008 > SQL Server 2005, but apparently it will be updated to SQL Server 2008 > when it's available. > > Now all I gotta do is find the time to learn it :( > > -- > Bryan Carbonnell - carbonnb at gmail.com > Life's journey is not to arrive at the grave safely in a well > preserved body, but rather to skid in sideways, totally worn out, > shouting "What a great ride!" > _______________________________________________ > 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 Sun Nov 25 23:14:39 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 26 Nov 2007 18:14:39 +1300 Subject: [dba-VB] Open PDF file Message-ID: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Mon Nov 26 07:43:24 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 14:43:24 +0100 Subject: [dba-VB] Open PDF file Message-ID: Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Mon Nov 26 07:52:13 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 14:52:13 +0100 Subject: [dba-VB] Launch and monitor external programs from .NET (was: Open PDF file) Message-ID: Hi David et al A lot of useful things can be done with the Process class. Some examples here: http://www.thescarms.com/dotnet/Process.aspx /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From JHewson at karta.com Mon Nov 26 08:37:38 2007 From: JHewson at karta.com (Jim Hewson) Date: Mon, 26 Nov 2007 08:37:38 -0600 Subject: [dba-VB] Open PDF file References: Message-ID: <1C877227AE9F2A4BB20BABE94325D15B03017A@exchange.Karta.com> Doesn't the PDF reader need to be on the user's machine? How does this open a file on a server so the user, presumably somewhere else, open the file and review it? I thought the user must have Adobe reader on their machine. Jim jhewson at karta.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, November 26, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Open PDF file Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? 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 From Gustav at cactus.dk Mon Nov 26 08:48:15 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 15:48:15 +0100 Subject: [dba-VB] Open PDF file Message-ID: Hi Jim You may be right - I didn't read the question in full, I can see now, sorry. However, there seems to be some misunderstanding ... the user's browser can open an pdf file if the Adobe Reader add-in is installed, but the file is downloaded from the web server; as far as I know, the server can not "display" an pdf file, only pass it on. /gustav >>> JHewson at karta.com 26-11-2007 15:37 >>> Doesn't the PDF reader need to be on the user's machine? How does this open a file on a server so the user, presumably somewhere else, open the file and review it? I thought the user must have Adobe reader on their machine. Jim jhewson at karta.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, November 26, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Open PDF file Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From James at fcidms.com Mon Nov 26 10:30:30 2007 From: James at fcidms.com (James Barash) Date: Mon, 26 Nov 2007 11:30:30 -0500 Subject: [dba-VB] Open PDF file In-Reply-To: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <01d201c83049$a95699f0$800101df@fci.local> David: How are you displaying the list of files? I do something similar using an ASP.Net table and adding the filenames as cells with a hyperlink to the appropiate file on the server. It is the client that needs to have Adobe installed, not the server since it is the client that renders the file. Below is the code. It loops through all the files in a specified directory. For each file you create a new row in the table, create a new cell, set the cell text to a clickable hyperlink to the appropriate file and add the row to the ASP.net table. The directories are all relative to the root directory of the website. The pfd files open in a new browser window. If the client does not have Adobe installed, they should get the option of saving the file locally. Hope this helps. James Barash Dim root As String = Server.MapPath(".") & "/" & strDir Dim files() As String files = System.IO.Directory.GetFiles(root, "*") Dim strFilename As String, f as String Table1.Rows.Clear() For Each f In files strFilename = System.IO.Path.GetFileName(f) row = New Web.UI.WebControls.TableRow cell = New Web.UI.WebControls.TableCell cell.Text = "" & strFilename & "" row.Cells.Add(cell) Table1.Rows.Add(row) Next f -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Monday, November 26, 2007 12:15 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Open PDF file I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? 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 From newsgrps at dalyn.co.nz Mon Nov 26 11:27:25 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 27 Nov 2007 06:27:25 +1300 Subject: [dba-VB] Open PDF file In-Reply-To: <01d201c83049$a95699f0$800101df@fci.local> References: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> <01d201c83049$a95699f0$800101df@fci.local> Message-ID: <20071126172524.XYLE18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks all for the responses - I will start looking at them today. Sorry about the confusion - The users open the PDF files on their own computers, not the server. James, to answer your question below, another developer has written the web pages (as part of a larger application) which take a list of records from a table and produces a page which has all the reports available with check boxes beside them. Most of the reports are created from Active Reports (a report add on to Dot Net - it has a very similar graphic interface for developing to Access). When the user has selected the reports they want then a list of ID's is sent to my web application which loops through the ID's, gets the report details (file location, type etc) and merges them together into one PDF for the users to save etc (the Active Report report files can be merged together and exported as PDF's). Because several reports are merged together (and this depends on the user selection) hyperlinks would not work in this case. However, some "reports" are already PDF's and they would be opened as separate files (not merged in with the other reports). These are the ones I am wanting to show in a different browser window. Regards David At 27/11/2007, you wrote: >David: > >How are you displaying the list of files? I do something similar using an >ASP.Net table and adding the filenames as cells with a hyperlink to the >appropiate file on the server. It is the client that needs to have Adobe >installed, not the server since it is the client that renders the file. >Below is the code. It loops through all the files in a specified directory. >For each file you create a new row in the table, create a new cell, set the >cell text to a clickable hyperlink to the appropriate file and add the row >to the ASP.net table. The directories are all relative to the root directory >of the website. The pfd files open in a new browser window. If the client >does not have Adobe installed, they should get the option of saving the file >locally. > >Hope this helps. > >James Barash > >Dim root As String = Server.MapPath(".") & "/" & strDir >Dim files() As String >files = System.IO.Directory.GetFiles(root, "*") >Dim strFilename As String, f as String >Table1.Rows.Clear() >For Each f In files >strFilename = System.IO.Path.GetFileName(f) >row = New Web.UI.WebControls.TableRow >cell = New Web.UI.WebControls.TableCell >cell.Text = "target=""_blank"" >" & strFilename & "" >row.Cells.Add(cell) >Table1.Rows.Add(row) >Next f > > > > >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson >Sent: Monday, November 26, 2007 12:15 AM >To: dba-vb at databaseadvisors.com >Subject: [dba-VB] Open PDF file > >I am using VS 2005 and VB.Net for a web site. > >I have a number of PDF files that are stored in a static folder on the >server. > >Users select from a list on files on a web page and I want to open >the files in Adobe. Adobe reader is installed on the server. > >Can anyone give me a pointer to how I can take a string with path and >file name, and open it? > >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 > >_______________________________________________ >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 Nov 30 11:43:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 12:43:32 -0500 Subject: [dba-VB] SQLBulkCopy error Message-ID: <001e01c83378$8743d1c0$647aa8c0@M90> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? John W. Colby Colby Consulting www.ColbyConsulting.com From Gustav at cactus.dk Fri Nov 30 12:02:47 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 Nov 2007 19:02:47 +0100 Subject: [dba-VB] SQLBulkCopy error Message-ID: Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Nov 30 12:08:38 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 10:08:38 -0800 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: References: Message-ID: Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 Nov 30 12:43:33 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:43:33 -0500 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: References: Message-ID: <002201c83380$e9a58b30$647aa8c0@M90> That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 Nov 30 12:46:21 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:46:21 -0500 Subject: [dba-VB] VS keyboard Message-ID: <002301c83381$4d9642b0$647aa8c0@M90> I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 30 12:51:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:51:25 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: <002301c83381$4d9642b0$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> Message-ID: <002401c83382$0283db60$647aa8c0@M90> Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? 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 garykjos at gmail.com Fri Nov 30 12:56:04 2007 From: garykjos at gmail.com (Gary Kjos) Date: Fri, 30 Nov 2007 12:56:04 -0600 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: Well you have to give us more time than that. Only 5 minutes between question and "I found it myself"? GK On 11/30/07, jwcolby wrote: > Found this one. Boy was that buried... > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.com From carbonnb at gmail.com Fri Nov 30 13:03:23 2007 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Fri, 30 Nov 2007 14:03:23 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: On Nov 30, 2007 1:51 PM, jwcolby wrote: > Found this one. Boy was that buried... Hows about letting us know what it is. For the archive doncha know :) -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From cfoust at infostatsystems.com Fri Nov 30 13:03:02 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 11:03:02 -0800 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: I take it you found File-->Options-->Environment-->Keyboard and discovered the keyboard mapping on the two machines was different? Or was it some other solution? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:51 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 30 13:04:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:04:15 -0500 Subject: [dba-VB] Weird table name restriction Message-ID: <002501c83383$cde18360$647aa8c0@M90> I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Nov 30 13:11:20 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 11:11:20 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <002501c83383$cde18360$647aa8c0@M90> References: <002501c83383$cde18360$647aa8c0@M90> Message-ID: Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Nov 30 13:12:08 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:12:08 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002601c83384$e7e037b0$647aa8c0@M90> Yea, I apologize. I know that there is so much setup stuff that I could well have searched for an hour before finding it. In fact I missed it on my first pass. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Friday, November 30, 2007 1:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Well you have to give us more time than that. Only 5 minutes between question and "I found it myself"? GK On 11/30/07, jwcolby wrote: > Found this one. Boy was that buried... > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.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 Fri Nov 30 13:13:12 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 30 Nov 2007 11:13:12 -0800 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: <002201c83380$e9a58b30$647aa8c0@M90> Message-ID: <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> Check that the Windows account you are using has the correct security privileges. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date: 11/29/2007 8:32 PM From jwcolby at colbyconsulting.com Fri Nov 30 13:18:02 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:18:02 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002a01c83385$bb826110$647aa8c0@M90> In the editor... Tools / Options Check the "show all options" check box in the lower left. Expand environment Keyboard Visual Basic 6 from the combo at the top. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell Sent: Friday, November 30, 2007 2:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard On Nov 30, 2007 1:51 PM, jwcolby wrote: > Found this one. Boy was that buried... Hows about letting us know what it is. For the archive doncha know :) -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" _______________________________________________ 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 Nov 30 13:18:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:18:23 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002b01c83385$c758c650$647aa8c0@M90> That was it. John W. Colby 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, November 30, 2007 2:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard I take it you found File-->Options-->Environment-->Keyboard and discovered the keyboard mapping on the two machines was different? Or was it some other solution? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:51 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? 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 Nov 30 13:21:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:21:32 -0500 Subject: [dba-VB] Weird table name restriction In-Reply-To: References: <002501c83383$cde18360$647aa8c0@M90> Message-ID: <002c01c83386$37c8f450$647aa8c0@M90> The problem is that they are fine (as are spaces) in file names... I am doing a "copy file to temp table, copy temp to permanent". Thus the temp table name is just the file name. I discussed awhile back that I got an "in" or something similar as a file name, which collided with a reserve word. kind of the same issue only different. What a PITA. Keeps me searching for answers long after this thing should just 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 Charlotte Foust Sent: Friday, November 30, 2007 2:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Nov 30 13:22:06 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:22:06 -0500 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> References: <002201c83380$e9a58b30$647aa8c0@M90> <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> Message-ID: <002d01c83386$4c489ac0$647aa8c0@M90> Hmm... well the bulkcopy itself works fine if I remove the provider keyword. John W. Colby 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, November 30, 2007 2:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Check that the Windows account you are using has the correct security privileges. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date: 11/29/2007 8:32 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 Nov 30 13:31:14 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:31:14 -0500 Subject: [dba-VB] Weird table name restriction In-Reply-To: <002c01c83386$37c8f450$647aa8c0@M90> References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> Message-ID: <002e01c83387$92cbcb10$647aa8c0@M90> The strange part is that the code to create the table worked just fine, the table was there. The bulkinsert function just couldn't use it. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 2:22 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction The problem is that they are fine (as are spaces) in file names... I am doing a "copy file to temp table, copy temp to permanent". Thus the temp table name is just the file name. I discussed awhile back that I got an "in" or something similar as a file name, which collided with a reserve word. kind of the same issue only different. What a PITA. Keeps me searching for answers long after this thing should just 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 Charlotte Foust Sent: Friday, November 30, 2007 2:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Fri Nov 30 13:43:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:43:30 -0500 Subject: [dba-VB] Reserved words Message-ID: <002f01c83389$497a0a10$647aa8c0@M90> Does anyone know if the reserved words in SQL Server (can't be used in table names etc) are in a table anywhere (in sql server)? I have code that builds tables and it really needs to check the proposed table name to make sure that the name isn't a reserved word, and that it does not have special characters. I have had TWO times now where I was hunting down errors caused by issues with what is valid in a table name. I could build a table of reserved words but if any new ones are added my list would be short. John W. Colby Colby Consulting www.ColbyConsulting.com From ssharkins at gmail.com Fri Nov 30 14:04:12 2007 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 30 Nov 2007 15:04:12 -0500 Subject: [dba-VB] Reserved words References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: <006401c8338c$340574f0$4b3a8343@SusanOne> http://msdn2.microsoft.com/en-us/library/ms189822.aspx I don't know how comprehensive it is though Susan H. > Does anyone know if the reserved words in SQL Server (can't be used in > table > names etc) are in a table anywhere (in sql server)? I have code that > builds > tables and it really needs to check the proposed table name to make sure > that the name isn't a reserved word, and that it does not have special > characters. I have had TWO times now where I was hunting down errors > caused > by issues with what is valid in a table name. > > I could build a table of reserved words but if any new ones are added my > list would be short. > > 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 ridermark at gmail.com Fri Nov 30 14:06:39 2007 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 Nov 2007 14:06:39 -0600 Subject: [dba-VB] Reserved words In-Reply-To: <002f01c83389$497a0a10$647aa8c0@M90> References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: I have used brackets or/and a prefix to get around this issue. I deal with stocks and to have a table named ASK is not possible, but tblASK or [ASK] works. I prefer the tbl prefix since it is easy to prepend it to the proposed name. On Nov 30, 2007 1:43 PM, jwcolby wrote: > Does anyone know if the reserved words in SQL Server (can't be used in > table > names etc) are in a table anywhere (in sql server)? I have code that > builds > tables and it really needs to check the proposed table name to make sure > that the name isn't a reserved word, and that it does not have special > characters. I have had TWO times now where I was hunting down errors > caused > by issues with what is valid in a table name. > > I could build a table of reserved words but if any new ones are added my > list would be short. > > 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 > > -- Mark Rider http://commonsensesecurity.info Try to learn something about everything and everything about something. - Thomas H. Huxley From ridermark at gmail.com Fri Nov 30 14:08:15 2007 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 Nov 2007 14:08:15 -0600 Subject: [dba-VB] Reserved words In-Reply-To: References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: Spell check did a number on that - it is supposed to be ASC, not ASK. On Nov 30, 2007 2:06 PM, Mark Rider wrote: > I have used brackets or/and a prefix to get around this issue. I deal > with stocks and to have a table named ASK is not possible, but tblASK or > [ASK] works. I prefer the tbl prefix since it is easy to prepend it to the > proposed name. > > -- Mark Rider http://commonsensesecurity.info Try to learn something about everything and everything about something. - Thomas H. Huxley From robert at webedb.com Fri Nov 30 14:22:16 2007 From: robert at webedb.com (Robert L. Stewart) Date: Fri, 30 Nov 2007 14:22:16 -0600 Subject: [dba-VB] Weird table name restriction In-Reply-To: References: Message-ID: <200711302023.lAUKNhnG027841@databaseadvisors.com> John, Use [] around the name and you can use special characters. Robert At 01:13 PM 11/30/2007, you wrote: >Date: Fri, 30 Nov 2007 14:04:15 -0500 >From: "jwcolby" >Subject: [dba-VB] Weird table name restriction >To: , > >Message-ID: <002501c83383$cde18360$647aa8c0 at M90> >Content-Type: text/plain; charset="US-ASCII" > >I just discovered that SQL Server (or VB.Net) does not like dashes in table >names. > >If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an >error "can't access destination table" but if I remove the dash "ZIP4AA_X" >it works just fine. > >The problem is that I take the name of the datafile, strip off the extension >and use that as my table name. Thus I now have to start doing edits of the >file name before I can use it as a field name. > >The hoops we have to jump through... > >John W. Colby >Colby Consulting >www.ColbyConsulting.com From wdhindman at dejpolsystems.com Fri Nov 30 18:30:48 2007 From: wdhindman at dejpolsystems.com (William Hindman) Date: Fri, 30 Nov 2007 19:30:48 -0500 Subject: [dba-VB] Weird table name restriction References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> Message-ID: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> "What a PITA. Keeps me searching for answers long after this thing should just work." jc ...my life as a developer :( William ----- Original Message ----- From: "jwcolby" To: Sent: Friday, November 30, 2007 2:21 PM Subject: Re: [dba-VB] Weird table name restriction > The problem is that they are fine (as are spaces) in file names... > > I am doing a "copy file to temp table, copy temp to permanent". Thus the > temp table name is just the file name. I discussed awhile back that I got > an "in" or something similar as a file name, which collided with a reserve > word. kind of the same issue only different. > > What a PITA. Keeps me searching for answers long after this thing should > just 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 Charlotte Foust > Sent: Friday, November 30, 2007 2:11 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Weird table name restriction > > Yep, dashes are as bad as spaces. ;-} > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, November 30, 2007 11:04 AM > To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com > Subject: [dba-VB] Weird table name restriction > > I just discovered that SQL Server (or VB.Net) does not like dashes in > table > names. > > If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an > error "can't access destination table" but if I remove the dash "ZIP4AA_X" > it works just fine. > > The problem is that I take the name of the datafile, strip off the > extension > and use that as my table name. Thus I now have to start doing edits of > the > file name before I can use it as a field name. > > The hoops we have to jump through... > > 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 cfoust at infostatsystems.com Fri Nov 30 18:45:10 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 16:45:10 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> References: <002501c83383$cde18360$647aa8c0@M90><002c01c83386$37c8f450$647aa8c0@M90> <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: Right! Those pesky, literal-minded computers! They insist on doing what I tell them instead of what I WANT. LOL Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of William Hindman Sent: Friday, November 30, 2007 4:31 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction "What a PITA. Keeps me searching for answers long after this thing should just work." jc ...my life as a developer :( William ----- Original Message ----- From: "jwcolby" To: Sent: Friday, November 30, 2007 2:21 PM Subject: Re: [dba-VB] Weird table name restriction > The problem is that they are fine (as are spaces) in file names... > > I am doing a "copy file to temp table, copy temp to permanent". Thus the > temp table name is just the file name. I discussed awhile back that I got > an "in" or something similar as a file name, which collided with a reserve > word. kind of the same issue only different. > > What a PITA. Keeps me searching for answers long after this thing should > just 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 Charlotte Foust > Sent: Friday, November 30, 2007 2:11 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Weird table name restriction > > Yep, dashes are as bad as spaces. ;-} > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, November 30, 2007 11:04 AM > To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com > Subject: [dba-VB] Weird table name restriction > > I just discovered that SQL Server (or VB.Net) does not like dashes in > table > names. > > If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an > error "can't access destination table" but if I remove the dash "ZIP4AA_X" > it works just fine. > > The problem is that I take the name of the datafile, strip off the > extension > and use that as my table name. Thus I now have to start doing edits of > the > file name before I can use it as a field name. > > The hoops we have to jump through... > > 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 aip2000 at codewords.com Fri Nov 30 18:50:26 2007 From: aip2000 at codewords.com (Bill Klemens) Date: Fri, 30 Nov 2007 16:50:26 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: <4750AFD2.5010006@codewords.com> >> Thus I now have to start doing edits of >> the >> file name before I can use it as a field name. >> >> The hoops we have to jump through... >> >> John W. Colby >> Colby Consulting >> www.ColbyConsulting.com >> If you're using unedited (unsanitized) data to build SQL statements you could put yourself in a bad position. http://xkcd.com/327/ Bill From ssharkins at gmail.com Fri Nov 30 18:50:45 2007 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 30 Nov 2007 19:50:45 -0500 Subject: [dba-VB] Weird table name restriction References: <002501c83383$cde18360$647aa8c0@M90><002c01c83386$37c8f450$647aa8c0@M90><001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: <001401c833b4$365ccb40$4b3a8343@SusanOne> I have always wished for a computer that would do want I expect rather than what I tell it! ;) Ohhhhhhhh, why can't a computer think more like me, more like me, more like me.... Susan H. > Right! Those pesky, literal-minded computers! They insist on doing > what I tell them instead of what I WANT. LOL From jwcolby at colbyconsulting.com Fri Nov 30 23:04:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 1 Dec 2007 00:04:05 -0500 Subject: [dba-VB] Truncate a log file from code Message-ID: <004701c833d7$99526c00$647aa8c0@M90> I am doing an entire directory of files, using SQLBulkCopy to import the text files into a temp table, and from there into a permanent table. The log file is about the same size as the data file. Is it possible to truncate the log file after every file import in order to minimize the disk impact? If so can you point me to example code? John W. Colby Colby Consulting www.ColbyConsulting.com From newsgrps at dalyn.co.nz Thu Nov 1 12:10:52 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 02 Nov 2007 06:10:52 +1300 Subject: [dba-VB] Web Developer wanted VB Dot Net Message-ID: <20071101170935.GIOL18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Group, I have had one response to my previous message, but the company I am working for would like a few options. If anyone else is interested please email me off line. I have an access program that has been converted to a Web site written using Visual Studio 2003 and VB.Net. The conversion was done by another developer as a favour for the company that owns the software. We are now looking for a web developer that can do the following: 1) Continue to maintain the web version. This should be basic maintenance of the screens. The database is SQL2000 and I can maintain this. The reports are developed using DataDynamics Active Report. I can also maintain these. What I can't do is the actual web site maintenance. Medium term we would be looking to upgrade this to Visual Studio 2005. 2) The company has another project that they want converted from a desk top version to the web. This project would involve interaction with the developer of the desk top version - he is also not familiar with web development. This would be a major project. 3) There would be other web projects that would come up as well. Based on my previous experience with this company, there would be ongoing work required on a regular basis. The company that we would be working for is based in Chicago. However, I have been developing for them for over 10 years and I am in NZ. If you are interested in more information please email me off line with a phone number and a suitable time to call (preferably your afternoon if you are in America due to the time difference) Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From jwcolby at colbyconsulting.com Tue Nov 13 06:42:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 07:42:30 -0500 Subject: [dba-VB] Iterating class properties Message-ID: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Nov 13 07:34:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 08:34:22 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: <00e701c825f9$e75ff890$6c7aa8c0@M90> In answer to my own question, I found this... http://articles.techrepublic.com.com/5100-22-1050654.html#comments It could be very useful in some circumstances. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Nov 13 07:54:18 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 08:54:18 -0500 Subject: [dba-VB] SP to create C# classes Message-ID: <00e901c825fc$b018f0f0$6c7aa8c0@M90> I ran across this this morning. http://www.sqlservercentral.com/scripts/Miscellaneous/31997/ I have not tested it yet but thought that someone might find it useful. John W. Colby Colby Consulting www.ColbyConsulting.com From dwaters at usinternet.com Tue Nov 13 09:07:21 2007 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 13 Nov 2007 09:07:21 -0600 Subject: [dba-VB] VB.Net / C# Guidelines Message-ID: <001f01c82606$e454ef90$0200a8c0@danwaters> VB City is offering a free download (100 pages) of coding guidelines. http://submain.com/?nav=products.guidelines From mmattys at rochester.rr.com Tue Nov 13 09:16:34 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Tue, 13 Nov 2007 10:16:34 -0500 Subject: [dba-VB] VB.Net / C# Guidelines References: <001f01c82606$e454ef90$0200a8c0@danwaters> Message-ID: <008b01c82608$2e9b6970$0202a8c0@Laptop> Hi Dan, Thanks. I'm planning on buying VS 2008 when it comes out. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Dan Waters" To: Sent: Tuesday, November 13, 2007 10:07 AM Subject: [dba-VB] VB.Net / C# Guidelines > VB City is offering a free download (100 pages) of coding guidelines. > > http://submain.com/?nav=products.guidelines > > > > > > _______________________________________________ > 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 Tue Nov 13 09:38:31 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Nov 2007 07:38:31 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: What exactly are you trying to do, John? A tool like CodeGen should take care of creating the XML for you, but I don't really understand your question. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 4:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Tue Nov 13 10:54:54 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 13 Nov 2007 10:54:54 -0600 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 jwcolby at colbyconsulting.com Tue Nov 13 11:14:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 12:14:25 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: <000d01c82618$a4be3aa0$6c7aa8c0@M90> Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ 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 Tue Nov 13 11:24:31 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Nov 2007 09:24:31 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: <000d01c82618$a4be3aa0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> <000d01c82618$a4be3aa0$6c7aa8c0@M90> Message-ID: John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 Nov 13 11:46:12 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 12:46:12 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: References: <00e301c825f2$a8d035b0$6c7aa8c0@M90><000d01c82618$a4be3aa0$6c7aa8c0@M90> Message-ID: <001301c8261d$15602a30$6c7aa8c0@M90> Well, I asked you this question earlier and didn't really receive a usable response. If I have a class and want to persist it to a table, how do I do so? I can persist it to an XML file, though even there I still do not know how to get the data type tags to embed in the XML file. So to persist a class to a table I would have to persist it to an XML file, discover how to write the data type tags out to the XML file, then read the data back in to SQL Server. Why would I do that if I could read the class properties and data types directly then use a data adapter or write SQL to build the table. In fact I got so far as to export to XML and then pull back in to a data adapter but the adapter threw an error when I tried to save to SQL Server because the table did not already exist. Even in this case I was missing the data type information because no one could point me to how to export the data type to XML as well. I am importing files from CSV and flat files. In many cases I get a "spec" that tells me the field names and values, but in some cases I don't even get that, just the name and "starts at / ends at" (fixed width files). People throw anything into these files and it is my job to recover the data. John W. Colby 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: Tuesday, November 13, 2007 12:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 Tue Nov 13 12:53:26 2007 From: ebarro at verizon.net (Eric Barro) Date: Tue, 13 Nov 2007 10:53:26 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: Message-ID: <0JRG0046HKH2IFD3@vms040.mailsrvcs.net> .NET handles this well Drew. In VB Dim wd as Widget = New Widget() Wd.Height = 10 In C# Widet wd = new Widget(); Wd.Height = 10; -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 8:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ From DWUTKA at Marlow.com Tue Nov 13 14:13:50 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 13 Nov 2007 14:13:50 -0600 Subject: [dba-VB] Iterating class properties In-Reply-To: <0JRG0046HKH2IFD3@vms040.mailsrvcs.net> Message-ID: Ummmmm, not what I was saying. In VB 6, with my classes property, I can go: Wd.Height or wd.Properties("Height") Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Tuesday, November 13, 2007 12:53 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties .NET handles this well Drew. In VB Dim wd as Widget = New Widget() Wd.Height = 10 In C# Widet wd = new Widget(); Wd.Height = 10; -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 8:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Tue Nov 13 14:53:39 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 13 Nov 2007 23:53:39 +0300 Subject: [dba-VB] Iterating class properties In-Reply-To: <001301c8261d$15602a30$6c7aa8c0@M90> Message-ID: <000601c82637$44ca1410$6401a8c0@nant> Hello John, The answer is System.Reflection namespace: Imports System.Reflection Module Module1 Public Class Test Public ReadOnly Property One() As String Get Return "test" End Get End Property Private _prp2 As String Public WriteOnly Property Two() As String Set(ByVal value As String) _prp2 = value End Set End Property Public ReadOnly Property Three() As Double Get Return One + _prp2 End Get End Property End Class Sub Main() Dim a As Assembly = System.Reflection.Assembly.GetExecutingAssembly() For Each t As Type In _ System.Reflection.Assembly.GetExecutingAssembly().GetTypes() If t.ToString.EndsWith("Test") Then Console.WriteLine(t.ToString()) For Each m As MemberInfo In t.GetMembers() If m.MemberType = MemberTypes.Property Then Console.WriteLine(" " + m.Name) End If Next End If Next End Sub End Module HTH. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 8:46 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Well, I asked you this question earlier and didn't really receive a usable response. If I have a class and want to persist it to a table, how do I do so? I can persist it to an XML file, though even there I still do not know how to get the data type tags to embed in the XML file. So to persist a class to a table I would have to persist it to an XML file, discover how to write the data type tags out to the XML file, then read the data back in to SQL Server. Why would I do that if I could read the class properties and data types directly then use a data adapter or write SQL to build the table. In fact I got so far as to export to XML and then pull back in to a data adapter but the adapter threw an error when I tried to save to SQL Server because the table did not already exist. Even in this case I was missing the data type information because no one could point me to how to export the data type to XML as well. I am importing files from CSV and flat files. In many cases I get a "spec" that tells me the field names and values, but in some cases I don't even get that, just the name and "starts at / ends at" (fixed width files). People throw anything into these files and it is my job to recover the data. John W. Colby 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: Tuesday, November 13, 2007 12:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Nov 19 13:29:13 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 19 Nov 2007 14:29:13 -0500 Subject: [dba-VB] Action Pack Subscribers Message-ID: <00d101c82ae2$784fcb90$6c7aa8c0@M90> For those of you doing Web stuff I just found this: https://partner.microsoft.com/us/40047166 John W. Colby Colby Consulting www.ColbyConsulting.com From carbonnb at gmail.com Wed Nov 21 07:02:59 2007 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Wed, 21 Nov 2007 08:02:59 -0500 Subject: [dba-VB] Download VS2008 Express Editions Message-ID: Here is a link to let you download the new VS 2008 Express editions from MS. http://www.microsoft.com/express/download/ Currently the following versions are available: VB 2008 Web Developer 2008 C# 2008 C++ 2008 SQL Server 2005, but apparently it will be updated to SQL Server 2008 when it's available. Now all I gotta do is find the time to learn it :( -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From wdhindman at dejpolsystems.com Wed Nov 21 10:33:50 2007 From: wdhindman at dejpolsystems.com (William Hindman) Date: Wed, 21 Nov 2007 11:33:50 -0500 Subject: [dba-VB] Download VS2008 Express Editions References: Message-ID: <000f01c82c5c$4c799930$ef706c4c@jisshowsbs.local> ...I've spent all morning installing, configuring, and getting my feet wet in vswd'8 ...love it so far ...I dl'd the iso image with all of the editions and burned a cd ...have to take a look at the vb and c# versions this weekend. William ----- Original Message ----- From: "Bryan Carbonnell" To: Sent: Wednesday, November 21, 2007 8:02 AM Subject: [dba-VB] Download VS2008 Express Editions > Here is a link to let you download the new VS 2008 Express editions from > MS. > > http://www.microsoft.com/express/download/ > > Currently the following versions are available: > VB 2008 > Web Developer 2008 > C# 2008 > C++ 2008 > SQL Server 2005, but apparently it will be updated to SQL Server 2008 > when it's available. > > Now all I gotta do is find the time to learn it :( > > -- > Bryan Carbonnell - carbonnb at gmail.com > Life's journey is not to arrive at the grave safely in a well > preserved body, but rather to skid in sideways, totally worn out, > shouting "What a great ride!" > _______________________________________________ > 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 Sun Nov 25 23:14:39 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 26 Nov 2007 18:14:39 +1300 Subject: [dba-VB] Open PDF file Message-ID: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Mon Nov 26 07:43:24 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 14:43:24 +0100 Subject: [dba-VB] Open PDF file Message-ID: Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Mon Nov 26 07:52:13 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 14:52:13 +0100 Subject: [dba-VB] Launch and monitor external programs from .NET (was: Open PDF file) Message-ID: Hi David et al A lot of useful things can be done with the Process class. Some examples here: http://www.thescarms.com/dotnet/Process.aspx /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From JHewson at karta.com Mon Nov 26 08:37:38 2007 From: JHewson at karta.com (Jim Hewson) Date: Mon, 26 Nov 2007 08:37:38 -0600 Subject: [dba-VB] Open PDF file References: Message-ID: <1C877227AE9F2A4BB20BABE94325D15B03017A@exchange.Karta.com> Doesn't the PDF reader need to be on the user's machine? How does this open a file on a server so the user, presumably somewhere else, open the file and review it? I thought the user must have Adobe reader on their machine. Jim jhewson at karta.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, November 26, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Open PDF file Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? 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 From Gustav at cactus.dk Mon Nov 26 08:48:15 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 15:48:15 +0100 Subject: [dba-VB] Open PDF file Message-ID: Hi Jim You may be right - I didn't read the question in full, I can see now, sorry. However, there seems to be some misunderstanding ... the user's browser can open an pdf file if the Adobe Reader add-in is installed, but the file is downloaded from the web server; as far as I know, the server can not "display" an pdf file, only pass it on. /gustav >>> JHewson at karta.com 26-11-2007 15:37 >>> Doesn't the PDF reader need to be on the user's machine? How does this open a file on a server so the user, presumably somewhere else, open the file and review it? I thought the user must have Adobe reader on their machine. Jim jhewson at karta.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, November 26, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Open PDF file Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From James at fcidms.com Mon Nov 26 10:30:30 2007 From: James at fcidms.com (James Barash) Date: Mon, 26 Nov 2007 11:30:30 -0500 Subject: [dba-VB] Open PDF file In-Reply-To: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <01d201c83049$a95699f0$800101df@fci.local> David: How are you displaying the list of files? I do something similar using an ASP.Net table and adding the filenames as cells with a hyperlink to the appropiate file on the server. It is the client that needs to have Adobe installed, not the server since it is the client that renders the file. Below is the code. It loops through all the files in a specified directory. For each file you create a new row in the table, create a new cell, set the cell text to a clickable hyperlink to the appropriate file and add the row to the ASP.net table. The directories are all relative to the root directory of the website. The pfd files open in a new browser window. If the client does not have Adobe installed, they should get the option of saving the file locally. Hope this helps. James Barash Dim root As String = Server.MapPath(".") & "/" & strDir Dim files() As String files = System.IO.Directory.GetFiles(root, "*") Dim strFilename As String, f as String Table1.Rows.Clear() For Each f In files strFilename = System.IO.Path.GetFileName(f) row = New Web.UI.WebControls.TableRow cell = New Web.UI.WebControls.TableCell cell.Text = "" & strFilename & "" row.Cells.Add(cell) Table1.Rows.Add(row) Next f -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Monday, November 26, 2007 12:15 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Open PDF file I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? 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 From newsgrps at dalyn.co.nz Mon Nov 26 11:27:25 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 27 Nov 2007 06:27:25 +1300 Subject: [dba-VB] Open PDF file In-Reply-To: <01d201c83049$a95699f0$800101df@fci.local> References: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> <01d201c83049$a95699f0$800101df@fci.local> Message-ID: <20071126172524.XYLE18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks all for the responses - I will start looking at them today. Sorry about the confusion - The users open the PDF files on their own computers, not the server. James, to answer your question below, another developer has written the web pages (as part of a larger application) which take a list of records from a table and produces a page which has all the reports available with check boxes beside them. Most of the reports are created from Active Reports (a report add on to Dot Net - it has a very similar graphic interface for developing to Access). When the user has selected the reports they want then a list of ID's is sent to my web application which loops through the ID's, gets the report details (file location, type etc) and merges them together into one PDF for the users to save etc (the Active Report report files can be merged together and exported as PDF's). Because several reports are merged together (and this depends on the user selection) hyperlinks would not work in this case. However, some "reports" are already PDF's and they would be opened as separate files (not merged in with the other reports). These are the ones I am wanting to show in a different browser window. Regards David At 27/11/2007, you wrote: >David: > >How are you displaying the list of files? I do something similar using an >ASP.Net table and adding the filenames as cells with a hyperlink to the >appropiate file on the server. It is the client that needs to have Adobe >installed, not the server since it is the client that renders the file. >Below is the code. It loops through all the files in a specified directory. >For each file you create a new row in the table, create a new cell, set the >cell text to a clickable hyperlink to the appropriate file and add the row >to the ASP.net table. The directories are all relative to the root directory >of the website. The pfd files open in a new browser window. If the client >does not have Adobe installed, they should get the option of saving the file >locally. > >Hope this helps. > >James Barash > >Dim root As String = Server.MapPath(".") & "/" & strDir >Dim files() As String >files = System.IO.Directory.GetFiles(root, "*") >Dim strFilename As String, f as String >Table1.Rows.Clear() >For Each f In files >strFilename = System.IO.Path.GetFileName(f) >row = New Web.UI.WebControls.TableRow >cell = New Web.UI.WebControls.TableCell >cell.Text = "target=""_blank"" >" & strFilename & "" >row.Cells.Add(cell) >Table1.Rows.Add(row) >Next f > > > > >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson >Sent: Monday, November 26, 2007 12:15 AM >To: dba-vb at databaseadvisors.com >Subject: [dba-VB] Open PDF file > >I am using VS 2005 and VB.Net for a web site. > >I have a number of PDF files that are stored in a static folder on the >server. > >Users select from a list on files on a web page and I want to open >the files in Adobe. Adobe reader is installed on the server. > >Can anyone give me a pointer to how I can take a string with path and >file name, and open it? > >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 > >_______________________________________________ >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 Nov 30 11:43:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 12:43:32 -0500 Subject: [dba-VB] SQLBulkCopy error Message-ID: <001e01c83378$8743d1c0$647aa8c0@M90> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? John W. Colby Colby Consulting www.ColbyConsulting.com From Gustav at cactus.dk Fri Nov 30 12:02:47 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 Nov 2007 19:02:47 +0100 Subject: [dba-VB] SQLBulkCopy error Message-ID: Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Nov 30 12:08:38 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 10:08:38 -0800 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: References: Message-ID: Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 Nov 30 12:43:33 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:43:33 -0500 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: References: Message-ID: <002201c83380$e9a58b30$647aa8c0@M90> That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 Nov 30 12:46:21 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:46:21 -0500 Subject: [dba-VB] VS keyboard Message-ID: <002301c83381$4d9642b0$647aa8c0@M90> I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 30 12:51:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:51:25 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: <002301c83381$4d9642b0$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> Message-ID: <002401c83382$0283db60$647aa8c0@M90> Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? 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 garykjos at gmail.com Fri Nov 30 12:56:04 2007 From: garykjos at gmail.com (Gary Kjos) Date: Fri, 30 Nov 2007 12:56:04 -0600 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: Well you have to give us more time than that. Only 5 minutes between question and "I found it myself"? GK On 11/30/07, jwcolby wrote: > Found this one. Boy was that buried... > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.com From carbonnb at gmail.com Fri Nov 30 13:03:23 2007 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Fri, 30 Nov 2007 14:03:23 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: On Nov 30, 2007 1:51 PM, jwcolby wrote: > Found this one. Boy was that buried... Hows about letting us know what it is. For the archive doncha know :) -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From cfoust at infostatsystems.com Fri Nov 30 13:03:02 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 11:03:02 -0800 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: I take it you found File-->Options-->Environment-->Keyboard and discovered the keyboard mapping on the two machines was different? Or was it some other solution? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:51 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 30 13:04:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:04:15 -0500 Subject: [dba-VB] Weird table name restriction Message-ID: <002501c83383$cde18360$647aa8c0@M90> I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Nov 30 13:11:20 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 11:11:20 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <002501c83383$cde18360$647aa8c0@M90> References: <002501c83383$cde18360$647aa8c0@M90> Message-ID: Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Nov 30 13:12:08 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:12:08 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002601c83384$e7e037b0$647aa8c0@M90> Yea, I apologize. I know that there is so much setup stuff that I could well have searched for an hour before finding it. In fact I missed it on my first pass. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Friday, November 30, 2007 1:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Well you have to give us more time than that. Only 5 minutes between question and "I found it myself"? GK On 11/30/07, jwcolby wrote: > Found this one. Boy was that buried... > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.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 Fri Nov 30 13:13:12 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 30 Nov 2007 11:13:12 -0800 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: <002201c83380$e9a58b30$647aa8c0@M90> Message-ID: <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> Check that the Windows account you are using has the correct security privileges. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date: 11/29/2007 8:32 PM From jwcolby at colbyconsulting.com Fri Nov 30 13:18:02 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:18:02 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002a01c83385$bb826110$647aa8c0@M90> In the editor... Tools / Options Check the "show all options" check box in the lower left. Expand environment Keyboard Visual Basic 6 from the combo at the top. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell Sent: Friday, November 30, 2007 2:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard On Nov 30, 2007 1:51 PM, jwcolby wrote: > Found this one. Boy was that buried... Hows about letting us know what it is. For the archive doncha know :) -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" _______________________________________________ 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 Nov 30 13:18:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:18:23 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002b01c83385$c758c650$647aa8c0@M90> That was it. John W. Colby 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, November 30, 2007 2:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard I take it you found File-->Options-->Environment-->Keyboard and discovered the keyboard mapping on the two machines was different? Or was it some other solution? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:51 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? 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 Nov 30 13:21:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:21:32 -0500 Subject: [dba-VB] Weird table name restriction In-Reply-To: References: <002501c83383$cde18360$647aa8c0@M90> Message-ID: <002c01c83386$37c8f450$647aa8c0@M90> The problem is that they are fine (as are spaces) in file names... I am doing a "copy file to temp table, copy temp to permanent". Thus the temp table name is just the file name. I discussed awhile back that I got an "in" or something similar as a file name, which collided with a reserve word. kind of the same issue only different. What a PITA. Keeps me searching for answers long after this thing should just 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 Charlotte Foust Sent: Friday, November 30, 2007 2:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Nov 30 13:22:06 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:22:06 -0500 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> References: <002201c83380$e9a58b30$647aa8c0@M90> <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> Message-ID: <002d01c83386$4c489ac0$647aa8c0@M90> Hmm... well the bulkcopy itself works fine if I remove the provider keyword. John W. Colby 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, November 30, 2007 2:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Check that the Windows account you are using has the correct security privileges. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date: 11/29/2007 8:32 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 Nov 30 13:31:14 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:31:14 -0500 Subject: [dba-VB] Weird table name restriction In-Reply-To: <002c01c83386$37c8f450$647aa8c0@M90> References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> Message-ID: <002e01c83387$92cbcb10$647aa8c0@M90> The strange part is that the code to create the table worked just fine, the table was there. The bulkinsert function just couldn't use it. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 2:22 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction The problem is that they are fine (as are spaces) in file names... I am doing a "copy file to temp table, copy temp to permanent". Thus the temp table name is just the file name. I discussed awhile back that I got an "in" or something similar as a file name, which collided with a reserve word. kind of the same issue only different. What a PITA. Keeps me searching for answers long after this thing should just 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 Charlotte Foust Sent: Friday, November 30, 2007 2:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Fri Nov 30 13:43:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:43:30 -0500 Subject: [dba-VB] Reserved words Message-ID: <002f01c83389$497a0a10$647aa8c0@M90> Does anyone know if the reserved words in SQL Server (can't be used in table names etc) are in a table anywhere (in sql server)? I have code that builds tables and it really needs to check the proposed table name to make sure that the name isn't a reserved word, and that it does not have special characters. I have had TWO times now where I was hunting down errors caused by issues with what is valid in a table name. I could build a table of reserved words but if any new ones are added my list would be short. John W. Colby Colby Consulting www.ColbyConsulting.com From ssharkins at gmail.com Fri Nov 30 14:04:12 2007 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 30 Nov 2007 15:04:12 -0500 Subject: [dba-VB] Reserved words References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: <006401c8338c$340574f0$4b3a8343@SusanOne> http://msdn2.microsoft.com/en-us/library/ms189822.aspx I don't know how comprehensive it is though Susan H. > Does anyone know if the reserved words in SQL Server (can't be used in > table > names etc) are in a table anywhere (in sql server)? I have code that > builds > tables and it really needs to check the proposed table name to make sure > that the name isn't a reserved word, and that it does not have special > characters. I have had TWO times now where I was hunting down errors > caused > by issues with what is valid in a table name. > > I could build a table of reserved words but if any new ones are added my > list would be short. > > 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 ridermark at gmail.com Fri Nov 30 14:06:39 2007 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 Nov 2007 14:06:39 -0600 Subject: [dba-VB] Reserved words In-Reply-To: <002f01c83389$497a0a10$647aa8c0@M90> References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: I have used brackets or/and a prefix to get around this issue. I deal with stocks and to have a table named ASK is not possible, but tblASK or [ASK] works. I prefer the tbl prefix since it is easy to prepend it to the proposed name. On Nov 30, 2007 1:43 PM, jwcolby wrote: > Does anyone know if the reserved words in SQL Server (can't be used in > table > names etc) are in a table anywhere (in sql server)? I have code that > builds > tables and it really needs to check the proposed table name to make sure > that the name isn't a reserved word, and that it does not have special > characters. I have had TWO times now where I was hunting down errors > caused > by issues with what is valid in a table name. > > I could build a table of reserved words but if any new ones are added my > list would be short. > > 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 > > -- Mark Rider http://commonsensesecurity.info Try to learn something about everything and everything about something. - Thomas H. Huxley From ridermark at gmail.com Fri Nov 30 14:08:15 2007 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 Nov 2007 14:08:15 -0600 Subject: [dba-VB] Reserved words In-Reply-To: References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: Spell check did a number on that - it is supposed to be ASC, not ASK. On Nov 30, 2007 2:06 PM, Mark Rider wrote: > I have used brackets or/and a prefix to get around this issue. I deal > with stocks and to have a table named ASK is not possible, but tblASK or > [ASK] works. I prefer the tbl prefix since it is easy to prepend it to the > proposed name. > > -- Mark Rider http://commonsensesecurity.info Try to learn something about everything and everything about something. - Thomas H. Huxley From robert at webedb.com Fri Nov 30 14:22:16 2007 From: robert at webedb.com (Robert L. Stewart) Date: Fri, 30 Nov 2007 14:22:16 -0600 Subject: [dba-VB] Weird table name restriction In-Reply-To: References: Message-ID: <200711302023.lAUKNhnG027841@databaseadvisors.com> John, Use [] around the name and you can use special characters. Robert At 01:13 PM 11/30/2007, you wrote: >Date: Fri, 30 Nov 2007 14:04:15 -0500 >From: "jwcolby" >Subject: [dba-VB] Weird table name restriction >To: , > >Message-ID: <002501c83383$cde18360$647aa8c0 at M90> >Content-Type: text/plain; charset="US-ASCII" > >I just discovered that SQL Server (or VB.Net) does not like dashes in table >names. > >If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an >error "can't access destination table" but if I remove the dash "ZIP4AA_X" >it works just fine. > >The problem is that I take the name of the datafile, strip off the extension >and use that as my table name. Thus I now have to start doing edits of the >file name before I can use it as a field name. > >The hoops we have to jump through... > >John W. Colby >Colby Consulting >www.ColbyConsulting.com From wdhindman at dejpolsystems.com Fri Nov 30 18:30:48 2007 From: wdhindman at dejpolsystems.com (William Hindman) Date: Fri, 30 Nov 2007 19:30:48 -0500 Subject: [dba-VB] Weird table name restriction References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> Message-ID: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> "What a PITA. Keeps me searching for answers long after this thing should just work." jc ...my life as a developer :( William ----- Original Message ----- From: "jwcolby" To: Sent: Friday, November 30, 2007 2:21 PM Subject: Re: [dba-VB] Weird table name restriction > The problem is that they are fine (as are spaces) in file names... > > I am doing a "copy file to temp table, copy temp to permanent". Thus the > temp table name is just the file name. I discussed awhile back that I got > an "in" or something similar as a file name, which collided with a reserve > word. kind of the same issue only different. > > What a PITA. Keeps me searching for answers long after this thing should > just 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 Charlotte Foust > Sent: Friday, November 30, 2007 2:11 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Weird table name restriction > > Yep, dashes are as bad as spaces. ;-} > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, November 30, 2007 11:04 AM > To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com > Subject: [dba-VB] Weird table name restriction > > I just discovered that SQL Server (or VB.Net) does not like dashes in > table > names. > > If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an > error "can't access destination table" but if I remove the dash "ZIP4AA_X" > it works just fine. > > The problem is that I take the name of the datafile, strip off the > extension > and use that as my table name. Thus I now have to start doing edits of > the > file name before I can use it as a field name. > > The hoops we have to jump through... > > 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 cfoust at infostatsystems.com Fri Nov 30 18:45:10 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 16:45:10 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> References: <002501c83383$cde18360$647aa8c0@M90><002c01c83386$37c8f450$647aa8c0@M90> <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: Right! Those pesky, literal-minded computers! They insist on doing what I tell them instead of what I WANT. LOL Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of William Hindman Sent: Friday, November 30, 2007 4:31 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction "What a PITA. Keeps me searching for answers long after this thing should just work." jc ...my life as a developer :( William ----- Original Message ----- From: "jwcolby" To: Sent: Friday, November 30, 2007 2:21 PM Subject: Re: [dba-VB] Weird table name restriction > The problem is that they are fine (as are spaces) in file names... > > I am doing a "copy file to temp table, copy temp to permanent". Thus the > temp table name is just the file name. I discussed awhile back that I got > an "in" or something similar as a file name, which collided with a reserve > word. kind of the same issue only different. > > What a PITA. Keeps me searching for answers long after this thing should > just 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 Charlotte Foust > Sent: Friday, November 30, 2007 2:11 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Weird table name restriction > > Yep, dashes are as bad as spaces. ;-} > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, November 30, 2007 11:04 AM > To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com > Subject: [dba-VB] Weird table name restriction > > I just discovered that SQL Server (or VB.Net) does not like dashes in > table > names. > > If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an > error "can't access destination table" but if I remove the dash "ZIP4AA_X" > it works just fine. > > The problem is that I take the name of the datafile, strip off the > extension > and use that as my table name. Thus I now have to start doing edits of > the > file name before I can use it as a field name. > > The hoops we have to jump through... > > 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 aip2000 at codewords.com Fri Nov 30 18:50:26 2007 From: aip2000 at codewords.com (Bill Klemens) Date: Fri, 30 Nov 2007 16:50:26 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: <4750AFD2.5010006@codewords.com> >> Thus I now have to start doing edits of >> the >> file name before I can use it as a field name. >> >> The hoops we have to jump through... >> >> John W. Colby >> Colby Consulting >> www.ColbyConsulting.com >> If you're using unedited (unsanitized) data to build SQL statements you could put yourself in a bad position. http://xkcd.com/327/ Bill From ssharkins at gmail.com Fri Nov 30 18:50:45 2007 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 30 Nov 2007 19:50:45 -0500 Subject: [dba-VB] Weird table name restriction References: <002501c83383$cde18360$647aa8c0@M90><002c01c83386$37c8f450$647aa8c0@M90><001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: <001401c833b4$365ccb40$4b3a8343@SusanOne> I have always wished for a computer that would do want I expect rather than what I tell it! ;) Ohhhhhhhh, why can't a computer think more like me, more like me, more like me.... Susan H. > Right! Those pesky, literal-minded computers! They insist on doing > what I tell them instead of what I WANT. LOL From jwcolby at colbyconsulting.com Fri Nov 30 23:04:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 1 Dec 2007 00:04:05 -0500 Subject: [dba-VB] Truncate a log file from code Message-ID: <004701c833d7$99526c00$647aa8c0@M90> I am doing an entire directory of files, using SQLBulkCopy to import the text files into a temp table, and from there into a permanent table. The log file is about the same size as the data file. Is it possible to truncate the log file after every file import in order to minimize the disk impact? If so can you point me to example code? John W. Colby Colby Consulting www.ColbyConsulting.com From newsgrps at dalyn.co.nz Thu Nov 1 12:10:52 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 02 Nov 2007 06:10:52 +1300 Subject: [dba-VB] Web Developer wanted VB Dot Net Message-ID: <20071101170935.GIOL18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Group, I have had one response to my previous message, but the company I am working for would like a few options. If anyone else is interested please email me off line. I have an access program that has been converted to a Web site written using Visual Studio 2003 and VB.Net. The conversion was done by another developer as a favour for the company that owns the software. We are now looking for a web developer that can do the following: 1) Continue to maintain the web version. This should be basic maintenance of the screens. The database is SQL2000 and I can maintain this. The reports are developed using DataDynamics Active Report. I can also maintain these. What I can't do is the actual web site maintenance. Medium term we would be looking to upgrade this to Visual Studio 2005. 2) The company has another project that they want converted from a desk top version to the web. This project would involve interaction with the developer of the desk top version - he is also not familiar with web development. This would be a major project. 3) There would be other web projects that would come up as well. Based on my previous experience with this company, there would be ongoing work required on a regular basis. The company that we would be working for is based in Chicago. However, I have been developing for them for over 10 years and I am in NZ. If you are interested in more information please email me off line with a phone number and a suitable time to call (preferably your afternoon if you are in America due to the time difference) Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From jwcolby at colbyconsulting.com Tue Nov 13 06:42:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 07:42:30 -0500 Subject: [dba-VB] Iterating class properties Message-ID: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Nov 13 07:34:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 08:34:22 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: <00e701c825f9$e75ff890$6c7aa8c0@M90> In answer to my own question, I found this... http://articles.techrepublic.com.com/5100-22-1050654.html#comments It could be very useful in some circumstances. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Nov 13 07:54:18 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 08:54:18 -0500 Subject: [dba-VB] SP to create C# classes Message-ID: <00e901c825fc$b018f0f0$6c7aa8c0@M90> I ran across this this morning. http://www.sqlservercentral.com/scripts/Miscellaneous/31997/ I have not tested it yet but thought that someone might find it useful. John W. Colby Colby Consulting www.ColbyConsulting.com From dwaters at usinternet.com Tue Nov 13 09:07:21 2007 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 13 Nov 2007 09:07:21 -0600 Subject: [dba-VB] VB.Net / C# Guidelines Message-ID: <001f01c82606$e454ef90$0200a8c0@danwaters> VB City is offering a free download (100 pages) of coding guidelines. http://submain.com/?nav=products.guidelines From mmattys at rochester.rr.com Tue Nov 13 09:16:34 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Tue, 13 Nov 2007 10:16:34 -0500 Subject: [dba-VB] VB.Net / C# Guidelines References: <001f01c82606$e454ef90$0200a8c0@danwaters> Message-ID: <008b01c82608$2e9b6970$0202a8c0@Laptop> Hi Dan, Thanks. I'm planning on buying VS 2008 when it comes out. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Dan Waters" To: Sent: Tuesday, November 13, 2007 10:07 AM Subject: [dba-VB] VB.Net / C# Guidelines > VB City is offering a free download (100 pages) of coding guidelines. > > http://submain.com/?nav=products.guidelines > > > > > > _______________________________________________ > 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 Tue Nov 13 09:38:31 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Nov 2007 07:38:31 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: What exactly are you trying to do, John? A tool like CodeGen should take care of creating the XML for you, but I don't really understand your question. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 4:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Tue Nov 13 10:54:54 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 13 Nov 2007 10:54:54 -0600 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 jwcolby at colbyconsulting.com Tue Nov 13 11:14:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 12:14:25 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: <000d01c82618$a4be3aa0$6c7aa8c0@M90> Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ 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 Tue Nov 13 11:24:31 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Nov 2007 09:24:31 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: <000d01c82618$a4be3aa0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> <000d01c82618$a4be3aa0$6c7aa8c0@M90> Message-ID: John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 Nov 13 11:46:12 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 12:46:12 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: References: <00e301c825f2$a8d035b0$6c7aa8c0@M90><000d01c82618$a4be3aa0$6c7aa8c0@M90> Message-ID: <001301c8261d$15602a30$6c7aa8c0@M90> Well, I asked you this question earlier and didn't really receive a usable response. If I have a class and want to persist it to a table, how do I do so? I can persist it to an XML file, though even there I still do not know how to get the data type tags to embed in the XML file. So to persist a class to a table I would have to persist it to an XML file, discover how to write the data type tags out to the XML file, then read the data back in to SQL Server. Why would I do that if I could read the class properties and data types directly then use a data adapter or write SQL to build the table. In fact I got so far as to export to XML and then pull back in to a data adapter but the adapter threw an error when I tried to save to SQL Server because the table did not already exist. Even in this case I was missing the data type information because no one could point me to how to export the data type to XML as well. I am importing files from CSV and flat files. In many cases I get a "spec" that tells me the field names and values, but in some cases I don't even get that, just the name and "starts at / ends at" (fixed width files). People throw anything into these files and it is my job to recover the data. John W. Colby 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: Tuesday, November 13, 2007 12:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 Tue Nov 13 12:53:26 2007 From: ebarro at verizon.net (Eric Barro) Date: Tue, 13 Nov 2007 10:53:26 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: Message-ID: <0JRG0046HKH2IFD3@vms040.mailsrvcs.net> .NET handles this well Drew. In VB Dim wd as Widget = New Widget() Wd.Height = 10 In C# Widet wd = new Widget(); Wd.Height = 10; -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 8:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ From DWUTKA at Marlow.com Tue Nov 13 14:13:50 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 13 Nov 2007 14:13:50 -0600 Subject: [dba-VB] Iterating class properties In-Reply-To: <0JRG0046HKH2IFD3@vms040.mailsrvcs.net> Message-ID: Ummmmm, not what I was saying. In VB 6, with my classes property, I can go: Wd.Height or wd.Properties("Height") Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Tuesday, November 13, 2007 12:53 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties .NET handles this well Drew. In VB Dim wd as Widget = New Widget() Wd.Height = 10 In C# Widet wd = new Widget(); Wd.Height = 10; -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 8:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Tue Nov 13 14:53:39 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 13 Nov 2007 23:53:39 +0300 Subject: [dba-VB] Iterating class properties In-Reply-To: <001301c8261d$15602a30$6c7aa8c0@M90> Message-ID: <000601c82637$44ca1410$6401a8c0@nant> Hello John, The answer is System.Reflection namespace: Imports System.Reflection Module Module1 Public Class Test Public ReadOnly Property One() As String Get Return "test" End Get End Property Private _prp2 As String Public WriteOnly Property Two() As String Set(ByVal value As String) _prp2 = value End Set End Property Public ReadOnly Property Three() As Double Get Return One + _prp2 End Get End Property End Class Sub Main() Dim a As Assembly = System.Reflection.Assembly.GetExecutingAssembly() For Each t As Type In _ System.Reflection.Assembly.GetExecutingAssembly().GetTypes() If t.ToString.EndsWith("Test") Then Console.WriteLine(t.ToString()) For Each m As MemberInfo In t.GetMembers() If m.MemberType = MemberTypes.Property Then Console.WriteLine(" " + m.Name) End If Next End If Next End Sub End Module HTH. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 8:46 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Well, I asked you this question earlier and didn't really receive a usable response. If I have a class and want to persist it to a table, how do I do so? I can persist it to an XML file, though even there I still do not know how to get the data type tags to embed in the XML file. So to persist a class to a table I would have to persist it to an XML file, discover how to write the data type tags out to the XML file, then read the data back in to SQL Server. Why would I do that if I could read the class properties and data types directly then use a data adapter or write SQL to build the table. In fact I got so far as to export to XML and then pull back in to a data adapter but the adapter threw an error when I tried to save to SQL Server because the table did not already exist. Even in this case I was missing the data type information because no one could point me to how to export the data type to XML as well. I am importing files from CSV and flat files. In many cases I get a "spec" that tells me the field names and values, but in some cases I don't even get that, just the name and "starts at / ends at" (fixed width files). People throw anything into these files and it is my job to recover the data. John W. Colby 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: Tuesday, November 13, 2007 12:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Nov 19 13:29:13 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 19 Nov 2007 14:29:13 -0500 Subject: [dba-VB] Action Pack Subscribers Message-ID: <00d101c82ae2$784fcb90$6c7aa8c0@M90> For those of you doing Web stuff I just found this: https://partner.microsoft.com/us/40047166 John W. Colby Colby Consulting www.ColbyConsulting.com From carbonnb at gmail.com Wed Nov 21 07:02:59 2007 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Wed, 21 Nov 2007 08:02:59 -0500 Subject: [dba-VB] Download VS2008 Express Editions Message-ID: Here is a link to let you download the new VS 2008 Express editions from MS. http://www.microsoft.com/express/download/ Currently the following versions are available: VB 2008 Web Developer 2008 C# 2008 C++ 2008 SQL Server 2005, but apparently it will be updated to SQL Server 2008 when it's available. Now all I gotta do is find the time to learn it :( -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From wdhindman at dejpolsystems.com Wed Nov 21 10:33:50 2007 From: wdhindman at dejpolsystems.com (William Hindman) Date: Wed, 21 Nov 2007 11:33:50 -0500 Subject: [dba-VB] Download VS2008 Express Editions References: Message-ID: <000f01c82c5c$4c799930$ef706c4c@jisshowsbs.local> ...I've spent all morning installing, configuring, and getting my feet wet in vswd'8 ...love it so far ...I dl'd the iso image with all of the editions and burned a cd ...have to take a look at the vb and c# versions this weekend. William ----- Original Message ----- From: "Bryan Carbonnell" To: Sent: Wednesday, November 21, 2007 8:02 AM Subject: [dba-VB] Download VS2008 Express Editions > Here is a link to let you download the new VS 2008 Express editions from > MS. > > http://www.microsoft.com/express/download/ > > Currently the following versions are available: > VB 2008 > Web Developer 2008 > C# 2008 > C++ 2008 > SQL Server 2005, but apparently it will be updated to SQL Server 2008 > when it's available. > > Now all I gotta do is find the time to learn it :( > > -- > Bryan Carbonnell - carbonnb at gmail.com > Life's journey is not to arrive at the grave safely in a well > preserved body, but rather to skid in sideways, totally worn out, > shouting "What a great ride!" > _______________________________________________ > 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 Sun Nov 25 23:14:39 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 26 Nov 2007 18:14:39 +1300 Subject: [dba-VB] Open PDF file Message-ID: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Mon Nov 26 07:43:24 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 14:43:24 +0100 Subject: [dba-VB] Open PDF file Message-ID: Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Mon Nov 26 07:52:13 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 14:52:13 +0100 Subject: [dba-VB] Launch and monitor external programs from .NET (was: Open PDF file) Message-ID: Hi David et al A lot of useful things can be done with the Process class. Some examples here: http://www.thescarms.com/dotnet/Process.aspx /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From JHewson at karta.com Mon Nov 26 08:37:38 2007 From: JHewson at karta.com (Jim Hewson) Date: Mon, 26 Nov 2007 08:37:38 -0600 Subject: [dba-VB] Open PDF file References: Message-ID: <1C877227AE9F2A4BB20BABE94325D15B03017A@exchange.Karta.com> Doesn't the PDF reader need to be on the user's machine? How does this open a file on a server so the user, presumably somewhere else, open the file and review it? I thought the user must have Adobe reader on their machine. Jim jhewson at karta.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, November 26, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Open PDF file Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? 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 From Gustav at cactus.dk Mon Nov 26 08:48:15 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 15:48:15 +0100 Subject: [dba-VB] Open PDF file Message-ID: Hi Jim You may be right - I didn't read the question in full, I can see now, sorry. However, there seems to be some misunderstanding ... the user's browser can open an pdf file if the Adobe Reader add-in is installed, but the file is downloaded from the web server; as far as I know, the server can not "display" an pdf file, only pass it on. /gustav >>> JHewson at karta.com 26-11-2007 15:37 >>> Doesn't the PDF reader need to be on the user's machine? How does this open a file on a server so the user, presumably somewhere else, open the file and review it? I thought the user must have Adobe reader on their machine. Jim jhewson at karta.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, November 26, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Open PDF file Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From James at fcidms.com Mon Nov 26 10:30:30 2007 From: James at fcidms.com (James Barash) Date: Mon, 26 Nov 2007 11:30:30 -0500 Subject: [dba-VB] Open PDF file In-Reply-To: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <01d201c83049$a95699f0$800101df@fci.local> David: How are you displaying the list of files? I do something similar using an ASP.Net table and adding the filenames as cells with a hyperlink to the appropiate file on the server. It is the client that needs to have Adobe installed, not the server since it is the client that renders the file. Below is the code. It loops through all the files in a specified directory. For each file you create a new row in the table, create a new cell, set the cell text to a clickable hyperlink to the appropriate file and add the row to the ASP.net table. The directories are all relative to the root directory of the website. The pfd files open in a new browser window. If the client does not have Adobe installed, they should get the option of saving the file locally. Hope this helps. James Barash Dim root As String = Server.MapPath(".") & "/" & strDir Dim files() As String files = System.IO.Directory.GetFiles(root, "*") Dim strFilename As String, f as String Table1.Rows.Clear() For Each f In files strFilename = System.IO.Path.GetFileName(f) row = New Web.UI.WebControls.TableRow cell = New Web.UI.WebControls.TableCell cell.Text = "" & strFilename & "" row.Cells.Add(cell) Table1.Rows.Add(row) Next f -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Monday, November 26, 2007 12:15 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Open PDF file I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? 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 From newsgrps at dalyn.co.nz Mon Nov 26 11:27:25 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 27 Nov 2007 06:27:25 +1300 Subject: [dba-VB] Open PDF file In-Reply-To: <01d201c83049$a95699f0$800101df@fci.local> References: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> <01d201c83049$a95699f0$800101df@fci.local> Message-ID: <20071126172524.XYLE18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks all for the responses - I will start looking at them today. Sorry about the confusion - The users open the PDF files on their own computers, not the server. James, to answer your question below, another developer has written the web pages (as part of a larger application) which take a list of records from a table and produces a page which has all the reports available with check boxes beside them. Most of the reports are created from Active Reports (a report add on to Dot Net - it has a very similar graphic interface for developing to Access). When the user has selected the reports they want then a list of ID's is sent to my web application which loops through the ID's, gets the report details (file location, type etc) and merges them together into one PDF for the users to save etc (the Active Report report files can be merged together and exported as PDF's). Because several reports are merged together (and this depends on the user selection) hyperlinks would not work in this case. However, some "reports" are already PDF's and they would be opened as separate files (not merged in with the other reports). These are the ones I am wanting to show in a different browser window. Regards David At 27/11/2007, you wrote: >David: > >How are you displaying the list of files? I do something similar using an >ASP.Net table and adding the filenames as cells with a hyperlink to the >appropiate file on the server. It is the client that needs to have Adobe >installed, not the server since it is the client that renders the file. >Below is the code. It loops through all the files in a specified directory. >For each file you create a new row in the table, create a new cell, set the >cell text to a clickable hyperlink to the appropriate file and add the row >to the ASP.net table. The directories are all relative to the root directory >of the website. The pfd files open in a new browser window. If the client >does not have Adobe installed, they should get the option of saving the file >locally. > >Hope this helps. > >James Barash > >Dim root As String = Server.MapPath(".") & "/" & strDir >Dim files() As String >files = System.IO.Directory.GetFiles(root, "*") >Dim strFilename As String, f as String >Table1.Rows.Clear() >For Each f In files >strFilename = System.IO.Path.GetFileName(f) >row = New Web.UI.WebControls.TableRow >cell = New Web.UI.WebControls.TableCell >cell.Text = "target=""_blank"" >" & strFilename & "" >row.Cells.Add(cell) >Table1.Rows.Add(row) >Next f > > > > >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson >Sent: Monday, November 26, 2007 12:15 AM >To: dba-vb at databaseadvisors.com >Subject: [dba-VB] Open PDF file > >I am using VS 2005 and VB.Net for a web site. > >I have a number of PDF files that are stored in a static folder on the >server. > >Users select from a list on files on a web page and I want to open >the files in Adobe. Adobe reader is installed on the server. > >Can anyone give me a pointer to how I can take a string with path and >file name, and open it? > >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 > >_______________________________________________ >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 Nov 30 11:43:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 12:43:32 -0500 Subject: [dba-VB] SQLBulkCopy error Message-ID: <001e01c83378$8743d1c0$647aa8c0@M90> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? John W. Colby Colby Consulting www.ColbyConsulting.com From Gustav at cactus.dk Fri Nov 30 12:02:47 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 Nov 2007 19:02:47 +0100 Subject: [dba-VB] SQLBulkCopy error Message-ID: Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Nov 30 12:08:38 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 10:08:38 -0800 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: References: Message-ID: Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 Nov 30 12:43:33 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:43:33 -0500 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: References: Message-ID: <002201c83380$e9a58b30$647aa8c0@M90> That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 Nov 30 12:46:21 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:46:21 -0500 Subject: [dba-VB] VS keyboard Message-ID: <002301c83381$4d9642b0$647aa8c0@M90> I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 30 12:51:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:51:25 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: <002301c83381$4d9642b0$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> Message-ID: <002401c83382$0283db60$647aa8c0@M90> Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? 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 garykjos at gmail.com Fri Nov 30 12:56:04 2007 From: garykjos at gmail.com (Gary Kjos) Date: Fri, 30 Nov 2007 12:56:04 -0600 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: Well you have to give us more time than that. Only 5 minutes between question and "I found it myself"? GK On 11/30/07, jwcolby wrote: > Found this one. Boy was that buried... > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.com From carbonnb at gmail.com Fri Nov 30 13:03:23 2007 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Fri, 30 Nov 2007 14:03:23 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: On Nov 30, 2007 1:51 PM, jwcolby wrote: > Found this one. Boy was that buried... Hows about letting us know what it is. For the archive doncha know :) -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From cfoust at infostatsystems.com Fri Nov 30 13:03:02 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 11:03:02 -0800 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: I take it you found File-->Options-->Environment-->Keyboard and discovered the keyboard mapping on the two machines was different? Or was it some other solution? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:51 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 30 13:04:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:04:15 -0500 Subject: [dba-VB] Weird table name restriction Message-ID: <002501c83383$cde18360$647aa8c0@M90> I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Nov 30 13:11:20 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 11:11:20 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <002501c83383$cde18360$647aa8c0@M90> References: <002501c83383$cde18360$647aa8c0@M90> Message-ID: Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Nov 30 13:12:08 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:12:08 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002601c83384$e7e037b0$647aa8c0@M90> Yea, I apologize. I know that there is so much setup stuff that I could well have searched for an hour before finding it. In fact I missed it on my first pass. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Friday, November 30, 2007 1:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Well you have to give us more time than that. Only 5 minutes between question and "I found it myself"? GK On 11/30/07, jwcolby wrote: > Found this one. Boy was that buried... > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.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 Fri Nov 30 13:13:12 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 30 Nov 2007 11:13:12 -0800 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: <002201c83380$e9a58b30$647aa8c0@M90> Message-ID: <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> Check that the Windows account you are using has the correct security privileges. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date: 11/29/2007 8:32 PM From jwcolby at colbyconsulting.com Fri Nov 30 13:18:02 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:18:02 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002a01c83385$bb826110$647aa8c0@M90> In the editor... Tools / Options Check the "show all options" check box in the lower left. Expand environment Keyboard Visual Basic 6 from the combo at the top. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell Sent: Friday, November 30, 2007 2:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard On Nov 30, 2007 1:51 PM, jwcolby wrote: > Found this one. Boy was that buried... Hows about letting us know what it is. For the archive doncha know :) -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" _______________________________________________ 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 Nov 30 13:18:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:18:23 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002b01c83385$c758c650$647aa8c0@M90> That was it. John W. Colby 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, November 30, 2007 2:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard I take it you found File-->Options-->Environment-->Keyboard and discovered the keyboard mapping on the two machines was different? Or was it some other solution? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:51 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? 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 Nov 30 13:21:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:21:32 -0500 Subject: [dba-VB] Weird table name restriction In-Reply-To: References: <002501c83383$cde18360$647aa8c0@M90> Message-ID: <002c01c83386$37c8f450$647aa8c0@M90> The problem is that they are fine (as are spaces) in file names... I am doing a "copy file to temp table, copy temp to permanent". Thus the temp table name is just the file name. I discussed awhile back that I got an "in" or something similar as a file name, which collided with a reserve word. kind of the same issue only different. What a PITA. Keeps me searching for answers long after this thing should just 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 Charlotte Foust Sent: Friday, November 30, 2007 2:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Nov 30 13:22:06 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:22:06 -0500 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> References: <002201c83380$e9a58b30$647aa8c0@M90> <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> Message-ID: <002d01c83386$4c489ac0$647aa8c0@M90> Hmm... well the bulkcopy itself works fine if I remove the provider keyword. John W. Colby 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, November 30, 2007 2:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Check that the Windows account you are using has the correct security privileges. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date: 11/29/2007 8:32 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 Nov 30 13:31:14 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:31:14 -0500 Subject: [dba-VB] Weird table name restriction In-Reply-To: <002c01c83386$37c8f450$647aa8c0@M90> References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> Message-ID: <002e01c83387$92cbcb10$647aa8c0@M90> The strange part is that the code to create the table worked just fine, the table was there. The bulkinsert function just couldn't use it. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 2:22 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction The problem is that they are fine (as are spaces) in file names... I am doing a "copy file to temp table, copy temp to permanent". Thus the temp table name is just the file name. I discussed awhile back that I got an "in" or something similar as a file name, which collided with a reserve word. kind of the same issue only different. What a PITA. Keeps me searching for answers long after this thing should just 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 Charlotte Foust Sent: Friday, November 30, 2007 2:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Fri Nov 30 13:43:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:43:30 -0500 Subject: [dba-VB] Reserved words Message-ID: <002f01c83389$497a0a10$647aa8c0@M90> Does anyone know if the reserved words in SQL Server (can't be used in table names etc) are in a table anywhere (in sql server)? I have code that builds tables and it really needs to check the proposed table name to make sure that the name isn't a reserved word, and that it does not have special characters. I have had TWO times now where I was hunting down errors caused by issues with what is valid in a table name. I could build a table of reserved words but if any new ones are added my list would be short. John W. Colby Colby Consulting www.ColbyConsulting.com From ssharkins at gmail.com Fri Nov 30 14:04:12 2007 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 30 Nov 2007 15:04:12 -0500 Subject: [dba-VB] Reserved words References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: <006401c8338c$340574f0$4b3a8343@SusanOne> http://msdn2.microsoft.com/en-us/library/ms189822.aspx I don't know how comprehensive it is though Susan H. > Does anyone know if the reserved words in SQL Server (can't be used in > table > names etc) are in a table anywhere (in sql server)? I have code that > builds > tables and it really needs to check the proposed table name to make sure > that the name isn't a reserved word, and that it does not have special > characters. I have had TWO times now where I was hunting down errors > caused > by issues with what is valid in a table name. > > I could build a table of reserved words but if any new ones are added my > list would be short. > > 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 ridermark at gmail.com Fri Nov 30 14:06:39 2007 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 Nov 2007 14:06:39 -0600 Subject: [dba-VB] Reserved words In-Reply-To: <002f01c83389$497a0a10$647aa8c0@M90> References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: I have used brackets or/and a prefix to get around this issue. I deal with stocks and to have a table named ASK is not possible, but tblASK or [ASK] works. I prefer the tbl prefix since it is easy to prepend it to the proposed name. On Nov 30, 2007 1:43 PM, jwcolby wrote: > Does anyone know if the reserved words in SQL Server (can't be used in > table > names etc) are in a table anywhere (in sql server)? I have code that > builds > tables and it really needs to check the proposed table name to make sure > that the name isn't a reserved word, and that it does not have special > characters. I have had TWO times now where I was hunting down errors > caused > by issues with what is valid in a table name. > > I could build a table of reserved words but if any new ones are added my > list would be short. > > 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 > > -- Mark Rider http://commonsensesecurity.info Try to learn something about everything and everything about something. - Thomas H. Huxley From ridermark at gmail.com Fri Nov 30 14:08:15 2007 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 Nov 2007 14:08:15 -0600 Subject: [dba-VB] Reserved words In-Reply-To: References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: Spell check did a number on that - it is supposed to be ASC, not ASK. On Nov 30, 2007 2:06 PM, Mark Rider wrote: > I have used brackets or/and a prefix to get around this issue. I deal > with stocks and to have a table named ASK is not possible, but tblASK or > [ASK] works. I prefer the tbl prefix since it is easy to prepend it to the > proposed name. > > -- Mark Rider http://commonsensesecurity.info Try to learn something about everything and everything about something. - Thomas H. Huxley From robert at webedb.com Fri Nov 30 14:22:16 2007 From: robert at webedb.com (Robert L. Stewart) Date: Fri, 30 Nov 2007 14:22:16 -0600 Subject: [dba-VB] Weird table name restriction In-Reply-To: References: Message-ID: <200711302023.lAUKNhnG027841@databaseadvisors.com> John, Use [] around the name and you can use special characters. Robert At 01:13 PM 11/30/2007, you wrote: >Date: Fri, 30 Nov 2007 14:04:15 -0500 >From: "jwcolby" >Subject: [dba-VB] Weird table name restriction >To: , > >Message-ID: <002501c83383$cde18360$647aa8c0 at M90> >Content-Type: text/plain; charset="US-ASCII" > >I just discovered that SQL Server (or VB.Net) does not like dashes in table >names. > >If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an >error "can't access destination table" but if I remove the dash "ZIP4AA_X" >it works just fine. > >The problem is that I take the name of the datafile, strip off the extension >and use that as my table name. Thus I now have to start doing edits of the >file name before I can use it as a field name. > >The hoops we have to jump through... > >John W. Colby >Colby Consulting >www.ColbyConsulting.com From wdhindman at dejpolsystems.com Fri Nov 30 18:30:48 2007 From: wdhindman at dejpolsystems.com (William Hindman) Date: Fri, 30 Nov 2007 19:30:48 -0500 Subject: [dba-VB] Weird table name restriction References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> Message-ID: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> "What a PITA. Keeps me searching for answers long after this thing should just work." jc ...my life as a developer :( William ----- Original Message ----- From: "jwcolby" To: Sent: Friday, November 30, 2007 2:21 PM Subject: Re: [dba-VB] Weird table name restriction > The problem is that they are fine (as are spaces) in file names... > > I am doing a "copy file to temp table, copy temp to permanent". Thus the > temp table name is just the file name. I discussed awhile back that I got > an "in" or something similar as a file name, which collided with a reserve > word. kind of the same issue only different. > > What a PITA. Keeps me searching for answers long after this thing should > just 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 Charlotte Foust > Sent: Friday, November 30, 2007 2:11 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Weird table name restriction > > Yep, dashes are as bad as spaces. ;-} > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, November 30, 2007 11:04 AM > To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com > Subject: [dba-VB] Weird table name restriction > > I just discovered that SQL Server (or VB.Net) does not like dashes in > table > names. > > If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an > error "can't access destination table" but if I remove the dash "ZIP4AA_X" > it works just fine. > > The problem is that I take the name of the datafile, strip off the > extension > and use that as my table name. Thus I now have to start doing edits of > the > file name before I can use it as a field name. > > The hoops we have to jump through... > > 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 cfoust at infostatsystems.com Fri Nov 30 18:45:10 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 16:45:10 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> References: <002501c83383$cde18360$647aa8c0@M90><002c01c83386$37c8f450$647aa8c0@M90> <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: Right! Those pesky, literal-minded computers! They insist on doing what I tell them instead of what I WANT. LOL Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of William Hindman Sent: Friday, November 30, 2007 4:31 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction "What a PITA. Keeps me searching for answers long after this thing should just work." jc ...my life as a developer :( William ----- Original Message ----- From: "jwcolby" To: Sent: Friday, November 30, 2007 2:21 PM Subject: Re: [dba-VB] Weird table name restriction > The problem is that they are fine (as are spaces) in file names... > > I am doing a "copy file to temp table, copy temp to permanent". Thus the > temp table name is just the file name. I discussed awhile back that I got > an "in" or something similar as a file name, which collided with a reserve > word. kind of the same issue only different. > > What a PITA. Keeps me searching for answers long after this thing should > just 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 Charlotte Foust > Sent: Friday, November 30, 2007 2:11 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Weird table name restriction > > Yep, dashes are as bad as spaces. ;-} > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, November 30, 2007 11:04 AM > To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com > Subject: [dba-VB] Weird table name restriction > > I just discovered that SQL Server (or VB.Net) does not like dashes in > table > names. > > If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an > error "can't access destination table" but if I remove the dash "ZIP4AA_X" > it works just fine. > > The problem is that I take the name of the datafile, strip off the > extension > and use that as my table name. Thus I now have to start doing edits of > the > file name before I can use it as a field name. > > The hoops we have to jump through... > > 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 aip2000 at codewords.com Fri Nov 30 18:50:26 2007 From: aip2000 at codewords.com (Bill Klemens) Date: Fri, 30 Nov 2007 16:50:26 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: <4750AFD2.5010006@codewords.com> >> Thus I now have to start doing edits of >> the >> file name before I can use it as a field name. >> >> The hoops we have to jump through... >> >> John W. Colby >> Colby Consulting >> www.ColbyConsulting.com >> If you're using unedited (unsanitized) data to build SQL statements you could put yourself in a bad position. http://xkcd.com/327/ Bill From ssharkins at gmail.com Fri Nov 30 18:50:45 2007 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 30 Nov 2007 19:50:45 -0500 Subject: [dba-VB] Weird table name restriction References: <002501c83383$cde18360$647aa8c0@M90><002c01c83386$37c8f450$647aa8c0@M90><001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: <001401c833b4$365ccb40$4b3a8343@SusanOne> I have always wished for a computer that would do want I expect rather than what I tell it! ;) Ohhhhhhhh, why can't a computer think more like me, more like me, more like me.... Susan H. > Right! Those pesky, literal-minded computers! They insist on doing > what I tell them instead of what I WANT. LOL From jwcolby at colbyconsulting.com Fri Nov 30 23:04:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 1 Dec 2007 00:04:05 -0500 Subject: [dba-VB] Truncate a log file from code Message-ID: <004701c833d7$99526c00$647aa8c0@M90> I am doing an entire directory of files, using SQLBulkCopy to import the text files into a temp table, and from there into a permanent table. The log file is about the same size as the data file. Is it possible to truncate the log file after every file import in order to minimize the disk impact? If so can you point me to example code? John W. Colby Colby Consulting www.ColbyConsulting.com From newsgrps at dalyn.co.nz Thu Nov 1 12:10:52 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 02 Nov 2007 06:10:52 +1300 Subject: [dba-VB] Web Developer wanted VB Dot Net Message-ID: <20071101170935.GIOL18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Group, I have had one response to my previous message, but the company I am working for would like a few options. If anyone else is interested please email me off line. I have an access program that has been converted to a Web site written using Visual Studio 2003 and VB.Net. The conversion was done by another developer as a favour for the company that owns the software. We are now looking for a web developer that can do the following: 1) Continue to maintain the web version. This should be basic maintenance of the screens. The database is SQL2000 and I can maintain this. The reports are developed using DataDynamics Active Report. I can also maintain these. What I can't do is the actual web site maintenance. Medium term we would be looking to upgrade this to Visual Studio 2005. 2) The company has another project that they want converted from a desk top version to the web. This project would involve interaction with the developer of the desk top version - he is also not familiar with web development. This would be a major project. 3) There would be other web projects that would come up as well. Based on my previous experience with this company, there would be ongoing work required on a regular basis. The company that we would be working for is based in Chicago. However, I have been developing for them for over 10 years and I am in NZ. If you are interested in more information please email me off line with a phone number and a suitable time to call (preferably your afternoon if you are in America due to the time difference) Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From jwcolby at colbyconsulting.com Tue Nov 13 06:42:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 07:42:30 -0500 Subject: [dba-VB] Iterating class properties Message-ID: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Nov 13 07:34:22 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 08:34:22 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: <00e701c825f9$e75ff890$6c7aa8c0@M90> In answer to my own question, I found this... http://articles.techrepublic.com.com/5100-22-1050654.html#comments It could be very useful in some circumstances. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Nov 13 07:54:18 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 08:54:18 -0500 Subject: [dba-VB] SP to create C# classes Message-ID: <00e901c825fc$b018f0f0$6c7aa8c0@M90> I ran across this this morning. http://www.sqlservercentral.com/scripts/Miscellaneous/31997/ I have not tested it yet but thought that someone might find it useful. John W. Colby Colby Consulting www.ColbyConsulting.com From dwaters at usinternet.com Tue Nov 13 09:07:21 2007 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 13 Nov 2007 09:07:21 -0600 Subject: [dba-VB] VB.Net / C# Guidelines Message-ID: <001f01c82606$e454ef90$0200a8c0@danwaters> VB City is offering a free download (100 pages) of coding guidelines. http://submain.com/?nav=products.guidelines From mmattys at rochester.rr.com Tue Nov 13 09:16:34 2007 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Tue, 13 Nov 2007 10:16:34 -0500 Subject: [dba-VB] VB.Net / C# Guidelines References: <001f01c82606$e454ef90$0200a8c0@danwaters> Message-ID: <008b01c82608$2e9b6970$0202a8c0@Laptop> Hi Dan, Thanks. I'm planning on buying VS 2008 when it comes out. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Dan Waters" To: Sent: Tuesday, November 13, 2007 10:07 AM Subject: [dba-VB] VB.Net / C# Guidelines > VB City is offering a free download (100 pages) of coding guidelines. > > http://submain.com/?nav=products.guidelines > > > > > > _______________________________________________ > 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 Tue Nov 13 09:38:31 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Nov 2007 07:38:31 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: What exactly are you trying to do, John? A tool like CodeGen should take care of creating the XML for you, but I don't really understand your question. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 4:42 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Tue Nov 13 10:54:54 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 13 Nov 2007 10:54:54 -0600 Subject: [dba-VB] Iterating class properties In-Reply-To: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 jwcolby at colbyconsulting.com Tue Nov 13 11:14:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 12:14:25 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> Message-ID: <000d01c82618$a4be3aa0$6c7aa8c0@M90> Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ 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 Tue Nov 13 11:24:31 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Nov 2007 09:24:31 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: <000d01c82618$a4be3aa0$6c7aa8c0@M90> References: <00e301c825f2$a8d035b0$6c7aa8c0@M90> <000d01c82618$a4be3aa0$6c7aa8c0@M90> Message-ID: John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 Nov 13 11:46:12 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Nov 2007 12:46:12 -0500 Subject: [dba-VB] Iterating class properties In-Reply-To: References: <00e301c825f2$a8d035b0$6c7aa8c0@M90><000d01c82618$a4be3aa0$6c7aa8c0@M90> Message-ID: <001301c8261d$15602a30$6c7aa8c0@M90> Well, I asked you this question earlier and didn't really receive a usable response. If I have a class and want to persist it to a table, how do I do so? I can persist it to an XML file, though even there I still do not know how to get the data type tags to embed in the XML file. So to persist a class to a table I would have to persist it to an XML file, discover how to write the data type tags out to the XML file, then read the data back in to SQL Server. Why would I do that if I could read the class properties and data types directly then use a data adapter or write SQL to build the table. In fact I got so far as to export to XML and then pull back in to a data adapter but the adapter threw an error when I tried to save to SQL Server because the table did not already exist. Even in this case I was missing the data type information because no one could point me to how to export the data type to XML as well. I am importing files from CSV and flat files. In many cases I get a "spec" that tells me the field names and values, but in some cases I don't even get that, just the name and "starts at / ends at" (fixed width files). People throw anything into these files and it is my job to recover the data. John W. Colby 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: Tuesday, November 13, 2007 12:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 Tue Nov 13 12:53:26 2007 From: ebarro at verizon.net (Eric Barro) Date: Tue, 13 Nov 2007 10:53:26 -0800 Subject: [dba-VB] Iterating class properties In-Reply-To: Message-ID: <0JRG0046HKH2IFD3@vms040.mailsrvcs.net> .NET handles this well Drew. In VB Dim wd as Widget = New Widget() Wd.Height = 10 In C# Widet wd = new Widget(); Wd.Height = 10; -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 8:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ From DWUTKA at Marlow.com Tue Nov 13 14:13:50 2007 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 13 Nov 2007 14:13:50 -0600 Subject: [dba-VB] Iterating class properties In-Reply-To: <0JRG0046HKH2IFD3@vms040.mailsrvcs.net> Message-ID: Ummmmm, not what I was saying. In VB 6, with my classes property, I can go: Wd.Height or wd.Properties("Height") Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Tuesday, November 13, 2007 12:53 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties .NET handles this well Drew. In VB Dim wd as Widget = New Widget() Wd.Height = 10 In C# Widet wd = new Widget(); Wd.Height = 10; -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 8:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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 Tue Nov 13 14:53:39 2007 From: shamil at users.mns.ru (Shamil Salakhetdinov) Date: Tue, 13 Nov 2007 23:53:39 +0300 Subject: [dba-VB] Iterating class properties In-Reply-To: <001301c8261d$15602a30$6c7aa8c0@M90> Message-ID: <000601c82637$44ca1410$6401a8c0@nant> Hello John, The answer is System.Reflection namespace: Imports System.Reflection Module Module1 Public Class Test Public ReadOnly Property One() As String Get Return "test" End Get End Property Private _prp2 As String Public WriteOnly Property Two() As String Set(ByVal value As String) _prp2 = value End Set End Property Public ReadOnly Property Three() As Double Get Return One + _prp2 End Get End Property End Class Sub Main() Dim a As Assembly = System.Reflection.Assembly.GetExecutingAssembly() For Each t As Type In _ System.Reflection.Assembly.GetExecutingAssembly().GetTypes() If t.ToString.EndsWith("Test") Then Console.WriteLine(t.ToString()) For Each m As MemberInfo In t.GetMembers() If m.MemberType = MemberTypes.Property Then Console.WriteLine(" " + m.Name) End If Next End If Next End Sub End Module HTH. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 8:46 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Well, I asked you this question earlier and didn't really receive a usable response. If I have a class and want to persist it to a table, how do I do so? I can persist it to an XML file, though even there I still do not know how to get the data type tags to embed in the XML file. So to persist a class to a table I would have to persist it to an XML file, discover how to write the data type tags out to the XML file, then read the data back in to SQL Server. Why would I do that if I could read the class properties and data types directly then use a data adapter or write SQL to build the table. In fact I got so far as to export to XML and then pull back in to a data adapter but the adapter threw an error when I tried to save to SQL Server because the table did not already exist. Even in this case I was missing the data type information because no one could point me to how to export the data type to XML as well. I am importing files from CSV and flat files. In many cases I get a "spec" that tells me the field names and values, but in some cases I don't even get that, just the name and "starts at / ends at" (fixed width files). People throw anything into these files and it is my job to recover the data. John W. Colby 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: Tuesday, November 13, 2007 12:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties John, I think you may be reinventing the wheel, or at least the roller. DataAdapters will handle all or most of this for you. The Adapter/typed dataset KNOWS what the fields are, what the field types are, whether it allows nulls, whether it's a key field, whether the field or record is read only, etc. Obviously, I'm missing something here because I work with tables that already exist or with xml data sources. We use SQL scripts to build new databases/tables in SQL Server. You can build an adapter for a non-existent table and then use it to write the table as well. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 9:14 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties Charlotte, Drew, What I am trying to accomplish is to be able to dynamically, at run time, get a list of all properties of a class. This allows me to compare values between any two (or more) class instances of any class. Suppose (for example) I wanted to merge 4 records in a table into a single table. I don't know what the field names are but I want to load the table records into classes and then go comparing one record against the next. Suppose I want to know the data type of a property of a class at run time? I have a class I want to persist to a table. The table does not exist yet. I need to find out what data the table holds, build a table with fields to hold that data. I need to discover what the properties of the class are (what data is read / writeable) and what types of data do they hold? I can then build SQL statements to build a table to match the class, right then, on the fly. Pass in a class, pop out a table in SQL Server. I have found the answer it seems. I am not sure I understand it yet though. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, November 13, 2007 11:55 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Iterating class properties What are you trying to accomplish? I don't use .Net very often, still do most of my stuff in VB 6. But I wanted a way to dynamically capture my class properties. For example, let's say I had Widget, and it had Height and Width properties. I wanted to be able to do this: Dim wd as Widget Set wd=new Widget Wd.Properties("Height")=10 Or Dim wd as Widget Dim I as long Set wd=new Widget For i=1 to wd.Properties.Count Wd.Properties(i)=15 Next i I don't know if .Net has this capability, VB 6 didn't natively, but I was able to 'spoof' the ability. I created an Add-in that let's me create a Properties property for a class. When you run the Add-in, it goes through all of the properties in your class, and creates statements to simulate the abilities above. It's adding a lot of extra code to do this, but in some situations I have run into, it's worth it...plus, all the properties are left alone, so I can use them like I normally would. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, November 13, 2007 6:43 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Iterating class properties Does anyone know a way to iterate the properties of a class in VB.Net or C#.Net (or in .Net in general)? There is built-in functionality to store classes out to XML files and this stuff does exactly that, apparently using only the Get/Let statements, i.e. if there is not both a get and let statement for a property then the process fails to convert that property to XML. So if MS does it, is that capability publicly available? Is there a property iterator buried in the innards of the class object? 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. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Nov 19 13:29:13 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 19 Nov 2007 14:29:13 -0500 Subject: [dba-VB] Action Pack Subscribers Message-ID: <00d101c82ae2$784fcb90$6c7aa8c0@M90> For those of you doing Web stuff I just found this: https://partner.microsoft.com/us/40047166 John W. Colby Colby Consulting www.ColbyConsulting.com From carbonnb at gmail.com Wed Nov 21 07:02:59 2007 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Wed, 21 Nov 2007 08:02:59 -0500 Subject: [dba-VB] Download VS2008 Express Editions Message-ID: Here is a link to let you download the new VS 2008 Express editions from MS. http://www.microsoft.com/express/download/ Currently the following versions are available: VB 2008 Web Developer 2008 C# 2008 C++ 2008 SQL Server 2005, but apparently it will be updated to SQL Server 2008 when it's available. Now all I gotta do is find the time to learn it :( -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From wdhindman at dejpolsystems.com Wed Nov 21 10:33:50 2007 From: wdhindman at dejpolsystems.com (William Hindman) Date: Wed, 21 Nov 2007 11:33:50 -0500 Subject: [dba-VB] Download VS2008 Express Editions References: Message-ID: <000f01c82c5c$4c799930$ef706c4c@jisshowsbs.local> ...I've spent all morning installing, configuring, and getting my feet wet in vswd'8 ...love it so far ...I dl'd the iso image with all of the editions and burned a cd ...have to take a look at the vb and c# versions this weekend. William ----- Original Message ----- From: "Bryan Carbonnell" To: Sent: Wednesday, November 21, 2007 8:02 AM Subject: [dba-VB] Download VS2008 Express Editions > Here is a link to let you download the new VS 2008 Express editions from > MS. > > http://www.microsoft.com/express/download/ > > Currently the following versions are available: > VB 2008 > Web Developer 2008 > C# 2008 > C++ 2008 > SQL Server 2005, but apparently it will be updated to SQL Server 2008 > when it's available. > > Now all I gotta do is find the time to learn it :( > > -- > Bryan Carbonnell - carbonnb at gmail.com > Life's journey is not to arrive at the grave safely in a well > preserved body, but rather to skid in sideways, totally worn out, > shouting "What a great ride!" > _______________________________________________ > 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 Sun Nov 25 23:14:39 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 26 Nov 2007 18:14:39 +1300 Subject: [dba-VB] Open PDF file Message-ID: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Mon Nov 26 07:43:24 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 14:43:24 +0100 Subject: [dba-VB] Open PDF file Message-ID: Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Gustav at cactus.dk Mon Nov 26 07:52:13 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 14:52:13 +0100 Subject: [dba-VB] Launch and monitor external programs from .NET (was: Open PDF file) Message-ID: Hi David et al A lot of useful things can be done with the Process class. Some examples here: http://www.thescarms.com/dotnet/Process.aspx /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From JHewson at karta.com Mon Nov 26 08:37:38 2007 From: JHewson at karta.com (Jim Hewson) Date: Mon, 26 Nov 2007 08:37:38 -0600 Subject: [dba-VB] Open PDF file References: Message-ID: <1C877227AE9F2A4BB20BABE94325D15B03017A@exchange.Karta.com> Doesn't the PDF reader need to be on the user's machine? How does this open a file on a server so the user, presumably somewhere else, open the file and review it? I thought the user must have Adobe reader on their machine. Jim jhewson at karta.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, November 26, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Open PDF file Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? 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 From Gustav at cactus.dk Mon Nov 26 08:48:15 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 26 Nov 2007 15:48:15 +0100 Subject: [dba-VB] Open PDF file Message-ID: Hi Jim You may be right - I didn't read the question in full, I can see now, sorry. However, there seems to be some misunderstanding ... the user's browser can open an pdf file if the Adobe Reader add-in is installed, but the file is downloaded from the web server; as far as I know, the server can not "display" an pdf file, only pass it on. /gustav >>> JHewson at karta.com 26-11-2007 15:37 >>> Doesn't the PDF reader need to be on the user's machine? How does this open a file on a server so the user, presumably somewhere else, open the file and review it? I thought the user must have Adobe reader on their machine. Jim jhewson at karta.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, November 26, 2007 7:43 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Open PDF file Hi David This works for me having Acrobat Reader as the default viewer in Windows: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim runPdf As New System.Diagnostics.Process Dim fileName As String = "c:\test.pdf" runPdf.StartInfo.FileName = fileName runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal runPdf.Start() runPdf.WaitForExit() runPdf.Close() runPdf = Nothing End Sub /gustav >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>> I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From James at fcidms.com Mon Nov 26 10:30:30 2007 From: James at fcidms.com (James Barash) Date: Mon, 26 Nov 2007 11:30:30 -0500 Subject: [dba-VB] Open PDF file In-Reply-To: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <01d201c83049$a95699f0$800101df@fci.local> David: How are you displaying the list of files? I do something similar using an ASP.Net table and adding the filenames as cells with a hyperlink to the appropiate file on the server. It is the client that needs to have Adobe installed, not the server since it is the client that renders the file. Below is the code. It loops through all the files in a specified directory. For each file you create a new row in the table, create a new cell, set the cell text to a clickable hyperlink to the appropriate file and add the row to the ASP.net table. The directories are all relative to the root directory of the website. The pfd files open in a new browser window. If the client does not have Adobe installed, they should get the option of saving the file locally. Hope this helps. James Barash Dim root As String = Server.MapPath(".") & "/" & strDir Dim files() As String files = System.IO.Directory.GetFiles(root, "*") Dim strFilename As String, f as String Table1.Rows.Clear() For Each f In files strFilename = System.IO.Path.GetFileName(f) row = New Web.UI.WebControls.TableRow cell = New Web.UI.WebControls.TableCell cell.Text = "" & strFilename & "" row.Cells.Add(cell) Table1.Rows.Add(row) Next f -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Monday, November 26, 2007 12:15 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Open PDF file I am using VS 2005 and VB.Net for a web site. I have a number of PDF files that are stored in a static folder on the server. Users select from a list on files on a web page and I want to open the files in Adobe. Adobe reader is installed on the server. Can anyone give me a pointer to how I can take a string with path and file name, and open it? 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 From newsgrps at dalyn.co.nz Mon Nov 26 11:27:25 2007 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 27 Nov 2007 06:27:25 +1300 Subject: [dba-VB] Open PDF file In-Reply-To: <01d201c83049$a95699f0$800101df@fci.local> References: <20071126051141.GRVW18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> <01d201c83049$a95699f0$800101df@fci.local> Message-ID: <20071126172524.XYLE18083.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks all for the responses - I will start looking at them today. Sorry about the confusion - The users open the PDF files on their own computers, not the server. James, to answer your question below, another developer has written the web pages (as part of a larger application) which take a list of records from a table and produces a page which has all the reports available with check boxes beside them. Most of the reports are created from Active Reports (a report add on to Dot Net - it has a very similar graphic interface for developing to Access). When the user has selected the reports they want then a list of ID's is sent to my web application which loops through the ID's, gets the report details (file location, type etc) and merges them together into one PDF for the users to save etc (the Active Report report files can be merged together and exported as PDF's). Because several reports are merged together (and this depends on the user selection) hyperlinks would not work in this case. However, some "reports" are already PDF's and they would be opened as separate files (not merged in with the other reports). These are the ones I am wanting to show in a different browser window. Regards David At 27/11/2007, you wrote: >David: > >How are you displaying the list of files? I do something similar using an >ASP.Net table and adding the filenames as cells with a hyperlink to the >appropiate file on the server. It is the client that needs to have Adobe >installed, not the server since it is the client that renders the file. >Below is the code. It loops through all the files in a specified directory. >For each file you create a new row in the table, create a new cell, set the >cell text to a clickable hyperlink to the appropriate file and add the row >to the ASP.net table. The directories are all relative to the root directory >of the website. The pfd files open in a new browser window. If the client >does not have Adobe installed, they should get the option of saving the file >locally. > >Hope this helps. > >James Barash > >Dim root As String = Server.MapPath(".") & "/" & strDir >Dim files() As String >files = System.IO.Directory.GetFiles(root, "*") >Dim strFilename As String, f as String >Table1.Rows.Clear() >For Each f In files >strFilename = System.IO.Path.GetFileName(f) >row = New Web.UI.WebControls.TableRow >cell = New Web.UI.WebControls.TableCell >cell.Text = "target=""_blank"" >" & strFilename & "" >row.Cells.Add(cell) >Table1.Rows.Add(row) >Next f > > > > >-----Original Message----- >From: dba-vb-bounces at databaseadvisors.com >[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David Emerson >Sent: Monday, November 26, 2007 12:15 AM >To: dba-vb at databaseadvisors.com >Subject: [dba-VB] Open PDF file > >I am using VS 2005 and VB.Net for a web site. > >I have a number of PDF files that are stored in a static folder on the >server. > >Users select from a list on files on a web page and I want to open >the files in Adobe. Adobe reader is installed on the server. > >Can anyone give me a pointer to how I can take a string with path and >file name, and open it? > >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 > >_______________________________________________ >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 Nov 30 11:43:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 12:43:32 -0500 Subject: [dba-VB] SQLBulkCopy error Message-ID: <001e01c83378$8743d1c0$647aa8c0@M90> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? John W. Colby Colby Consulting www.ColbyConsulting.com From Gustav at cactus.dk Fri Nov 30 12:02:47 2007 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 Nov 2007 19:02:47 +0100 Subject: [dba-VB] SQLBulkCopy error Message-ID: Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Nov 30 12:08:38 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 10:08:38 -0800 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: References: Message-ID: Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 Nov 30 12:43:33 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:43:33 -0500 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: References: Message-ID: <002201c83380$e9a58b30$647aa8c0@M90> That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 Nov 30 12:46:21 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:46:21 -0500 Subject: [dba-VB] VS keyboard Message-ID: <002301c83381$4d9642b0$647aa8c0@M90> I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 30 12:51:25 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 13:51:25 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: <002301c83381$4d9642b0$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> Message-ID: <002401c83382$0283db60$647aa8c0@M90> Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? 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 garykjos at gmail.com Fri Nov 30 12:56:04 2007 From: garykjos at gmail.com (Gary Kjos) Date: Fri, 30 Nov 2007 12:56:04 -0600 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: Well you have to give us more time than that. Only 5 minutes between question and "I found it myself"? GK On 11/30/07, jwcolby wrote: > Found this one. Boy was that buried... > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.com From carbonnb at gmail.com Fri Nov 30 13:03:23 2007 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Fri, 30 Nov 2007 14:03:23 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: On Nov 30, 2007 1:51 PM, jwcolby wrote: > Found this one. Boy was that buried... Hows about letting us know what it is. For the archive doncha know :) -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From cfoust at infostatsystems.com Fri Nov 30 13:03:02 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 11:03:02 -0800 Subject: [dba-VB] VS keyboard In-Reply-To: <002401c83382$0283db60$647aa8c0@M90> References: <002301c83381$4d9642b0$647aa8c0@M90> <002401c83382$0283db60$647aa8c0@M90> Message-ID: I take it you found File-->Options-->Environment-->Keyboard and discovered the keyboard mapping on the two machines was different? Or was it some other solution? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:51 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Nov 30 13:04:15 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:04:15 -0500 Subject: [dba-VB] Weird table name restriction Message-ID: <002501c83383$cde18360$647aa8c0@M90> I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... John W. Colby Colby Consulting www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Nov 30 13:11:20 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 11:11:20 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <002501c83383$cde18360$647aa8c0@M90> References: <002501c83383$cde18360$647aa8c0@M90> Message-ID: Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Nov 30 13:12:08 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:12:08 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002601c83384$e7e037b0$647aa8c0@M90> Yea, I apologize. I know that there is so much setup stuff that I could well have searched for an hour before finding it. In fact I missed it on my first pass. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Friday, November 30, 2007 1:56 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Well you have to give us more time than that. Only 5 minutes between question and "I found it myself"? GK On 11/30/07, jwcolby wrote: > Found this one. Boy was that buried... > > > John W. Colby > Colby Consulting > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.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 Fri Nov 30 13:13:12 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 30 Nov 2007 11:13:12 -0800 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: <002201c83380$e9a58b30$647aa8c0@M90> Message-ID: <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> Check that the Windows account you are using has the correct security privileges. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date: 11/29/2007 8:32 PM From jwcolby at colbyconsulting.com Fri Nov 30 13:18:02 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:18:02 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002a01c83385$bb826110$647aa8c0@M90> In the editor... Tools / Options Check the "show all options" check box in the lower left. Expand environment Keyboard Visual Basic 6 from the combo at the top. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell Sent: Friday, November 30, 2007 2:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard On Nov 30, 2007 1:51 PM, jwcolby wrote: > Found this one. Boy was that buried... Hows about letting us know what it is. For the archive doncha know :) -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" _______________________________________________ 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 Nov 30 13:18:23 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:18:23 -0500 Subject: [dba-VB] VS keyboard In-Reply-To: References: <002301c83381$4d9642b0$647aa8c0@M90><002401c83382$0283db60$647aa8c0@M90> Message-ID: <002b01c83385$c758c650$647aa8c0@M90> That was it. John W. Colby 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, November 30, 2007 2:03 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard I take it you found File-->Options-->Environment-->Keyboard and discovered the keyboard mapping on the two machines was different? Or was it some other solution? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:51 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS keyboard Found this one. Boy was that buried... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 1:46 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS keyboard I have differences between the keyboard shortcuts on my laptop and on my desktop. On my laptop, Shft F8 steps code whereas on the desktop it is not a menu item in debug and the shortcut does not work. I suspect that I told VS to use the old shortcuts somehwo (on my laptop) but I cannot seem to find it on the desktop. Any clues? 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 Nov 30 13:21:32 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:21:32 -0500 Subject: [dba-VB] Weird table name restriction In-Reply-To: References: <002501c83383$cde18360$647aa8c0@M90> Message-ID: <002c01c83386$37c8f450$647aa8c0@M90> The problem is that they are fine (as are spaces) in file names... I am doing a "copy file to temp table, copy temp to permanent". Thus the temp table name is just the file name. I discussed awhile back that I got an "in" or something similar as a file name, which collided with a reserve word. kind of the same issue only different. What a PITA. Keeps me searching for answers long after this thing should just 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 Charlotte Foust Sent: Friday, November 30, 2007 2:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Nov 30 13:22:06 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:22:06 -0500 Subject: [dba-VB] SQLBulkCopy error In-Reply-To: <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> References: <002201c83380$e9a58b30$647aa8c0@M90> <0JSC00MF92N7FT80@vms173003.mailsrvcs.net> Message-ID: <002d01c83386$4c489ac0$647aa8c0@M90> Hmm... well the bulkcopy itself works fine if I remove the provider keyword. John W. Colby 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, November 30, 2007 2:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Check that the Windows account you are using has the correct security privileges. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 10:44 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error That's not it. John W. Colby 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, November 30, 2007 1:09 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Yeah, I would first remove those spaces around the equals signs. I've run into problems there before. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, November 30, 2007 10:03 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] SQLBulkCopy error Hi John You probably need to remove either the spaces around the equal signs or (more likely) the complete Provider entry. /gustav >>> jwcolby at colbyconsulting.com 30-11-2007 18:43 >>> I have a program that has been running fine which now throws an error: "Data Source = M90\M90;Initial Catalog = ZipPlus4;Provider = SQLOLEDB;Integrated Security=SSPI" claiming Keyword not supported - Provider This is just a standard connection string, and Provider is a standard keyword. Any thoughts? 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 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date: 11/29/2007 8:32 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 Nov 30 13:31:14 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:31:14 -0500 Subject: [dba-VB] Weird table name restriction In-Reply-To: <002c01c83386$37c8f450$647aa8c0@M90> References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> Message-ID: <002e01c83387$92cbcb10$647aa8c0@M90> The strange part is that the code to create the table worked just fine, the table was there. The bulkinsert function just couldn't use it. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 2:22 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction The problem is that they are fine (as are spaces) in file names... I am doing a "copy file to temp table, copy temp to permanent". Thus the temp table name is just the file name. I discussed awhile back that I got an "in" or something similar as a file name, which collided with a reserve word. kind of the same issue only different. What a PITA. Keeps me searching for answers long after this thing should just 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 Charlotte Foust Sent: Friday, November 30, 2007 2:11 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction Yep, dashes are as bad as spaces. ;-} Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, November 30, 2007 11:04 AM To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com Subject: [dba-VB] Weird table name restriction I just discovered that SQL Server (or VB.Net) does not like dashes in table names. If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an error "can't access destination table" but if I remove the dash "ZIP4AA_X" it works just fine. The problem is that I take the name of the datafile, strip off the extension and use that as my table name. Thus I now have to start doing edits of the file name before I can use it as a field name. The hoops we have to jump through... 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 Fri Nov 30 13:43:30 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 30 Nov 2007 14:43:30 -0500 Subject: [dba-VB] Reserved words Message-ID: <002f01c83389$497a0a10$647aa8c0@M90> Does anyone know if the reserved words in SQL Server (can't be used in table names etc) are in a table anywhere (in sql server)? I have code that builds tables and it really needs to check the proposed table name to make sure that the name isn't a reserved word, and that it does not have special characters. I have had TWO times now where I was hunting down errors caused by issues with what is valid in a table name. I could build a table of reserved words but if any new ones are added my list would be short. John W. Colby Colby Consulting www.ColbyConsulting.com From ssharkins at gmail.com Fri Nov 30 14:04:12 2007 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 30 Nov 2007 15:04:12 -0500 Subject: [dba-VB] Reserved words References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: <006401c8338c$340574f0$4b3a8343@SusanOne> http://msdn2.microsoft.com/en-us/library/ms189822.aspx I don't know how comprehensive it is though Susan H. > Does anyone know if the reserved words in SQL Server (can't be used in > table > names etc) are in a table anywhere (in sql server)? I have code that > builds > tables and it really needs to check the proposed table name to make sure > that the name isn't a reserved word, and that it does not have special > characters. I have had TWO times now where I was hunting down errors > caused > by issues with what is valid in a table name. > > I could build a table of reserved words but if any new ones are added my > list would be short. > > 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 ridermark at gmail.com Fri Nov 30 14:06:39 2007 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 Nov 2007 14:06:39 -0600 Subject: [dba-VB] Reserved words In-Reply-To: <002f01c83389$497a0a10$647aa8c0@M90> References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: I have used brackets or/and a prefix to get around this issue. I deal with stocks and to have a table named ASK is not possible, but tblASK or [ASK] works. I prefer the tbl prefix since it is easy to prepend it to the proposed name. On Nov 30, 2007 1:43 PM, jwcolby wrote: > Does anyone know if the reserved words in SQL Server (can't be used in > table > names etc) are in a table anywhere (in sql server)? I have code that > builds > tables and it really needs to check the proposed table name to make sure > that the name isn't a reserved word, and that it does not have special > characters. I have had TWO times now where I was hunting down errors > caused > by issues with what is valid in a table name. > > I could build a table of reserved words but if any new ones are added my > list would be short. > > 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 > > -- Mark Rider http://commonsensesecurity.info Try to learn something about everything and everything about something. - Thomas H. Huxley From ridermark at gmail.com Fri Nov 30 14:08:15 2007 From: ridermark at gmail.com (Mark Rider) Date: Fri, 30 Nov 2007 14:08:15 -0600 Subject: [dba-VB] Reserved words In-Reply-To: References: <002f01c83389$497a0a10$647aa8c0@M90> Message-ID: Spell check did a number on that - it is supposed to be ASC, not ASK. On Nov 30, 2007 2:06 PM, Mark Rider wrote: > I have used brackets or/and a prefix to get around this issue. I deal > with stocks and to have a table named ASK is not possible, but tblASK or > [ASK] works. I prefer the tbl prefix since it is easy to prepend it to the > proposed name. > > -- Mark Rider http://commonsensesecurity.info Try to learn something about everything and everything about something. - Thomas H. Huxley From robert at webedb.com Fri Nov 30 14:22:16 2007 From: robert at webedb.com (Robert L. Stewart) Date: Fri, 30 Nov 2007 14:22:16 -0600 Subject: [dba-VB] Weird table name restriction In-Reply-To: References: Message-ID: <200711302023.lAUKNhnG027841@databaseadvisors.com> John, Use [] around the name and you can use special characters. Robert At 01:13 PM 11/30/2007, you wrote: >Date: Fri, 30 Nov 2007 14:04:15 -0500 >From: "jwcolby" >Subject: [dba-VB] Weird table name restriction >To: , > >Message-ID: <002501c83383$cde18360$647aa8c0 at M90> >Content-Type: text/plain; charset="US-ASCII" > >I just discovered that SQL Server (or VB.Net) does not like dashes in table >names. > >If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an >error "can't access destination table" but if I remove the dash "ZIP4AA_X" >it works just fine. > >The problem is that I take the name of the datafile, strip off the extension >and use that as my table name. Thus I now have to start doing edits of the >file name before I can use it as a field name. > >The hoops we have to jump through... > >John W. Colby >Colby Consulting >www.ColbyConsulting.com From wdhindman at dejpolsystems.com Fri Nov 30 18:30:48 2007 From: wdhindman at dejpolsystems.com (William Hindman) Date: Fri, 30 Nov 2007 19:30:48 -0500 Subject: [dba-VB] Weird table name restriction References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> Message-ID: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> "What a PITA. Keeps me searching for answers long after this thing should just work." jc ...my life as a developer :( William ----- Original Message ----- From: "jwcolby" To: Sent: Friday, November 30, 2007 2:21 PM Subject: Re: [dba-VB] Weird table name restriction > The problem is that they are fine (as are spaces) in file names... > > I am doing a "copy file to temp table, copy temp to permanent". Thus the > temp table name is just the file name. I discussed awhile back that I got > an "in" or something similar as a file name, which collided with a reserve > word. kind of the same issue only different. > > What a PITA. Keeps me searching for answers long after this thing should > just 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 Charlotte Foust > Sent: Friday, November 30, 2007 2:11 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Weird table name restriction > > Yep, dashes are as bad as spaces. ;-} > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, November 30, 2007 11:04 AM > To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com > Subject: [dba-VB] Weird table name restriction > > I just discovered that SQL Server (or VB.Net) does not like dashes in > table > names. > > If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an > error "can't access destination table" but if I remove the dash "ZIP4AA_X" > it works just fine. > > The problem is that I take the name of the datafile, strip off the > extension > and use that as my table name. Thus I now have to start doing edits of > the > file name before I can use it as a field name. > > The hoops we have to jump through... > > 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 cfoust at infostatsystems.com Fri Nov 30 18:45:10 2007 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 Nov 2007 16:45:10 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> References: <002501c83383$cde18360$647aa8c0@M90><002c01c83386$37c8f450$647aa8c0@M90> <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: Right! Those pesky, literal-minded computers! They insist on doing what I tell them instead of what I WANT. LOL Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of William Hindman Sent: Friday, November 30, 2007 4:31 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Weird table name restriction "What a PITA. Keeps me searching for answers long after this thing should just work." jc ...my life as a developer :( William ----- Original Message ----- From: "jwcolby" To: Sent: Friday, November 30, 2007 2:21 PM Subject: Re: [dba-VB] Weird table name restriction > The problem is that they are fine (as are spaces) in file names... > > I am doing a "copy file to temp table, copy temp to permanent". Thus the > temp table name is just the file name. I discussed awhile back that I got > an "in" or something similar as a file name, which collided with a reserve > word. kind of the same issue only different. > > What a PITA. Keeps me searching for answers long after this thing should > just 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 Charlotte Foust > Sent: Friday, November 30, 2007 2:11 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Weird table name restriction > > Yep, dashes are as bad as spaces. ;-} > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, November 30, 2007 11:04 AM > To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com > Subject: [dba-VB] Weird table name restriction > > I just discovered that SQL Server (or VB.Net) does not like dashes in > table > names. > > If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an > error "can't access destination table" but if I remove the dash "ZIP4AA_X" > it works just fine. > > The problem is that I take the name of the datafile, strip off the > extension > and use that as my table name. Thus I now have to start doing edits of > the > file name before I can use it as a field name. > > The hoops we have to jump through... > > 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 aip2000 at codewords.com Fri Nov 30 18:50:26 2007 From: aip2000 at codewords.com (Bill Klemens) Date: Fri, 30 Nov 2007 16:50:26 -0800 Subject: [dba-VB] Weird table name restriction In-Reply-To: <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> References: <002501c83383$cde18360$647aa8c0@M90> <002c01c83386$37c8f450$647aa8c0@M90> <001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: <4750AFD2.5010006@codewords.com> >> Thus I now have to start doing edits of >> the >> file name before I can use it as a field name. >> >> The hoops we have to jump through... >> >> John W. Colby >> Colby Consulting >> www.ColbyConsulting.com >> If you're using unedited (unsanitized) data to build SQL statements you could put yourself in a bad position. http://xkcd.com/327/ Bill From ssharkins at gmail.com Fri Nov 30 18:50:45 2007 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 30 Nov 2007 19:50:45 -0500 Subject: [dba-VB] Weird table name restriction References: <002501c83383$cde18360$647aa8c0@M90><002c01c83386$37c8f450$647aa8c0@M90><001801c833b1$6c31f360$ef706c4c@jisshowsbs.local> Message-ID: <001401c833b4$365ccb40$4b3a8343@SusanOne> I have always wished for a computer that would do want I expect rather than what I tell it! ;) Ohhhhhhhh, why can't a computer think more like me, more like me, more like me.... Susan H. > Right! Those pesky, literal-minded computers! They insist on doing > what I tell them instead of what I WANT. LOL From jwcolby at colbyconsulting.com Fri Nov 30 23:04:05 2007 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 1 Dec 2007 00:04:05 -0500 Subject: [dba-VB] Truncate a log file from code Message-ID: <004701c833d7$99526c00$647aa8c0@M90> I am doing an entire directory of files, using SQLBulkCopy to import the text files into a temp table, and from there into a permanent table. The log file is about the same size as the data file. Is it possible to truncate the log file after every file import in order to minimize the disk impact? If so can you point me to example code? John W. Colby Colby Consulting www.ColbyConsulting.com