From marklbreen at gmail.com Tue Dec 1 09:12:22 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 1 Dec 2009 15:12:22 +0000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B14231F.3020905@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com> Message-ID: Hello John, I have struggled with this value, and mixed it up with the connectionTimeout also. As a result, when I think there will be a delay, I also set it to zero, and then I sleep easy. I did that two years ago with out troublesome app, and now it works and works and works. Whats the downside of infinite timeout. If it takes three weeks, you will find out anyway, but why kill it after ten mins when it would have finished successfully in 19.45 minutes. Mark 2009/11/30 jwcolby > Any words of wisdom on setting the command.Timeout property? I have stored > procedures that execute > instantly, and others that can take an hour or more (large appends). > > How can I discover how long a stored procedure takes to run so that I can > set this property > dynamically? As an example I have cases where I am appending 65 million > rows into a table of 6 > fields. This can take a long time (at the very least perhaps 20 minutes) > but if I could get a > "RecordsAffected" count for such queries as well as the time it took to > execute, then I could start > to discover that it takes "X seconds / million" records, and set the > timeout to a reasonable value > based on the records to be appended. > > This doesn't have to be any exact time value. I assume a simple pair of > time variables, then "stop > time - start time"? > > Or should I just discover worst case and set it to that? > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 09:24:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 10:24:10 -0500 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: References: <4B14231F.3020905@colbyconsulting.com> Message-ID: <4B15351A.40500@colbyconsulting.com> Mark, Thanks for the response. >If it takes three weeks, you will find out anyway, but why kill it after ten mins when it would have finished successfully in 19.45 minutes. I hear you! BTW how do you kill an executing stored procedure? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > I have struggled with this value, and mixed it up with the connectionTimeout > also. As a result, when I think there will be a delay, I also set it to > zero, and then I sleep easy. I did that two years ago with > out troublesome app, and now it works and works and works. Whats the > downside of infinite timeout. If it takes three weeks, you will find out > anyway, but why kill it after ten mins when it would have finished > successfully in 19.45 minutes. > > > Mark > > > > > 2009/11/30 jwcolby > >> Any words of wisdom on setting the command.Timeout property? I have stored >> procedures that execute >> instantly, and others that can take an hour or more (large appends). >> >> How can I discover how long a stored procedure takes to run so that I can >> set this property >> dynamically? As an example I have cases where I am appending 65 million >> rows into a table of 6 >> fields. This can take a long time (at the very least perhaps 20 minutes) >> but if I could get a >> "RecordsAffected" count for such queries as well as the time it took to >> execute, then I could start >> to discover that it takes "X seconds / million" records, and set the >> timeout to a reasonable value >> based on the records to be appended. >> >> This doesn't have to be any exact time value. I assume a simple pair of >> time variables, then "stop >> time - start time"? >> >> Or should I just discover worst case and set it to that? >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Tue Dec 1 09:49:01 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 1 Dec 2009 15:49:01 +0000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B15351A.40500@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com> <4B15351A.40500@colbyconsulting.com> Message-ID: Hello John, Not sure, but stopping the server is one way. My main problems were sprocs stopping when I did not want them to stop, for me, if it is still running after 24 hours, it is probably never going to stop. For you, you might increase that to 48 hours, but in general, they either finish promptly, or else will never finish, either way, timing out after 10, 20, 50, or even 600 minutes is almost never a good option, if there is a possibility that it will finish in 601 minutes. There is probably a way to stop a process, Francisco or some of the other experts may know how, but I would either stop the db server / service, or else in worst case, do a quick reboot. For the rest of the year, I would never worry about it, happy in the knowledge they the server must work till the death :) Thanks Mark 2009/12/1 jwcolby > Mark, > > Thanks for the response. > > >If it takes three weeks, you will find out anyway, but why kill it after > ten mins when it would > have finished successfully in 19.45 minutes. > > I hear you! > > BTW how do you kill an executing stored procedure? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: > > Hello John, > > > > I have struggled with this value, and mixed it up with the > connectionTimeout > > also. As a result, when I think there will be a delay, I also set it to > > zero, and then I sleep easy. I did that two years ago with > > out troublesome app, and now it works and works and works. Whats the > > downside of infinite timeout. If it takes three weeks, you will find out > > anyway, but why kill it after ten mins when it would have finished > > successfully in 19.45 minutes. > > > > > > Mark > > > > > > > > > > 2009/11/30 jwcolby > > > >> Any words of wisdom on setting the command.Timeout property? I have > stored > >> procedures that execute > >> instantly, and others that can take an hour or more (large appends). > >> > >> How can I discover how long a stored procedure takes to run so that I > can > >> set this property > >> dynamically? As an example I have cases where I am appending 65 million > >> rows into a table of 6 > >> fields. This can take a long time (at the very least perhaps 20 > minutes) > >> but if I could get a > >> "RecordsAffected" count for such queries as well as the time it took to > >> execute, then I could start > >> to discover that it takes "X seconds / million" records, and set the > >> timeout to a reasonable value > >> based on the records to be appended. > >> > >> This doesn't have to be any exact time value. I assume a simple pair of > >> time variables, then "stop > >> time - start time"? > >> > >> Or should I just discover worst case and set it to that? > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 09:58:36 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 10:58:36 -0500 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: References: <4B14231F.3020905@colbyconsulting.com> <4B15351A.40500@colbyconsulting.com> Message-ID: <4B153D2C.90100@colbyconsulting.com> Mark, >but I would either stop the db server / service, or else in worst case, do a quick reboot. I have done both. I have corrupted the database doing the reboot. Stopping the service seems to work, however I have also seen the database pick up where it left off when the service restarted. I am sure there is some way to "officially" stop a running process, I just don't know how. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > Not sure, but stopping the server is one way. My main problems were sprocs > stopping when I did not want them to stop, for me, if it is still running > after 24 hours, it is probably never going to stop. For you, you might > increase that to 48 hours, but in general, they either finish promptly, or > else will never finish, either way, timing out after 10, 20, 50, or even 600 > minutes is almost never a good option, if there is a possibility that it > will finish in 601 minutes. > > There is probably a way to stop a process, Francisco or some of the other > experts may know how, but I would either stop the db server / service, or > else in worst case, do a quick reboot. For the rest of the year, I would > never worry about it, happy in the knowledge they the server must work till > the death :) > > Thanks > > Mark > > > > > > > 2009/12/1 jwcolby > >> Mark, >> >> Thanks for the response. >> >> >If it takes three weeks, you will find out anyway, but why kill it after >> ten mins when it would >> have finished successfully in 19.45 minutes. >> >> I hear you! >> >> BTW how do you kill an executing stored procedure? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Mark Breen wrote: >>> Hello John, >>> >>> I have struggled with this value, and mixed it up with the >> connectionTimeout >>> also. As a result, when I think there will be a delay, I also set it to >>> zero, and then I sleep easy. I did that two years ago with >>> out troublesome app, and now it works and works and works. Whats the >>> downside of infinite timeout. If it takes three weeks, you will find out >>> anyway, but why kill it after ten mins when it would have finished >>> successfully in 19.45 minutes. >>> >>> >>> Mark >>> >>> >>> >>> >>> 2009/11/30 jwcolby >>> >>>> Any words of wisdom on setting the command.Timeout property? I have >> stored >>>> procedures that execute >>>> instantly, and others that can take an hour or more (large appends). >>>> >>>> How can I discover how long a stored procedure takes to run so that I >> can >>>> set this property >>>> dynamically? As an example I have cases where I am appending 65 million >>>> rows into a table of 6 >>>> fields. This can take a long time (at the very least perhaps 20 >> minutes) >>>> but if I could get a >>>> "RecordsAffected" count for such queries as well as the time it took to >>>> execute, then I could start >>>> to discover that it takes "X seconds / million" records, and set the >>>> timeout to a reasonable value >>>> based on the records to be appended. >>>> >>>> This doesn't have to be any exact time value. I assume a simple pair of >>>> time variables, then "stop >>>> time - start time"? >>>> >>>> Or should I just discover worst case and set it to that? >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-VB mailing list >>>> dba-VB at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 10:07:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 11:07:22 -0500 Subject: [dba-VB] C# - Records Affected Message-ID: <4B153F3A.8010102@colbyconsulting.com> I am trying to get a count of records appended, updated etc in my SPs and returning that to my C# supervisor. I am finding references to @@Rowcount however this is returning 1 instead of the actual number. Is this @@RowCount the real deal? The SP definition: ALTER PROCEDURE [dbo].[sp_AZOut_AZExportToOrderedChunk] -- Add the parameters for the stored procedure here @DBName varchar(50), @ErrorDesc varchar(4000) output, @ErrorNo int output, @RecsAffected int output AS BEGIN Setting the returned value EXEC (@SQL) select @RecsAffected = @@RowCount My c# code: intRecsAffected = sCmd.Parameters["@RecsAffected"].Value The code triggers the try block if there is no such parameter (I just ignore it) or returns 1 if the parameter exists. This is a functioning tested SP which typically appends millions of records, though the exact number depends on the database. Is there something I need to know here? -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Tue Dec 1 10:49:57 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 02 Dec 2009 02:49:57 +1000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B153D2C.90100@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com>, , <4B153D2C.90100@colbyconsulting.com> Message-ID: <4B154935.15271.1331E01@stuart.lexacorp.com.pg> http://windowsitpro.com/article/articleid/14148/how-can-i-stop-a-sql-server-process.html Do a select * from sysprocesses and identify the spid in question. Then do a "KILL " This will mark the spid as "dead". Note that it may take a while for the process to end as it has to rollback all the updates that it has been doing. Also kill only marks the process as dead - the process itself needs to check for this, and if it is stuck in a loop as the result of a bug or whateverthen it won't terminate. Also certain processes like dump and dbcc commands have significant code paths where the kill command is not checked for and so these can take some time to terminate. Also, if the process is in an extended-stored procedure, or is waiting on network traffic/remote stored-procedure it will not check whether it has been terminated until these actions have been completed. See Q171224 for more info - including details on the waittype that can tell you what a process is waiting on. If the process won't die for one of the above reasons then your only choice is to stop the sqlservr.exe process itself and re-start. See also http://msdn.microsoft.com/en-us/library/aa933230%28SQL.80%29.aspx for info on KILL x WITH STATUSONLY for tracking the rollback once you kill a process. -- Stuart On 1 Dec 2009 at 10:58, jwcolby wrote: > I am sure there is some way to "officially" stop a running process, I just don't know how. > From jwcolby at colbyconsulting.com Tue Dec 1 10:50:57 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 11:50:57 -0500 Subject: [dba-VB] C# - Records Affected In-Reply-To: <4B153F3A.8010102@colbyconsulting.com> References: <4B153F3A.8010102@colbyconsulting.com> Message-ID: <4B154971.4000207@colbyconsulting.com> Sorry for the ring, I found the problem. The SP that I took this code from actually worked but the code I was testing did not and came before this code. The problem was simply that in the SP I did not place the line that captured @@RowCount immediately after the EXEC (@SQL) statement. All of the examples clearly warned me that this was a requirement but you understand "senior moments". Anyway, this is now working. Piece by piece this thing is coming together. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I am trying to get a count of records appended, updated etc in my SPs and returning that to my C# > supervisor. I am finding references to @@Rowcount however this is returning 1 instead of the actual > number. > > Is this @@RowCount the real deal? > > The SP definition: > > ALTER PROCEDURE [dbo].[sp_AZOut_AZExportToOrderedChunk] > -- Add the parameters for the stored procedure here > @DBName varchar(50), > @ErrorDesc varchar(4000) output, > @ErrorNo int output, > @RecsAffected int output > > AS > BEGIN > > > Setting the returned value > > EXEC (@SQL) > select @RecsAffected = @@RowCount > > My c# code: > > intRecsAffected = sCmd.Parameters["@RecsAffected"].Value > > The code triggers the try block if there is no such parameter (I just ignore it) or returns 1 if the > parameter exists. > > This is a functioning tested SP which typically appends millions of records, though the exact number > depends on the database. > > Is there something I need to know here? From jwcolby at colbyconsulting.com Tue Dec 1 16:53:55 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 17:53:55 -0500 Subject: [dba-VB] C# - Direct data manipulation Message-ID: <4B159E83.4000006@colbyconsulting.com> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 2 00:54:07 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 09:54:07 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B159E83.4000006@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> Message-ID: <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> Hi John -- I must say I have never done that "dynamic" t-SQL via C# - I guess it should be doable: using SMO or even SqlCommand's .ExecuteNonQuery(?) it should be possible to create SPs and UDFs, and then execute them as usual... BTW, UDFs, which return tables are very often a good substitute for all kinds of temp tables and dynamic SQL... I wonder what for all that "dynamism" there? Do you have constantly changing database structure? Do you have constantly changing customer requests, which do not allow you to create a set of stable parameterized SPs and UDFs, and for small(?) changing part of queries use LINQ for SQL or ADO.NET EF? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 1:54 AM To: VBA Subject: [dba-VB] C# - Direct data manipulation As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4653 (20091201) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 01:19:20 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 08:19:20 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. /gustav >>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Dec 2 01:31:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 08:31:02 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next-week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Wed Dec 2 02:05:18 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 11:05:18 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <00aa01ca7326$31634020$9429c060$@spb.ru> Hi Gustav -- Congrats! <<< A full day just sitting, listening, and learning! >>> Not easy. I usually very quick fall semi-asleep during such presentations as they look so slow - hope Scott Guthrie will make this one you'll attend tomorrow a very dynamic experience... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4653 (20091201) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 02:17:19 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 09:17:19 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil Oh, I know that feeling, indeed if the presenter has a voice like a priest and your knowledge about the topic is a little too high. But I'm confident that Scott Guthrie will keep me awake! /gustav >>> shamil at smsconsulting.spb.ru 02-12-2009 09:05 >>> Hi Gustav -- Congrats! <<< A full day just sitting, listening, and learning! >>> Not easy. I usually very quick fall semi-asleep during such presentations as they look so slow - hope Scott Guthrie will make this one you'll attend tomorrow a very dynamic experience... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From marklbreen at gmail.com Wed Dec 2 04:23:09 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 2 Dec 2009 10:23:09 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow Message-ID: Hello All, I am running VS 2008 on a powerful machine with loads of resources. My project is a DNN project sitting in the wwwroot folder which allows me to change a few lines of code and then immediately see the results in the web app. However, when I manipulate the Data Context Objects in the AppCode Folder, the response times are dreadfully, slow. It takes three to four minutes to open, edit, save and close one of these objects. I have tried it on a second machine and the results are similar. I can edit the Dbml files outside of the solution, but I am not sure whether that is safe to do so, when I edit them outside the solution (copying and pasting to another folder and then opening the dbml file from there), they open instantly. When I say "safe to do so", does the project file or the sln file need to be updated with the changes that have been made. I do get some warning message about "cannot find web.config, so using the file from the dbml file instead" which I accepted. I recall Shamil mentioned that manually editing these within the individual files is not a good idea, so i guess that he may have been suffering the same problems as I am, IE so sloooow to open and close. TIA for an help, if I have not expressed the problem clearly enough, let me know, Mark From shamil at smsconsulting.spb.ru Wed Dec 2 07:20:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 16:20:11 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: Message-ID: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Hello Mark -- First of all try to switch to FireFox - forget IE while debugging large ASP.NET apps from within VS.... I can only note that debugging large ASP.NET applications is a real PITA - this is why I'm always trying to get out as much as possible BL and DAL code into separate projects and develop, debug/test them without UI (ASP.NET or WinForms or WCF)... And DNN is a "huge ASP.NET" app with a lot of classlibs, which are so tightly coupled together that there is no way to debug part of them outside of running DNN instance - with all the consequences - bad luck... I suppose you can edit DNN's Data Context Objects source code from AppCode outside of VS (e.g. within notepad) - when the edits are saved then DNN will restart, that could take a while, quite a while.... A temp solution could be to keep *all* the source code of DNN module's control within that control's code behind .aspx.cs (.aspx.vb) during development - when you edit your code there then ASP.NET app will not restart it will just recompile .aspx and .aspx.cs - so it should work considerably quicker... All in all I think DNN custom modules development is a RPITA - one can never know how much it will finally take for a given project if they will not try to find a way to debug/ test as much as possible code outside of running DNN: something like develop a separate ASP.NET application, make it working and then port it to DNN environmnet... Be prepared for "crazy debug sessions" (if I'm not missing something and there are some "miracle" tools, which simplify DNN custom development debugging)... Philosophic note: DNN seems to be a good example that there "are no miracles in this world" - DNN is a great prototyping tool and CMS, when one has ready to use DNN modules and skins, and DNN is becoming RPITA when one have to develop a(n) (advanced) custom module. Rhetoric Question: Why in this world there couldn't be a "silver-bullet" tool able to support both standard and custom development with the same ease as DNN does support CMS development? I guess "Ruby on Rails" could be "what doctor ordered"?... Or ASP.NET MVC2 Framework? DNN did grow from a "junky" MS ASP.NET sample code base, and even advanced developers as DNN Core Development Team members are can't still "convert" that original "junk" to pearls... Hopefully they will do that in DNN v.7? - they "just" need to clean-up DNN huge code base and to implement what is called "Inversion of Control" (http://martinfowler.com/articles/injection.html) to "untight" DNN Core classlibs as much as possible... Please correct me if I'm wrong - in fact I'd be really happy to be wrong here as I have had to suspend one of the DNN projects, which didn't go smoothly because of PITA DNN custom modules development experience... Sorry, Mark, I have no a definitive answer for you here - just some "soap" and "bubbles" and PITA of my own DNN custom modules development experience, which I need to find a way to workaround, or quit the idea of DNN custom development completely as it's too expensive to be true. Still hope I missed some approaches to simplify this development - I mean ready to use approaches and tools without long learning curve... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Wednesday, December 02, 2009 1:23 PM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Why are my data Context Objects soooo sloooow Hello All, I am running VS 2008 on a powerful machine with loads of resources. My project is a DNN project sitting in the wwwroot folder which allows me to change a few lines of code and then immediately see the results in the web app. However, when I manipulate the Data Context Objects in the AppCode Folder, the response times are dreadfully, slow. It takes three to four minutes to open, edit, save and close one of these objects. I have tried it on a second machine and the results are similar. I can edit the Dbml files outside of the solution, but I am not sure whether that is safe to do so, when I edit them outside the solution (copying and pasting to another folder and then opening the dbml file from there), they open instantly. When I say "safe to do so", does the project file or the sln file need to be updated with the changes that have been made. I do get some warning message about "cannot find web.config, so using the file from the dbml file instead" which I accepted. I recall Shamil mentioned that manually editing these within the individual files is not a good idea, so i guess that he may have been suffering the same problems as I am, IE so sloooow to open and close. TIA for an help, if I have not expressed the problem clearly enough, let me know, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From marklbreen at gmail.com Wed Dec 2 07:39:14 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 2 Dec 2009 13:39:14 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Message-ID: Hello Shamil, Thank you for your detailed response. *Browsers* Some comments, I am actually using Chrome to View my work, but I am not doing any debugging, in the traditional sense, I code a few lines, click save and then view the results in Chrome, when I am not happy, I flick back to VS, change it and continue again. So, it is true to say, I am not really debugging, just viewing. However, I stopped using IE a few years ago, and since I switched to Chrome, it is the first thing I install on new machines. With the exception of the MSDN site, it works perfect for me. *Slow Data Contexts* So can I assume that this slowness is simply to be accepted, it is either a) the way VS2008 usually performs, or b) the way VS2008 performs when data contexts are involved in a large project such as DNN. I did not notice any difference when I copied the code from the wwwroot folder, so I hope that is not part of the problem. *DNN Development* Probably I am not doing real DNN custom programming, but I am currently building web user controls, and simply saving them, and then creating a module for DNN and including the web user control on that module. I know this is not real DNN programming, but have created about 20 module so far like this. DNN gives me, as a script kiddie type programmer, they ability to do a simple web app, but it manages the users and authentication, something that I could never program. IOW, with the exception of a few DNN hooks, I am doing simple programming, but throwing the results into DNN. *Free Lunch* I have to say I agree with you, there are limitations everywhere. My appoach is always to keep it as simple as possible until I absolutely know that I need to make it more complex. Thanks, Mark 2009/12/2 Shamil Salakhetdinov > Hello Mark -- > > First of all try to switch to FireFox - forget IE while debugging large > ASP.NET apps from within VS.... > > I can only note that debugging large ASP.NET applications is a real PITA > - > this is why I'm always trying to get out as much as possible BL and DAL > code > into separate projects and develop, debug/test them without UI (ASP.NET or > WinForms or WCF)... > > And DNN is a "huge ASP.NET" app with a lot of classlibs, which are so > tightly coupled together that there is no way to debug part of them outside > of running DNN instance - with all the consequences - bad luck... > > I suppose you can edit DNN's Data Context Objects source code from AppCode > outside of VS (e.g. within notepad) - when the edits are saved then DNN > will > restart, that could take a while, quite a while.... > > A temp solution could be to keep *all* the source code of DNN module's > control within that control's code behind .aspx.cs (.aspx.vb) during > development - when you edit your code there then ASP.NET app will not > restart it will just recompile .aspx and .aspx.cs - so it should work > considerably quicker... > > All in all I think DNN custom modules development is a RPITA - one can > never > know how much it will finally take for a given project if they will not try > to find a way to debug/ test as much as possible code outside of running > DNN: something like develop a separate ASP.NET application, make it > working > and then port it to DNN environmnet... > > Be prepared for "crazy debug sessions" (if I'm not missing something and > there are some "miracle" tools, which simplify DNN custom development > debugging)... > > Philosophic note: DNN seems to be a good example that there "are no > miracles > in this world" - DNN is a great prototyping tool and CMS, when one has > ready > to use DNN modules and skins, and DNN is becoming RPITA when one have to > develop a(n) (advanced) custom module. Rhetoric Question: Why in this world > there couldn't be a "silver-bullet" tool able to support both standard and > custom development with the same ease as DNN does support CMS development? > > I guess "Ruby on Rails" could be "what doctor ordered"?... > > Or ASP.NET MVC2 Framework? > > DNN did grow from a "junky" MS ASP.NET sample code base, and even advanced > developers as DNN Core Development Team members are can't still "convert" > that original "junk" to pearls... > > Hopefully they will do that in DNN v.7? - they "just" need to clean-up DNN > huge code base and to implement what is called "Inversion of Control" > (http://martinfowler.com/articles/injection.html) to "untight" DNN Core > classlibs as much as possible... > > Please correct me if I'm wrong - in fact I'd be really happy to be wrong > here as I have had to suspend one of the DNN projects, which didn't go > smoothly because of PITA DNN custom modules development experience... > > Sorry, Mark, I have no a definitive answer for you here - just some "soap" > and "bubbles" and PITA of my own DNN custom modules development experience, > which I need to find a way to workaround, or quit the idea of DNN custom > development completely as it's too expensive to be true. Still hope I > missed > some approaches to simplify this development - I mean ready to use > approaches and tools without long learning curve... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Wednesday, December 02, 2009 1:23 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello All, > > I am running VS 2008 on a powerful machine with loads of resources. My > project is a DNN project sitting in the wwwroot folder which allows me to > change a few lines of code and then immediately see the results in the web > app. > > However, when I manipulate the Data Context Objects in the AppCode Folder, > the response times are dreadfully, slow. It takes three to four minutes to > open, edit, save and close one of these objects. > > I have tried it on a second machine and the results are similar. > > I can edit the Dbml files outside of the solution, but I am not sure > whether > that is safe to do so, when I edit them outside the solution (copying and > pasting to another folder and then opening the dbml file from there), they > open instantly. When I say "safe to do so", does the project file or the > sln file need to be updated with the changes that have been made. I do get > some warning message about "cannot find web.config, so using the file from > the dbml file instead" which I accepted. > > I recall Shamil mentioned that manually editing these within the individual > files is not a good idea, so i guess that he may have been suffering the > same problems as I am, IE so sloooow to open and close. > > TIA for an help, if I have not expressed the problem clearly enough, let me > know, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Wed Dec 2 08:28:45 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 17:28:45 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Message-ID: <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Hi Mark, <<< *Slow Data Contexts* >>> What do you mean by that? - editing and saving your DNN Data Context Objects source code in \AppCode subfolder? What do you mean by "Dbml"? <<< but have created about 20 module so far like this. >>> OK, I have also made 30+ DNN5.x custom modules properly packed etc. - all very similar to each other but to get the first one was a time-consuming issue. "Tired" from that. Need a break. Then I maybe will make some more... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Wednesday, December 02, 2009 4:39 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow Hello Shamil, Thank you for your detailed response. *Browsers* Some comments, I am actually using Chrome to View my work, but I am not doing any debugging, in the traditional sense, I code a few lines, click save and then view the results in Chrome, when I am not happy, I flick back to VS, change it and continue again. So, it is true to say, I am not really debugging, just viewing. However, I stopped using IE a few years ago, and since I switched to Chrome, it is the first thing I install on new machines. With the exception of the MSDN site, it works perfect for me. *Slow Data Contexts* So can I assume that this slowness is simply to be accepted, it is either a) the way VS2008 usually performs, or b) the way VS2008 performs when data contexts are involved in a large project such as DNN. I did not notice any difference when I copied the code from the wwwroot folder, so I hope that is not part of the problem. *DNN Development* Probably I am not doing real DNN custom programming, but I am currently building web user controls, and simply saving them, and then creating a module for DNN and including the web user control on that module. I know this is not real DNN programming, but have created about 20 module so far like this. DNN gives me, as a script kiddie type programmer, they ability to do a simple web app, but it manages the users and authentication, something that I could never program. IOW, with the exception of a few DNN hooks, I am doing simple programming, but throwing the results into DNN. *Free Lunch* I have to say I agree with you, there are limitations everywhere. My appoach is always to keep it as simple as possible until I absolutely know that I need to make it more complex. Thanks, Mark <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 2 09:51:31 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 10:51:31 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> Message-ID: <4B168D03.3010706@colbyconsulting.com> Shamil, As I have discussed in the past, the business is doing the exact same process to many different tables. Because of the size of these tables and the processing involved I find it useful to store each table in it's own database. These are just lists of names, each list comes from a different source and is called something by the client, something that makes sense to him. These lists (a table) will always be millions of names / addresses, and often are 50 million or more. When you have 50 million names, the database, with just this one single table will be 10 or 20 gigabytes. Once you start processing it can mushroom to 50 gigabytes. Thus storing a dozen of these tables in a single database just doesn't make sense (to me). Thus I have a dozen different databases. I have to apply all of these stored procedures to each one of these databases once a month. Thus write the stored procedure such that I can pass in a database name and a table name. Voila, the SP works for all of my databases. But that means dynamic SQL. I really don't have an issue with dynamic SQL, although I have witnessed first hand the time required for SQL Server to do the "compile" - creating the execution plan. If I run the SP a second time with the same db and table name the time to execute drops sharply. BTW, these lists become the source for "orders" of names. Each of these orders also are stored in its own database, and I have to execute these same (or similar) SPs against each of these orders. Over the last 4 years I have perhaps a hundred of these order databases. This is what I do for this client, create these databases, and apply processes against these databases. The processes are exactly the same across all of the databases, thus having a stored procedure that performs some part of that process but can be applied to any of these databases makes sense (to me). I have spent the last five years performing these processes entirely manually, then one by one creating a stored procedure to automate one of the steps, then the next step, and the next. By now I have an entire master library with (let me go check) 42 different stored procedures that, taken together, automate my work for the client. THAT is the point of the C# side of things. Automating the automation so to speak. Taking these 42 stored procedures and stringing sets of them together, 7 which perform the output of data to an external program for processing, 6 more that get the processed data back in, a half dozen more that perform some other processing, another set that do order processing, etc. This is not a bank, or a company or a call center or a manufacturer, or any of the other "typical" SQL Server databases. It is name / address list processing and creating orders from these lists. Really pretty simple but extremely painstaking. And like anything else we do, I can't be making mistakes, it must be done in a specific manner, a specific sequence, EVERY time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > I must say I have never done that "dynamic" t-SQL via C# - I guess it should > be doable: using SMO or even SqlCommand's .ExecuteNonQuery(?) it should be > possible to create SPs and UDFs, and then execute them as usual... > > BTW, UDFs, which return tables are very often a good substitute for all > kinds of temp tables and dynamic SQL... > > I wonder what for all that "dynamism" there? > Do you have constantly changing database structure? > Do you have constantly changing customer requests, which do not allow you to > create a set of stable parameterized SPs and UDFs, and for small(?) changing > part of queries use LINQ for SQL or ADO.NET EF? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 02, 2009 1:54 AM > To: VBA > Subject: [dba-VB] C# - Direct data manipulation > > As previously mentioned, over the last couple of years I have built up a set > of stored procedures > which perform TSQL. I then run sets of these stored procedures to perform > processes. The TSQL is > always dynamic. > > As an example a stored procedure might build a table, with boilerplate field > names and data types, > but a passed in database and table name. Inside of the stored procedure I > build up the correct SQL > to create the table in the database specified, with the name specified. > Another stored procedure > might create in index, with boilerplate field names, but a passed in > database and table name. Again > the stored procedure builds up the TSQL statement to create the index in the > correct db and table. > > I already have these stored procedures debugged and working and have been > using them in sets to > perform "big picture processes" for quite some time, but the whole "execute > a stored procedure" > using a command object, parameter objects in a parameter array, interpreting > the parameters etc just > seems so... 1950s. I feel like I am flipping switches on the front panel of > a computer in a 50s > sci-fi movie as a tape reel spins madly in the background. > > Now that I am moving to C# I am wondering if this is required any more. Can > C# execute TSQL > directly somehow? Can I assemble this boiler plate plus database / table > kind of thing into a TSQL > statement directly in C# and then somehow tell SQL Server to execute that > TSQL? I understand the > "SQL optimization" thing but it seems like (not sure here) that because the > TSQL is dynamically > constructed in the stored procedure, the whole "optimization" thing goes > right out the window. If I > can execute TSQL directly from C#, what can I get back? Rows affected? > Error codes? And how? > > As it stands I am happily flipping switches, tape reels whirring, exporting > data for address > validation. This is good, I am happy, but ... > From paul.hartland at googlemail.com Wed Dec 2 10:05:20 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Wed, 2 Dec 2009 16:05:20 +0000 Subject: [dba-VB] Read XML File Using xsd Schema File Message-ID: <38c884770912020805s570c99e1ia753bf4f81b4d0f7@mail.gmail.com> To all, We have been a given what looks to me like a fairly complex XML file, we have also been given a xsd schema file. I tried using the SQLXMLBulkLoad object in VB6 and was getting the error Schema: relationship expected on 'Company'. The company that gave us both the files insist that the xsd is correct (according to my project manager). I downloaded and installed Stylus Studio 2010, with which I loaded the XML, and then generated my own xsd schame file. Tried again and this time get the same error as above, but instead of 'Company' the error was 'Groups' The VB6 code I am using is as follows: Dim objBL Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1" objBL.KeepIdentity = True objBL.errorlogfile = "C:\XML_StylusStudio\Error.log" objBL.checkconstraints = True objBL.xmlfragment = True objBL.schemagen = True objBL.sgdroptables = True objBL.Execute "C:\XML_StylusStudio\newschema.xsd", "C:\XML_StylusStudio\CDFull_Original.xml" Set objBl=Nothing The object of the exercise being that we generate related tables in SQL Server 2005 of the XML data. Would be grateful if anyone could help with this (would be happy to send example XML file and the schema offline), as I haven't got much hair left to pull out. Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From shamil at smsconsulting.spb.ru Wed Dec 2 11:23:04 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 20:23:04 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B168D03.3010706@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> Message-ID: <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> Hi John -- Thank you for your reply. Do you use your different databases for data input, or you also have to update those different databases' tables? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 6:52 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, As I have discussed in the past, the business is doing the exact same process to many different tables. Because of the size of these tables and the processing involved I find it useful to store each table in it's own database. These are just lists of names, each list comes from a different source and is called something by the client, something that makes sense to him. These lists (a table) will always be millions of names / addresses, and often are 50 million or more. When you have 50 million names, the database, with just this one single table will be 10 or 20 gigabytes. Once you start processing it can mushroom to 50 gigabytes. Thus storing a dozen of these tables in a single database just doesn't make sense (to me). Thus I have a dozen different databases. I have to apply all of these stored procedures to each one of these databases once a month. Thus write the stored procedure such that I can pass in a database name and a table name. Voila, the SP works for all of my databases. But that means dynamic SQL. I really don't have an issue with dynamic SQL, although I have witnessed first hand the time required for SQL Server to do the "compile" - creating the execution plan. If I run the SP a second time with the same db and table name the time to execute drops sharply. BTW, these lists become the source for "orders" of names. Each of these orders also are stored in its own database, and I have to execute these same (or similar) SPs against each of these orders. Over the last 4 years I have perhaps a hundred of these order databases. This is what I do for this client, create these databases, and apply processes against these databases. The processes are exactly the same across all of the databases, thus having a stored procedure that performs some part of that process but can be applied to any of these databases makes sense (to me). I have spent the last five years performing these processes entirely manually, then one by one creating a stored procedure to automate one of the steps, then the next step, and the next. By now I have an entire master library with (let me go check) 42 different stored procedures that, taken together, automate my work for the client. THAT is the point of the C# side of things. Automating the automation so to speak. Taking these 42 stored procedures and stringing sets of them together, 7 which perform the output of data to an external program for processing, 6 more that get the processed data back in, a half dozen more that perform some other processing, another set that do order processing, etc. This is not a bank, or a company or a call center or a manufacturer, or any of the other "typical" SQL Server databases. It is name / address list processing and creating orders from these lists. Really pretty simple but extremely painstaking. And like anything else we do, I can't be making mistakes, it must be done in a specific manner, a specific sequence, EVERY time. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 11:27:33 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 18:27:33 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John et al Don't forget LINQPad. Why LINQ beats SQL: http://www.linqpad.net/WhyLINQBeatsSQL.aspx /gustav >>> Gustav at cactus.dk 02-12-2009 08:19 >>> Hi John As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. /gustav >>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 2 12:34:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 13:34:54 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> Message-ID: <4B16B34E.8050702@colbyconsulting.com> Shamil, I receive lists of names in CSV or fixed width files. I import those into SQL Server, creating a PKID in the process. I then have to export the PKID plus the name / address monthly for address validation. Once validated, I have to import the data back in. This is the monthly process. Approximately 1% of all the people on any given list move each month. So I have to go back in to the original list and update 1% of the addresses, or simply swap out the new list (table) for the old. There is never any manual processing of individual names inside of these lists, IOW people never look at them, modify them, add new ones, delete address or anything like that. The list is "stable" in that regard. These lists become the source for orders of names. Orders are a whole 'nother process, but also use SPs to do their thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your reply. > > Do you use your different databases for data input, or you also have to > update those different databases' tables? > > -- > Shamil From jwcolby at colbyconsulting.com Wed Dec 2 12:46:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 13:46:09 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B16B5F1.4040003@colbyconsulting.com> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav > > >>>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> > As previously mentioned, over the last couple of years I have built up a set of stored procedures > which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is > always dynamic. > > As an example a stored procedure might build a table, with boilerplate field names and data types, > but a passed in database and table name. Inside of the stored procedure I build up the correct SQL > to create the table in the database specified, with the name specified. Another stored procedure > might create in index, with boilerplate field names, but a passed in database and table name. Again > the stored procedure builds up the TSQL statement to create the index in the correct db and table. > > I already have these stored procedures debugged and working and have been using them in sets to > perform "big picture processes" for quite some time, but the whole "execute a stored procedure" > using a command object, parameter objects in a parameter array, interpreting the parameters etc just > seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s > sci-fi movie as a tape reel spins madly in the background. > > Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL > directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL > statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the > "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically > constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I > can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? > > As it stands I am happily flipping switches, tape reels whirring, exporting data for address > validation. This is good, I am happy, but ... > From shamil at smsconsulting.spb.ru Wed Dec 2 13:19:29 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 22:19:29 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B16B34E.8050702@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> Message-ID: <00d501ca7384$600b48b0$2021da10$@spb.ru> John -- Have you tried to use MS SQL database filegroups and partitioned tables & views? http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx With them I suppose only initial import/insert of data have to be parameterized with table name, and the rest can be done without any dynamic T-SQL. Please correct me if I'm wrong. Please note I'm not trying to "force" you to change your current working solution - just wondering is there a legal way to solve your task without dynamic T-SQL... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 9:35 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, I receive lists of names in CSV or fixed width files. I import those into SQL Server, creating a PKID in the process. I then have to export the PKID plus the name / address monthly for address validation. Once validated, I have to import the data back in. This is the monthly process. Approximately 1% of all the people on any given list move each month. So I have to go back in to the original list and update 1% of the addresses, or simply swap out the new list (table) for the old. There is never any manual processing of individual names inside of these lists, IOW people never look at them, modify them, add new ones, delete address or anything like that. The list is "stable" in that regard. These lists become the source for orders of names. Orders are a whole 'nother process, but also use SPs to do their thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your reply. > > Do you use your different databases for data input, or you also have to > update those different databases' tables? > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 2 13:32:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 14:32:10 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <00d501ca7384$600b48b0$2021da10$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> <00d501ca7384$600b48b0$2021da10$@spb.ru> Message-ID: <4B16C0BA.7010601@colbyconsulting.com> Shamil, I have not. All of that is rather esoteric stuff for a non DBA. My job is processing data, and that is only a small part of my job, i.e. this is only one of many clients, and the only one that needs this kind of SQL Server stuff. As I have said many times, if my job was to go into a company every day and play DBA then I would learn many more things SQL Server related. As things stand I learn just enough to make things work, and a LITTLE extra in search of efficiency. It is certainly not that I don't want to, I just don't have the time. In the end I find the method I use comfortable from many angles. I have to do some things that require creating views, other "processing" tables and so forth. It really just works (for me) to do things this way, have separate databases to hold all of the "junk" associated with each list. Kind of the old "encapsulation" thing. Your suggestion would of course end up with all tables inside of a single "database", and as such the need for the Database parameter would go away but I still have to do the same thing to many different tables. Again, could this be done by one of the experts on the SQL Server list. Probably! Will I ever get there? Uhhhh doubtful. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > John -- > > Have you tried to use MS SQL database filegroups and partitioned tables & > views? > > http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx > > With them I suppose only initial import/insert of data have to be > parameterized with table name, and the rest can be done without any dynamic > T-SQL. Please correct me if I'm wrong. > > Please note I'm not trying to "force" you to change your current working > solution - just wondering is there a legal way to solve your task without > dynamic T-SQL... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 02, 2009 9:35 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# - Direct data manipulation > > Shamil, > From dbdoug at gmail.com Wed Dec 2 19:27:15 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 2 Dec 2009 17:27:15 -0800 Subject: [dba-VB] NorthwindNet time summary Message-ID: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> I believe that some time after the NorthwindNet project was finished, someone (Shamil?) posted an email with a summary of the time taken/number of forms/number of reports, etc. But I can't find it in my archives. I'm having a (friendly so far) discussion with a client who has given me an extremely ambitious schedule for converting a big Access project to C# ASP.NET, and I'd like some ammunition for my side of the argument! Thanks, Doug Steele From dwaters at usinternet.com Wed Dec 2 19:34:28 2009 From: dwaters at usinternet.com (Dan Waters) Date: Wed, 2 Dec 2009 19:34:28 -0600 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> Message-ID: Hi Doug, I used this site as well in making a quote to convert an Access System to a VB System. http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 Good Luck! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, December 02, 2009 7:27 PM To: dba-vb Subject: [dba-VB] NorthwindNet time summary I believe that some time after the NorthwindNet project was finished, someone (Shamil?) posted an email with a summary of the time taken/number of forms/number of reports, etc. But I can't find it in my archives. I'm having a (friendly so far) discussion with a client who has given me an extremely ambitious schedule for converting a big Access project to C# ASP.NET, and I'd like some ammunition for my side of the argument! Thanks, Doug Steele _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dbdoug at gmail.com Wed Dec 2 20:57:03 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 2 Dec 2009 18:57:03 -0800 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> Message-ID: <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> Perfect! Thanks, Dan. Doug On Wed, Dec 2, 2009 at 5:34 PM, Dan Waters wrote: > Hi Doug, > > I used this site as well in making a quote to convert an Access System to a > VB System. > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > Good Luck! > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, December 02, 2009 7:27 PM > To: dba-vb > Subject: [dba-VB] NorthwindNet time summary > > I believe that some time after the NorthwindNet project was finished, > someone (Shamil?) posted an email with a summary of the time taken/number > of > forms/number of reports, etc. But I can't find it in my archives. > > I'm having a (friendly so far) discussion with a client who has given me an > extremely ambitious schedule for converting a big Access project to C# > ASP.NET, and I'd like some ammunition for my side of the argument! > > Thanks, > > Doug Steele > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Thu Dec 3 05:29:49 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 14:29:49 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B16C0BA.7010601@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> <00d501ca7384$600b48b0$2021da10$@spb.ru> <4B16C0BA.7010601@colbyconsulting.com> Message-ID: <00f601ca740b$ee013800$ca03a800$@spb.ru> Hi John -- OK. Don't break it with implementation of other approaches if it works... Just for the future projects - I suppose (I might be missing something as I do not have that experience but I plan to try, maybe within our Northwind.NET project) this partitioning stuff is just practical for the tasks as you do (similar stuff was available for non-relational DBMSs in the end of 70-es/beginning of 80ies, and for Oracle it's available for years now AFAIHH), and this stuff doesn't take that much time to learn (one day?) and use (a few short reusable T-SQL scripts?) that it would take to program and to test and to support dynamic T-SQ: for many SPs and UDFs... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 10:32 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, I have not. All of that is rather esoteric stuff for a non DBA. My job is processing data, and that is only a small part of my job, i.e. this is only one of many clients, and the only one that needs this kind of SQL Server stuff. As I have said many times, if my job was to go into a company every day and play DBA then I would learn many more things SQL Server related. As things stand I learn just enough to make things work, and a LITTLE extra in search of efficiency. It is certainly not that I don't want to, I just don't have the time. In the end I find the method I use comfortable from many angles. I have to do some things that require creating views, other "processing" tables and so forth. It really just works (for me) to do things this way, have separate databases to hold all of the "junk" associated with each list. Kind of the old "encapsulation" thing. Your suggestion would of course end up with all tables inside of a single "database", and as such the need for the Database parameter would go away but I still have to do the same thing to many different tables. Again, could this be done by one of the experts on the SQL Server list. Probably! Will I ever get there? Uhhhh doubtful. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4656 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Thu Dec 3 05:29:49 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 14:29:49 +0300 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> Message-ID: <00f701ca740b$ef56b5e0$ce0421a0$@spb.ru> Hi Dan and Doug, If that stats will help you to quote and to plan your projects, please write a short note to be posted there (myself or Gustav can post it) http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 This project is currently in suspended state, and good feedback might help to plan and to implement some useful follow-ups. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Thursday, December 03, 2009 5:57 AM To: dwaters; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] NorthwindNet time summary Perfect! Thanks, Dan. Doug On Wed, Dec 2, 2009 at 5:34 PM, Dan Waters wrote: > Hi Doug, > > I used this site as well in making a quote to convert an Access System to a > VB System. > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > Good Luck! > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, December 02, 2009 7:27 PM > To: dba-vb > Subject: [dba-VB] NorthwindNet time summary > > I believe that some time after the NorthwindNet project was finished, > someone (Shamil?) posted an email with a summary of the time taken/number > of > forms/number of reports, etc. But I can't find it in my archives. > > I'm having a (friendly so far) discussion with a client who has given me an > extremely ambitious schedule for converting a big Access project to C# > ASP.NET, and I'd like some ammunition for my side of the argument! > > Thanks, > > Doug Steele __________ Information from ESET NOD32 Antivirus, version of virus signature database 4656 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Thu Dec 3 06:08:57 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 15:08:57 +0300 Subject: [dba-VB] C# 4.0: ExpandoObject, dynamic ... Message-ID: <00fa01ca7411$65b61be0$312253a0$@spb.ru> Hi All, Here is information on C# 4.0: ExpandoObject, dynamic etc. - you can see here why all that stuff is more powerful and useful than VB6/VBA late binding... http://blogs.msdn.com/csharpfaq/archive/2009/10/01/dynamic-in-c-4-0-introduc ing-the-expandoobject.aspx http://blogs.msdn.com/csharpfaq/archive/2009/10/19/dynamic-in-c-4-0-creating -wrappers-with-dynamicobject.aspx Thank you. -- Shamil From marklbreen at gmail.com Thu Dec 3 08:34:16 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 3 Dec 2009 14:34:16 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Message-ID: Hello Shamil, In VS2008, when I create a folder in app_Code, and then create a new Linq to SQL Class is it assigned the extention of dbml, default name is DataClasses.dbml It is these classes that are sooo slooow to do anything with. I timed the time it takes to just click create, drop a table onto the design surface, and then click save. It is taking 4 minutes to do that, so when I needed 20 - 25 objects or so, I have to sit like a donkey and click for almost two hours. It still takes four minutes to open and edit one. A PITA for sure. If I open the class as a standalone file, I can operate with instant performance, but it does not play well with the project/ solution. I have to say, I wish I knew more about these data classes and how they really should be used in real world applications. Thanks Mark 2009/12/2 Shamil Salakhetdinov > Hi Mark, > > <<< > *Slow Data Contexts* > >>> > What do you mean by that? - editing and saving your DNN Data Context > Objects > source code in \AppCode subfolder? > What do you mean by "Dbml"? > > <<< > but have created about 20 module so far > like this. > >>> > OK, I have also made 30+ DNN5.x custom modules properly packed etc. - all > very similar to each other but to get the first one was a time-consuming > issue. "Tired" from that. Need a break. Then I maybe will make some more... > > Thank you. > > -- > Shamil > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Wednesday, December 02, 2009 4:39 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello Shamil, > > Thank you for your detailed response. > > *Browsers* > Some comments, I am actually using Chrome to View my work, but I am not > doing any debugging, in the traditional sense, I code a few lines, click > save and then view the results in Chrome, when I am not happy, I flick back > to VS, change it and continue again. So, it is true to say, I am not > really > debugging, just viewing. However, I stopped using IE a few years ago, and > since I switched to Chrome, it is the first thing I install on new > machines. > With the exception of the MSDN site, it works perfect for me. > > > *Slow Data Contexts* > So can I assume that this slowness is simply to be accepted, it is either > a) > the way VS2008 usually performs, or b) the way VS2008 performs when data > contexts are involved in a large project such as DNN. I did not notice any > difference when I copied the code from the wwwroot folder, so I hope that > is > not part of the problem. > > *DNN Development* > Probably I am not doing real DNN custom programming, but I am currently > building web user controls, and simply saving them, and then creating a > module for DNN and including the web user control on that module. I know > this is not real DNN programming, but have created about 20 module so far > like this. DNN gives me, as a script kiddie type programmer, they ability > to do a simple web app, but it manages the users and authentication, > something that I could never program. > > IOW, with the exception of a few DNN hooks, I am doing simple programming, > but throwing the results into DNN. > > > *Free Lunch* > I have to say I agree with you, there are limitations everywhere. My > appoach is always to keep it as simple as possible until I absolutely know > that I need to make it more complex. > > > > Thanks, > > Mark > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Thu Dec 3 09:08:28 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 18:08:28 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Message-ID: <012201ca742a$79c0d710$6d428530$@spb.ru> Hello Mark -- OK, I suppose you can create custom DLL(s) working with LINQ to SQL in a solution outside of your custom DNN solution, and then just use your custom DLL within custom DNN solution - your LINQ to SQL objects from DLL should be public and this DLL should also have its own config file... I have done something like that but with POCO-objects (http://en.wikipedia.org/wiki/Plain_Old_CLR_Object), which I used as ObjectDataSources for web forms within DNN custom solutions' custom modules... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Thursday, December 03, 2009 5:34 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow Hello Shamil, In VS2008, when I create a folder in app_Code, and then create a new Linq to SQL Class is it assigned the extention of dbml, default name is DataClasses.dbml It is these classes that are sooo slooow to do anything with. I timed the time it takes to just click create, drop a table onto the design surface, and then click save. It is taking 4 minutes to do that, so when I needed 20 - 25 objects or so, I have to sit like a donkey and click for almost two hours. It still takes four minutes to open and edit one. A PITA for sure. If I open the class as a standalone file, I can operate with instant performance, but it does not play well with the project/ solution. I have to say, I wish I knew more about these data classes and how they really should be used in real world applications. Thanks Mark <<< snip>>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4658 (20091203) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From marklbreen at gmail.com Thu Dec 3 16:01:58 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 3 Dec 2009 22:01:58 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <012201ca742a$79c0d710$6d428530$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> <012201ca742a$79c0d710$6d428530$@spb.ru> Message-ID: Hello Shamil, I guess this is an option for me, but to be honest, it will probably more easier for me to take the delay of waiting that attempt to manage the additional layer of complexity. As with all things in life, I suppose if I take the time to review this, it will save me time, but I am afraid to spend a day on it only to save myself a few minutes a few times a day. Thanks any way for the suggestion, Mark 2009/12/3 Shamil Salakhetdinov > Hello Mark -- > > OK, I suppose you can create custom DLL(s) working with LINQ to SQL in a > solution outside of your custom DNN solution, and then just use your custom > DLL within custom DNN solution - your LINQ to SQL objects from DLL should > be > public and this DLL should also have its own config file... > > I have done something like that but with POCO-objects > (http://en.wikipedia.org/wiki/Plain_Old_CLR_Object), which I used as > ObjectDataSources for web forms within DNN custom solutions' custom > modules... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, December 03, 2009 5:34 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello Shamil, > > In VS2008, when I create a folder in app_Code, and then create a new Linq > to > SQL Class is it assigned the extention of dbml, default name is > DataClasses.dbml > > It is these classes that are sooo slooow to do anything with. I timed the > time it takes to just click create, drop a table onto the design surface, > and then click save. It is taking 4 minutes to do that, so when I needed > 20 > - 25 objects or so, I have to sit like a donkey and click for almost two > hours. > > It still takes four minutes to open and edit one. > > A PITA for sure. > > If I open the class as a standalone file, I can operate with > instant performance, but it does not play well with the project/ solution. > > I have to say, I wish I knew more about these data classes and how they > really should be used in real world applications. > > Thanks > > Mark > > > <<< snip>>> > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4658 (20091203) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Dec 3 17:38:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 03 Dec 2009 18:38:39 -0500 Subject: [dba-VB] Application settings Message-ID: <4B184BFF.6040203@colbyconsulting.com> I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Thu Dec 3 18:07:23 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 4 Dec 2009 11:07:23 +1100 Subject: [dba-VB] Application settings References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> Hi John, Is this what your after? global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting = "New Value"; global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); cheers Michael M I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From cfoust at infostatsystems.com Thu Dec 3 18:26:56 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 3 Dec 2009 18:26:56 -0600 Subject: [dba-VB] Application settings In-Reply-To: <4B184BFF.6040203@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: - - 0 Microsoft.Jet.OLEDB.4.0 C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb RIMUser false - 1 sqloledb infoserver RIMDrillDataSQL true We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. Shared ds As DataSet Shared _connectionString As String Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath Private Shared Sub ReadSettingsFile() If IO.File.Exists(_xmlPath) Then Call CreateSchema() ds.ReadXml(_xmlPath) Call DecryptPassword() _connectionString = GetConnectionString() Else If ds.Tables(0).Rows.Count = 0 Then 'placeholder for jet settings Dim row As DataRow = ds.Tables(0).NewRow row("dbtype") = 0 row("provider") = "Microsoft.Jet.OLEDB.4.0" ds.Tables(0).Rows.Add(row) 'placeholder for sql settings row = ds.Tables(0).NewRow row("dbtype") = 1 row("provider") = "sqloledb" ds.Tables(0).Rows.Add(row) End If End If End Sub Private Shared Sub CreateSchema() ds = New DataSet Dim table As New DataTable("connection") table.Columns.Add("dbtype", GetType(Integer)) table.Columns.Add("provider", GetType(String)) table.Columns.Add("datasource", GetType(String)) table.Columns.Add("userid", GetType(String)) table.Columns.Add("password", GetType(String)) table.Columns.Add("initialcatalog", GetType(String)) table.Columns.Add("trusted", GetType(Boolean)) table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} ds.Tables.Add(table) End Sub Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 03, 2009 3:39 PM To: VBA Subject: [dba-VB] Application settings I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Thu Dec 3 18:43:32 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 4 Dec 2009 11:43:32 +1100 Subject: [dba-VB] Application settings References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827EA@ddi-01.DDI.local> Hi Charlotte, I see this as useful, but, If you need a complex setting structure why not just create a 'MySettings' class and serialise or deserialise it as needed? I think John has already worked with the Serializable attribute. Am I missing something? Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, 4 December 2009 11:27 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: - - 0 Microsoft.Jet.OLEDB.4.0 C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb RIMUser false - 1 sqloledb infoserver RIMDrillDataSQL true We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. Shared ds As DataSet Shared _connectionString As String Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath Private Shared Sub ReadSettingsFile() If IO.File.Exists(_xmlPath) Then Call CreateSchema() ds.ReadXml(_xmlPath) Call DecryptPassword() _connectionString = GetConnectionString() Else If ds.Tables(0).Rows.Count = 0 Then 'placeholder for jet settings Dim row As DataRow = ds.Tables(0).NewRow row("dbtype") = 0 row("provider") = "Microsoft.Jet.OLEDB.4.0" ds.Tables(0).Rows.Add(row) 'placeholder for sql settings row = ds.Tables(0).NewRow row("dbtype") = 1 row("provider") = "sqloledb" ds.Tables(0).Rows.Add(row) End If End If End Sub Private Shared Sub CreateSchema() ds = New DataSet Dim table As New DataTable("connection") table.Columns.Add("dbtype", GetType(Integer)) table.Columns.Add("provider", GetType(String)) table.Columns.Add("datasource", GetType(String)) table.Columns.Add("userid", GetType(String)) table.Columns.Add("password", GetType(String)) table.Columns.Add("initialcatalog", GetType(String)) table.Columns.Add("trusted", GetType(Boolean)) table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} ds.Tables.Add(table) End Sub Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 03, 2009 3:39 PM To: VBA Subject: [dba-VB] Application settings I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From Gustav at cactus.dk Fri Dec 4 02:48:35 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 09:48:35 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John Yes and no. I used an old version for some time but the current version is more powerful. Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. /gustav >>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav From Gustav at cactus.dk Fri Dec 4 04:08:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 11:08:03 +0100 Subject: [dba-VB] LINQ example (was: C# - Direct data manipulation) Message-ID: Hi John et all Further to the notes below on Joseph Albahari's LINQPad, it contains a link to download all the example code from "LINQ in Action". Also, it has a link to this amazing demo of the power of LINQ: http://blogs.msdn.com/lukeh/archive/2007/03/19/using-linq-to-solve-puzzles.aspx It's a true eye-opener and a good example showing that the scope of LINQ is much wider than "normal" database querying. The code is included in LINQPad when downloaded, ready for you to play with at: Tab Samples, C# 3.0 in a Nutshell, Chapter 9 - LINQ Operators, Joining, Extra - Weights Puzzle. It's Friday and soon weekend! /gustav >>> Gustav at cactus.dk 04-12-2009 09:48 >>> Hi John Yes and no. I used an old version for some time but the current version is more powerful. Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. /gustav >>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 05:53:41 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 06:53:41 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B18F845.1090500@colbyconsulting.com> I really meant do you use linq in your C# apps? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes and no. I used an old version for some time but the current version is more powerful. > > Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. > > /gustav > >>>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> > Do you use it? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John et al >> >> Don't forget LINQPad. >> >> Why LINQ beats SQL: >> http://www.linqpad.net/WhyLINQBeatsSQL.aspx >> >> /gustav >> >> >>>>> Gustav at cactus.dk 02-12-2009 08:19 >>> >> Hi John >> >> As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. >> >> ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. >> >> /gustav > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From paul.hartland at googlemail.com Fri Dec 4 05:59:23 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 4 Dec 2009 11:59:23 +0000 Subject: [dba-VB] Test Message-ID: <38c884770912040359r58db94e3w44b86c077590457d@mail.gmail.com> Please delete as test email, sent question about XML problem about two days ago, and haven't seen it appear. -- Paul Hartland paul.hartland at googlemail.com From paul.hartland at googlemail.com Fri Dec 4 06:19:01 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 4 Dec 2009 12:19:01 +0000 Subject: [dba-VB] Read XML File Using xsd Schema File Message-ID: <38c884770912040419xdc61c66y2c315b820cd6fb09@mail.gmail.com> To all, We have been a given what looks to me like a fairly complex XML file, we have also been given a xsd schema file. I tried using the SQLXMLBulkLoad object in VB6 and was getting the error Schema: relationship expected on 'Company'. The company that gave us both the files insist that the xsd is correct (according to my project manager). I downloaded and installed Stylus Studio 2010, with which I loaded the XML, and then generated my own xsd schame file. Tried again and this time get the same error as above, but instead of 'Company' the error was 'Groups' The VB6 code I am using is as follows: Dim objBL Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1" objBL.KeepIdentity = True objBL.errorlogfile = "C:\XML_StylusStudio\Error.log" objBL.checkconstraints = True objBL.xmlfragment = True objBL.schemagen = True objBL.sgdroptables = True objBL.Execute "C:\XML_StylusStudio\newschema.xsd", "C:\XML_StylusStudio\CDFull_Original.xml" Set objBl=Nothing The object of the exercise being that we generate related tables in SQL Server 2005 of the XML data. Would be grateful if anyone could help with this (would be happy to send example XML file and the schema offline), as I haven't got much hair left to pull out. Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From Gustav at cactus.dk Fri Dec 4 06:33:36 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 13:33:36 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John Oh, I misunderstood you. Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 12:53 >>> I really meant do you use linq in your C# apps? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes and no. I used an old version for some time but the current version is more powerful. > > Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. > > /gustav > >>>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> > Do you use it? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John et al >> >> Don't forget LINQPad. >> >> Why LINQ beats SQL: >> http://www.linqpad.net/WhyLINQBeatsSQL.aspx >> >> /gustav >> >> >>>>> Gustav at cactus.dk 02-12-2009 08:19 >>> >> Hi John >> >> As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. >> >> ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. >> >> /gustav From jwcolby at colbyconsulting.com Fri Dec 4 07:54:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 08:54:21 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B19148D.9070607@colbyconsulting.com> >I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) I have to say that as a developer of a higher level language, I can see where avoiding TSQL would be something we would try to do. While I understand that SQL Server can be integrated into and used straight from the VS environment, most of us come at it from the built-in editor which frankly sucks. And I mean REALLY BADLY sucks, no apologies to our admin friends. I guess I have been doing SP development for a couple of years now and I still hate the built-in editor. And yet... that is what I use. IMHO this is an area where MS has fallen down on the job. If this integration thing is so darned simple, then MS should push education, seminars, books, education, education to get us working in VS to run (program) SQL Server. From a development perspective, and that is what SPs and UDF are after all, SQL Server should just be a tool used to manipulate data, NOT a dev environment. Over the last month I have found two APIs that allow C# to do a ton of stuff directly in SQL Server. WAY COOL stuff, but you would think it was porn the way you don't see it in the mainstream. These APIs allow you to manipulate SQL server the same way you can manipulate any other object - create, delete, observe, modify, manipulate anything in SQL Server - straight from VS. But where are the forums, the blogs, the developer excitement? It appears to me that there is a very real "here is your database" aimed at the developers who use SQL Server, and the admins just do things the way they always have for the last 20 years. And they buy tools from the RedGates of the world who undoubtedly do salivate over these new APIs. Just my humble opinion. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I misunderstood you. > Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 07:56:15 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 08:56:15 -0500 Subject: [dba-VB] Application settings In-Reply-To: References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <4B1914FF.1050705@colbyconsulting.com> Charlotte, My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: > > > - > - > 0 > Microsoft.Jet.OLEDB.4.0 > C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb > RIMUser > > > false > > - > 1 > sqloledb > infoserver > > > RIMDrillDataSQL > true > > > > We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. > > Shared ds As DataSet > Shared _connectionString As String > > Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath > > Private Shared Sub ReadSettingsFile() > If IO.File.Exists(_xmlPath) Then > Call CreateSchema() > ds.ReadXml(_xmlPath) > Call DecryptPassword() > _connectionString = GetConnectionString() > Else > If ds.Tables(0).Rows.Count = 0 Then > 'placeholder for jet settings > Dim row As DataRow = ds.Tables(0).NewRow > row("dbtype") = 0 > row("provider") = "Microsoft.Jet.OLEDB.4.0" > ds.Tables(0).Rows.Add(row) > > 'placeholder for sql settings > row = ds.Tables(0).NewRow > row("dbtype") = 1 > row("provider") = "sqloledb" > ds.Tables(0).Rows.Add(row) > End If > End If > End Sub > > Private Shared Sub CreateSchema() > ds = New DataSet > Dim table As New DataTable("connection") > table.Columns.Add("dbtype", GetType(Integer)) > table.Columns.Add("provider", GetType(String)) > table.Columns.Add("datasource", GetType(String)) > table.Columns.Add("userid", GetType(String)) > table.Columns.Add("password", GetType(String)) > table.Columns.Add("initialcatalog", GetType(String)) > table.Columns.Add("trusted", GetType(Boolean)) > table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} > > ds.Tables.Add(table) > End Sub > > Charlotte > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 03, 2009 3:39 PM > To: VBA > Subject: [dba-VB] Application settings > > I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Dec 4 08:17:12 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 15:17:12 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 14:54 >>> >I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) I have to say that as a developer of a higher level language, I can see where avoiding TSQL would be something we would try to do. While I understand that SQL Server can be integrated into and used straight from the VS environment, most of us come at it from the built-in editor which frankly sucks. And I mean REALLY BADLY sucks, no apologies to our admin friends. I guess I have been doing SP development for a couple of years now and I still hate the built-in editor. And yet... that is what I use. IMHO this is an area where MS has fallen down on the job. If this integration thing is so darned simple, then MS should push education, seminars, books, education, education to get us working in VS to run (program) SQL Server. From a development perspective, and that is what SPs and UDF are after all, SQL Server should just be a tool used to manipulate data, NOT a dev environment. Over the last month I have found two APIs that allow C# to do a ton of stuff directly in SQL Server. WAY COOL stuff, but you would think it was porn the way you don't see it in the mainstream. These APIs allow you to manipulate SQL server the same way you can manipulate any other object - create, delete, observe, modify, manipulate anything in SQL Server - straight from VS. But where are the forums, the blogs, the developer excitement? It appears to me that there is a very real "here is your database" aimed at the developers who use SQL Server, and the admins just do things the way they always have for the last 20 years. And they buy tools from the RedGates of the world who undoubtedly do salivate over these new APIs. Just my humble opinion. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I misunderstood you. > Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 08:43:46 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 09:43:46 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B192022.5080005@colbyconsulting.com> >they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. I actually think that is a good thing, developers who just use data shouldn't need to be learning SQL Server to get their data. That is really not the audience I am addressing however. IMHO the built-in editor of SQL Server should either be removed entirely or at least brought into the current century. It is notepad with pretty colors. How many millions of man hours have been wasted trying to track down errors when the only error message presented was "error near (insert some unrelated thing here)". Why bother even throwing up an error like that, and that is 99.9% of the errors I have EVER seen in two years working with SQL Server. Notepad, with pretty colors. For all of the rude comments us Access developers get about Access being "a toy", the code editor in Access is in a complete other galaxy from the code editor in SQL Server. SQL Server editor looks like it was designed in 1986 and never upgraded. Of course with the "real men don't use code editors" mentality of the DBA side of the fence I can see why MS doesn't bother spending time on this. Someday I really am going to have to figure out how to use VS to run / debug my SPs and stuff. To me VS just seems over-the-top complex for the level of stuff I am trying to do. An Access type of code editor would be just the right level of convenience and capability - built right into SSMS. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. > > /gustav From Gustav at cactus.dk Fri Dec 4 09:32:07 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 16:32:07 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John LINQPad does pure SQL too, though not with IntelliSense, and error messages seem to be those from SQL Server. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 15:43 >>> >they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. I actually think that is a good thing, developers who just use data shouldn't need to be learning SQL Server to get their data. That is really not the audience I am addressing however. IMHO the built-in editor of SQL Server should either be removed entirely or at least brought into the current century. It is notepad with pretty colors. How many millions of man hours have been wasted trying to track down errors when the only error message presented was "error near (insert some unrelated thing here)". Why bother even throwing up an error like that, and that is 99.9% of the errors I have EVER seen in two years working with SQL Server. Notepad, with pretty colors. For all of the rude comments us Access developers get about Access being "a toy", the code editor in Access is in a complete other galaxy from the code editor in SQL Server. SQL Server editor looks like it was designed in 1986 and never upgraded. Of course with the "real men don't use code editors" mentality of the DBA side of the fence I can see why MS doesn't bother spending time on this. Someday I really am going to have to figure out how to use VS to run / debug my SPs and stuff. To me VS just seems over-the-top complex for the level of stuff I am trying to do. An Access type of code editor would be just the right level of convenience and capability - built right into SSMS. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. > > /gustav From cfoust at infostatsystems.com Fri Dec 4 10:10:23 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 4 Dec 2009 10:10:23 -0600 Subject: [dba-VB] Application settings In-Reply-To: <4B1914FF.1050705@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> Message-ID: OK, then I don't understand the question. What do you mean about the settings "area" of the project? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 04, 2009 5:56 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Charlotte, My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: > > > - > - > 0 > Microsoft.Jet.OLEDB.4.0 > C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb > RIMUser > > > false > > - > 1 > sqloledb > infoserver > > > RIMDrillDataSQL > true > > > > We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. > > Shared ds As DataSet > Shared _connectionString As String > > Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath > > Private Shared Sub ReadSettingsFile() > If IO.File.Exists(_xmlPath) Then > Call CreateSchema() > ds.ReadXml(_xmlPath) > Call DecryptPassword() > _connectionString = GetConnectionString() > Else > If ds.Tables(0).Rows.Count = 0 Then > 'placeholder for jet settings > Dim row As DataRow = ds.Tables(0).NewRow > row("dbtype") = 0 > row("provider") = "Microsoft.Jet.OLEDB.4.0" > ds.Tables(0).Rows.Add(row) > > 'placeholder for sql settings > row = ds.Tables(0).NewRow > row("dbtype") = 1 > row("provider") = "sqloledb" > ds.Tables(0).Rows.Add(row) > End If > End If > End Sub > > Private Shared Sub CreateSchema() > ds = New DataSet > Dim table As New DataTable("connection") > table.Columns.Add("dbtype", GetType(Integer)) > table.Columns.Add("provider", GetType(String)) > table.Columns.Add("datasource", GetType(String)) > table.Columns.Add("userid", GetType(String)) > table.Columns.Add("password", GetType(String)) > table.Columns.Add("initialcatalog", GetType(String)) > table.Columns.Add("trusted", GetType(Boolean)) > table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} > > ds.Tables.Add(table) > End Sub > > Charlotte > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 03, 2009 3:39 PM > To: VBA > Subject: [dba-VB] Application settings > > I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ From jwcolby at colbyconsulting.com Fri Dec 4 10:33:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 11:33:52 -0500 Subject: [dba-VB] Application settings In-Reply-To: References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> Message-ID: <4B1939F0.7020905@colbyconsulting.com> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > OK, then I don't understand the question. What do you mean about the settings "area" of the project? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 04, 2009 5:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Application settings > > Charlotte, > > My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. > > John W. Colby > www.ColbyConsulting.com > From shamil at smsconsulting.spb.ru Fri Dec 4 10:46:41 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 4 Dec 2009 19:46:41 +0300 Subject: [dba-VB] Application settings In-Reply-To: <4B1939F0.7020905@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> <4B1939F0.7020905@colbyconsulting.com> Message-ID: <01b001ca7501$5c9e3650$15daa2f0$@spb.ru> Hi John, You can access those properties using: Properties.Settings.Default.{{PropertyName}} Or {{Root Namespace}}.Properties.Settings.Default.{{PropertyName}} -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 04, 2009 7:34 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 11:24:46 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 18:24:46 +0100 Subject: [dba-VB] Application settings Message-ID: Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6-66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > OK, then I don't understand the question. What do you mean about the settings "area" of the project? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 04, 2009 5:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Application settings > > Charlotte, > > My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. > > John W. Colby > www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 4 12:30:32 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 13:30:32 -0500 Subject: [dba-VB] Code Search Message-ID: <4B195548.4030300@colbyconsulting.com> Has anyone noticed this on Google? http://www.google.com/codesearch?hl=en Anyone using it? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 4 14:33:00 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 4 Dec 2009 23:33:00 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 15:39:43 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 22:39:43 +0100 Subject: [dba-VB] Application settings Message-ID: Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 21:33 >>> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 4 16:06:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 01:06:11 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01be01ca752d$ff4dfe40$fde9fac0$@spb.ru> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 21:33 >>> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 16:18:39 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 23:18:39 +0100 Subject: [dba-VB] Application settings Message-ID: Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 23:06 >>> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav From cfoust at infostatsystems.com Fri Dec 4 19:24:01 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 4 Dec 2009 19:24:01 -0600 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: That was my understanding as well, Gustav. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 2:19 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 23:06 >>> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Dec 5 07:03:33 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 16:03:33 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <01d001ca75ab$5adb7670$10926350$@spb.ru> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Sat Dec 5 07:03:33 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 16:03:33 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01d101ca75ab$5c18d870$144a8950$@spb.ru> Hi Gustav and all, JC original request was "to access/modify" application settings AFAIU: <<< I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. >>> -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 1:19 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Sat Dec 5 12:57:15 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sat, 05 Dec 2009 19:57:15 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Sat Dec 5 16:54:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 6 Dec 2009 01:54:50 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <01e001ca75fd$f4891280$dd9b3780$@spb.ru> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Sun Dec 6 09:04:00 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 06 Dec 2009 16:04:00 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From michael at ddisolutions.com.au Sun Dec 6 16:00:52 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 7 Dec 2009 09:00:52 +1100 Subject: [dba-VB] Code Search References: <4B195548.4030300@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827F2@ddi-01.DDI.local> Hi John, No and not yet! Cheers Michael M Has anyone noticed this on Google? http://www.google.com/codesearch?hl=en Anyone using it? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From michael at ddisolutions.com.au Sun Dec 6 16:03:36 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 7 Dec 2009 09:03:36 +1100 Subject: [dba-VB] Application settings - Test References: <4B184BFF.6040203@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Test reply, Am I getting through??? Or am I being ignored??? :-) Cheers Michael M Hi John, Is this what your after? global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting = "New Value"; global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); cheers Michael M I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 _______________________________________________ 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 - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From jwcolby at colbyconsulting.com Sun Dec 6 16:45:30 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 06 Dec 2009 17:45:30 -0500 Subject: [dba-VB] Application settings - Test In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> References: <4B184BFF.6040203@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Message-ID: <4B1C340A.7090004@colbyconsulting.com> LOL. We'd never ignore you! John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Test reply, > Am I getting through??? > Or am I being ignored??? :-) > > Cheers > > Michael M > > > Hi John, > > Is this what your after? > > > global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting > = "New Value"; > > global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); > > cheers > > Michael M > > I want to create application settings for things like the server > instance that the program will bang > on, the name of my database that I save my custom UDFs and SPs in etc. > It is trivial to get there > in the interface but Google is not my friend tonight in discovering how > to access / modify them > through code. > > Anybody? > From wdhindman at dejpolsystems.com Sun Dec 6 16:29:05 2009 From: wdhindman at dejpolsystems.com (William Hindman) Date: Sun, 6 Dec 2009 17:29:05 -0500 Subject: [dba-VB] Application settings - Test In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> References: <4B184BFF.6040203@colbyconsulting.com><59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Message-ID: <59B0F0614709418884DE2B4E1551B143@jislaptopdev> ...yes, but we're ignoring you ...its Sunday here, eh :) William -------------------------------------------------- From: "Michael Maddison" Sent: Sunday, December 06, 2009 5:03 PM To: "Discussion concerning Visual Basic and related programming issues." Subject: Re: [dba-VB] Application settings - Test > Test reply, > Am I getting through??? > Or am I being ignored??? :-) > > Cheers > > Michael M > > > Hi John, > > Is this what your after? > > > global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting > = "New Value"; > > global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); > > cheers > > Michael M > > I want to create application settings for things like the server > instance that the program will bang > on, the name of my database that I save my custom UDFs and SPs in etc. > It is trivial to get there > in the interface but Google is not my friend tonight in discovering how > to access / modify them > through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: > 12/04/09 06:36:00 > > _______________________________________________ > 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 - www.avg.com > Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: > 12/04/09 06:36:00 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Mon Dec 7 01:47:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 7 Dec 2009 10:47:50 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <021101ca7711$949ff220$bddfd660$@spb.ru> Hi Gustav -- Thank you. OK, March 22 - official release - so January 2010 MSDN might have it... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, December 06, 2009 6:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732- A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Mon Dec 7 01:53:42 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 07 Dec 2009 08:53:42 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil I cannot tell - and I don't have an MSDN subscription ... /gustav >>> shamil at smsconsulting.spb.ru 07-12-2009 08:47 >>> Hi Gustav -- Thank you. OK, March 22 - official release - so January 2010 MSDN might have it... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, December 06, 2009 6:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil From jwcolby at colbyconsulting.com Mon Dec 7 07:46:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 08:46:22 -0500 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <4B1D072E.6060008@colbyconsulting.com> I have to say... "Scott Guthrie" ... with a name like that he should have been a musician. John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 7 07:56:31 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 08:56:31 -0500 Subject: [dba-VB] Application settings In-Reply-To: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> References: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> Message-ID: <4B1D098F.30807@colbyconsulting.com> OK, I am trying to reference Properties.Settings.Default["ServerName"].ToString() and get the error 'System.Windows.Forms.PropertyStore' does not contain a definition for 'Settings' and no extension method 'Settings' accepting a first argument of type 'System.Windows.Forms.PropertyStore' could be found (are you missing a using directive or an assembly reference?) John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Gustav, > > You can set > > Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; > > and save settings having "User" scope: > > Properties.Settings.Default.Save(); > > And they are saved not in {{ApplicationExecutableFileName}}.config, which > you deliver with you app's executable but anywhere else on your system - > probably somewhere in user's Application Settings - standard windows folder. > I have never had time to find out where settings are saved. Anybody? > > Recap: > > - settings are loaded from {{ApplicationExecutableFileName}}.config when you > deliver you application, and it runs first time; > - as soon as you save "User" scope settings they are saved in and loaded > from {{UnknownPlace}}; > - if you move your application files into another folder on the same system > the settings are again loaded on first run from > {{ApplicationExecutableFileName}}; > - ... > > That looks confusing a bit but it's how it works... > > You can click "Learn more about application settings..." on top right of > VS2008 application settings window available by Solution Explorer -> Project > name -> Right-Click -> Settings... > > But if you wanted to have rather complicated structure of your application > settings file then better use your own custom XML files, which can be loaded > from/saved to files many ways without almost any coding... > > Thank you. > > -- > Shamil > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, December 04, 2009 8:25 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Application settings > > Hi John > > Shamil is right, but that method is for reading only. > Please note that the Properties' collection object is read-only, thus it > takes quite a few steps to add a property: > > http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- > 66be-44ce-8a65-ab548f6f4f04 > > I have not used this as I haven't had any need to add properties on the fly. > Reading and writing was fine for me, and new properties I added manually. > > You may find it much easier and perhaps more convenient to just have a > dataset which you read and write from/to an XML-file. I've posted code for > this before. > > /gustav > > >>>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> > Under the project is a properties object. Double click that and an entire > multi-tabbed dialog opens. > > Click the settings tab. There you will see a form where you can enter name, > type, scope, value. > > As far as I can tell this is a place where I (the developer) can create > settings that my program > will use and manipulate, settings (for example) to tell my program the name > of the SQL Server > instance to use in a connection string, the name of my control database > where I store my stored > procedures and UDFs. Stuff like that. Stuff that I am currently hard > coding, but which really > should be in a settings tab so that I don't have to remember where that > constant is in code, I can > just go to the settings tab to change. > > My expectation is that there is an object somewhere in the .net namespace > that allows you to do > something like "Something.Somethingelse.Settings["MyServerName"]...." to > access these things. > > I expect to be able to create new ones, edit existing ones, delete them etc > from a .Net object. I > am looking for that .Net syntax that allows me to do this from code. > > John W. Colby > www.ColbyConsulting.com > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4661 (20091204) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-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 Dec 7 08:03:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 09:03:10 -0500 Subject: [dba-VB] Application settings In-Reply-To: <01d101ca75ab$5c18d870$144a8950$@spb.ru> References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> Message-ID: <4B1D0B1E.1090109@colbyconsulting.com> OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Gustav and all, > > JC original request was "to access/modify" application settings AFAIU: > <<< > I want to create application settings for things like the server instance > that the program will bang on, the name of my database that I save my custom > UDFs and SPs in etc. It is trivial to get there in the interface but Google > is not my friend tonight in discovering how to access / modify them through > code. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Saturday, December 05, 2009 1:19 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Application settings > > Hi Shamil > > I guess I'm too busy today. I read it as JC wanted to create these on the > fly ... > > /gustav > > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4661 (20091204) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > 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 Dec 7 09:00:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 07 Dec 2009 16:00:02 +0100 Subject: [dba-VB] Application settings Message-ID: Hi John The file containing the settings is app.config. To hold "global" settings you could create a small project with just this file and reference it from any other project. /gustav >>> jwcolby at colbyconsulting.com 07-12-2009 15:03 >>> OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com From mmattys at rochester.rr.com Mon Dec 7 10:57:22 2009 From: mmattys at rochester.rr.com (Mike Mattys) Date: Mon, 7 Dec 2009 11:57:22 -0500 Subject: [dba-VB] Application settings References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> <4B1D0B1E.1090109@colbyconsulting.com> Message-ID: My understanding of Properties.Settings is that settings must be by User in order to be saved and the xml file will reside in the Local Setting/Applications directory under the user's My Documents folder. In that case, all projects under a solution could read a single xml file. We decided to use cryptographic services for the i/o of the xml by using an internal static class that reads/writes to a string collection using methods we created like bof, eof, movefirst, addnew, etc. - Michael R Mattys MapPoint and Database Dev www.mattysconsulting.com - ----- Original Message ----- From: "jwcolby" To: "Discussion concerning Visual Basic and related programming issues." Sent: Monday, December 07, 2009 9:03 AM Subject: Re: [dba-VB] Application settings > OK, it appears that each project has its own set of properties. If I set > the same property in the > current project's property set then > > Properties.Settings.Default["ServerName"].ToString() > > works just fine. > > But that is not the behavior I want. I need a SOLUTION property set, > which appears to not exist? > Which perhaps would explain why those who have done this before roll their > own? > > Does anyone have code to do this so I don't have to roll my own (a.k.a. > reinvent the wheel) too? > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: >> Hi Gustav and all, >> >> JC original request was "to access/modify" application settings AFAIU: >> <<< >> I want to create application settings for things like the server instance >> that the program will bang on, the name of my database that I save my >> custom >> UDFs and SPs in etc. It is trivial to get there in the interface but >> Google >> is not my friend tonight in discovering how to access / modify them >> through >> code. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Saturday, December 05, 2009 1:19 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] Application settings >> >> Hi Shamil >> >> I guess I'm too busy today. I read it as JC wanted to create these on the >> fly ... >> >> /gustav >> >> >> <<< snip >>> >> >> >> __________ Information from ESET NOD32 Antivirus, version of virus >> signature >> database 4661 (20091204) __________ >> >> The message was checked by ESET NOD32 Antivirus. >> >> http://www.esetnod32.ru >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From pharold at proftesting.com Mon Dec 7 11:18:37 2009 From: pharold at proftesting.com (Perry L Harold) Date: Mon, 7 Dec 2009 12:18:37 -0500 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: <4B1D072E.6060008@colbyconsulting.com> References: <4B1D072E.6060008@colbyconsulting.com> Message-ID: Maybe Arlo's brother? Perry -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 07, 2009 8:46 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Scott Guthrie in town I have to say... "Scott Guthrie" ... with a name like that he should have been a musician. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Dec 7 13:54:55 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 7 Dec 2009 22:54:55 +0300 Subject: [dba-VB] Application settings In-Reply-To: <4B1D0B1E.1090109@colbyconsulting.com> References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> <4B1D0B1E.1090109@colbyconsulting.com> Message-ID: <001b01ca7777$2741d5c0$75c58140$@spb.ru> Hi John -- For solution you can select one of the projects to be used to handle settings. That project is usually a core(utility/generic/settings) class library. Then if you wish you can additionally wrap Properties.Settings.Default... for every/most of the settings into your custom global (Solution scope) properties' wrappers. Such wrapping makes your referencing projects independent on actual implementation of handling of application settings. When that done and works OK you can go and "reinvent the wheel" if needed without any changes in referencing projects... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 07, 2009 5:03 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4668 (20091207) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Dec 8 01:55:00 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 8 Dec 2009 07:55:00 -0000 Subject: [dba-VB] OT: Thin SQL Client for Linux In-Reply-To: References: Message-ID: <4b1e0661.0f67f10a.205a.ffffd8ee@mx.google.com> OT: Thin SQL Client for Linux Can anybody find me a good THIN sql client for Linux I need to find one in the next day, I am stuck on an escalation and we really need this. So any help appreciated. Thanks Max From Gustav at cactus.dk Tue Dec 8 10:11:52 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 08 Dec 2009 17:11:52 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil et al He has posted links to the PP slides and demo code here: http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe-december-2009.aspx for: ASP.NET 4 and VS 2010 Web Development: Slides + Demos + Blog Posts ASP.NET MVC 2.0: Slides + Walkthrough Silverlight 4: Slides (warning: large download) /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Tue Dec 8 11:52:14 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 8 Dec 2009 20:52:14 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <006c01ca782f$2e61ae30$8b250a90$@spb.ru> Hi Gustav, Thank you for the links. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, December 08, 2009 7:12 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil et al He has posted links to the PP slides and demo code here: http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe -december-2009.aspx for: ASP.NET 4 and VS 2010 Web Development: Slides + Demos + Blog Posts ASP.NET MVC 2.0: Slides + Walkthrough Silverlight 4: Slides (warning: large download) /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4670 (20091208) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 9 08:04:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 09:04:21 -0500 Subject: [dba-VB] c# Browse folder dialog Message-ID: <4B1FAE65.2070700@colbyconsulting.com> When I set the BrowseFolder.SelectedPath property, it displays the directory tree with the selected directory NOT expanded. I would like to cause the selected directory to already be expanded. Does anyone know if this is possible? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Dec 9 08:43:38 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 09 Dec 2009 15:43:38 +0100 Subject: [dba-VB] c# Browse folder dialog Message-ID: Hi John I think not. This old project uses the Shell dialogue and has a SetExpanded method. Maybe you can get some ideas: http://www.codeproject.com/KB/selection/folderbrowser.aspx /gustav >>> jwcolby at colbyconsulting.com 09-12-2009 15:04:21 >>> When I set the BrowseFolder.SelectedPath property, it displays the directory tree with the selected directory NOT expanded. I would like to cause the selected directory to already be expanded. Does anyone know if this is possible? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 09:49:25 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 10:49:25 -0500 Subject: [dba-VB] C# - Thoughts on my methods Message-ID: <4B1FC705.9010902@colbyconsulting.com> As a consultant in a home office I work in total isolation except for this email group. So I need your input, to keep me sane and to keep me on the right path. I would like your thoughts on what I am doing and what I am intending to do. As you know, I have "the database from hell", for which I am developing an application to allow me to manipulate the various pieces from an application interface rather than directly from stored procedures and the SSMS or from Access, which is what I have done to this point. With C# I am able to do more than I was able from Access, including getting back output parameters from stored procedures. So... my process so far. First off, I am developing the overall application as a set of child projects inside of the application. The main application opens a form with a menu, and that menu takes me to forms in the child projects to perform pieces of the application. For example I have a database backup project where I can backup and restore specific databases or groups of databases. I have an Accuzip project where I can export CSV files to and import resulting CSV files from the external Accuzip program. I have an Orders project where I can create and manipulate the orders I create for the client. Each child project is physically located underneath the main application directory. In order to reference (open) the forms in the child projects, I have to set a reference to that project and I have to set a using statement in the form. I still do not understand what these two pieces do. Why do I have to set a reference and a using? I assume you cannot set a using statement unless the project references the library (or project)? I also don't understand why some objects in a referenced project class can be seen but others cannot. IOW I can use one class in a namespace as a type to dimension an object, but another class in the same namespace is not visible, cannot be so used. I don't understand a whole ton of things of this nature and I have to say that the whole "break into projects" idea is turning out to be more work than it might be worth. Any comments on this email will be much appreciated. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 11:42:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 12:42:12 -0500 Subject: [dba-VB] C# - zip / unzip Message-ID: <4B1FE174.90207@colbyconsulting.com> Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 13:14:16 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 14:14:16 -0500 Subject: [dba-VB] threading Message-ID: <4B1FF708.1040700@colbyconsulting.com> As mentioned in previous emails, I am developing an application to manage all of the tasks for the DBFH. This includes Backing up databases, creating orders, transferring data between an external app etc. I am trying to determine how to thread this app such that if I start a process exporting data to Accuzip, I could have another process importing data from Accuzip, and also be working on an order. As things currently stand, each of these tasks is a project and each project has its own forms and classes, and anything else necessary for that task. I really do want to be able to do multiple things like this at the same time. Exporting data to Accuzip can take overnight, and actually consists of an export and a matching import process. It makes perfect sense (to me) to have threads doing this kind of thing, and allow me to go back to the main application and do something else. But at what level would I use a thread? Would I use a thread to open the form that performs the AZ process? This would allow me to get that started and immediately go back to the main app and open another form (using a new thread?) to start processing an order. Or would the form open and the button on the form start a thread that executes the process? If a form starts a thread, that allows the user (me) to do other things in that form potentially changing to a new directory or selecting a different database. Do you disable all controls on a form when a thread starts? I never had to think about this in VBA and it is all rather confusing. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] threading In-Reply-To: <4B1FF708.1040700@colbyconsulting.com> References: <4B1FF708.1040700@colbyconsulting.com> Message-ID: <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> Hi John -- Why not have several (FE) applications if they are so independent? - all developed within one VS solution but as separate (WinForms) projects sharing the same (set of) class library(-ies)? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 10:14 PM To: VBA Subject: [dba-VB] threading As mentioned in previous emails, I am developing an application to manage all of the tasks for the DBFH. This includes Backing up databases, creating orders, transferring data between an external app etc. I am trying to determine how to thread this app such that if I start a process exporting data to Accuzip, I could have another process importing data from Accuzip, and also be working on an order. As things currently stand, each of these tasks is a project and each project has its own forms and classes, and anything else necessary for that task. I really do want to be able to do multiple things like this at the same time. Exporting data to Accuzip can take overnight, and actually consists of an export and a matching import process. It makes perfect sense (to me) to have threads doing this kind of thing, and allow me to go back to the main application and do something else. But at what level would I use a thread? Would I use a thread to open the form that performs the AZ process? This would allow me to get that started and immediately go back to the main app and open another form (using a new thread?) to start processing an order. Or would the form open and the button on the form start a thread that executes the process? If a form starts a thread, that allows the user (me) to do other things in that form potentially changing to a new directory or selecting a different database. Do you disable all controls on a form when a thread starts? I never had to think about this in VBA and it is all rather confusing. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B1FE174.90207@colbyconsulting.com> References: <4B1FE174.90207@colbyconsulting.com> Message-ID: <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> Hi John, Have a look for DotNetNuke sources - they have free sources for zipping/unzipping. Those sources are used in core DNN functionality (modules setup) - IOW they tested well, they are stable and thry work very well. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 8:42 PM To: VBA Subject: [dba-VB] C# - zip / unzip Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: <4B1FC705.9010902@colbyconsulting.com> References: <4B1FC705.9010902@colbyconsulting.com> Message-ID: <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 6:49 PM To: VBA Subject: [dba-VB] C# - Thoughts on my methods As a consultant in a home office I work in total isolation except for this email group. So I need your input, to keep me sane and to keep me on the right path. I would like your thoughts on what I am doing and what I am intending to do. As you know, I have "the database from hell", for which I am developing an application to allow me to manipulate the various pieces from an application interface rather than directly from stored procedures and the SSMS or from Access, which is what I have done to this point. With C# I am able to do more than I was able from Access, including getting back output parameters from stored procedures. So... my process so far. First off, I am developing the overall application as a set of child projects inside of the application. The main application opens a form with a menu, and that menu takes me to forms in the child projects to perform pieces of the application. For example I have a database backup project where I can backup and restore specific databases or groups of databases. I have an Accuzip project where I can export CSV files to and import resulting CSV files from the external Accuzip program. I have an Orders project where I can create and manipulate the orders I create for the client. Each child project is physically located underneath the main application directory. In order to reference (open) the forms in the child projects, I have to set a reference to that project and I have to set a using statement in the form. I still do not understand what these two pieces do. Why do I have to set a reference and a using? I assume you cannot set a using statement unless the project references the library (or project)? I also don't understand why some objects in a referenced project class can be seen but others cannot. IOW I can use one class in a namespace as a type to dimension an object, but another class in the same namespace is not visible, cannot be so used. I don't understand a whole ton of things of this nature and I have to say that the whole "break into projects" idea is turning out to be more work than it might be worth. Any comments on this email will be much appreciated. -- John W. Colby www.ColbyConsulting.com _______________________________________________ __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From cfoust at infostatsystems.com Wed Dec 9 15:11:49 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 9 Dec 2009 15:11:49 -0600 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> References: <4B1FC705.9010902@colbyconsulting.com> <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Message-ID: I have to point out that it is exceptionally easy to create circular references when the projects are set up like this. That's why in our apps we keep all the forms in a project, all the reports in a project, etc. Of course, if we were using libraries rather than projects under the solution, it would be different. But this way, it can get messy fast. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, December 09, 2009 12:59 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - Thoughts on my methods Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil From cfoust at infostatsystems.com Wed Dec 9 15:17:15 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 9 Dec 2009 15:17:15 -0600 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B1FE174.90207@colbyconsulting.com> References: <4B1FE174.90207@colbyconsulting.com> Message-ID: You can roll your own using J# from within VS. Idid that originally and it only takes minor translation to put it into C# or VB. That said, we currently use Xceed. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 9:42 AM To: VBA Subject: [dba-VB] C# - zip / unzip Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From phpons at free.fr Wed Dec 9 15:24:33 2009 From: phpons at free.fr (Philippe) Date: Wed, 9 Dec 2009 22:24:33 +0100 Subject: [dba-VB] Ajax application problem Message-ID: <3262DDC894CA427DB254732FCE5E70AF@VOSTRO> Hi all, I have problems putting an ajax application on a production server. The application consists of an aspx page that keeps the javascript code. This code talks with C# page methods to access Web services and interact with the database. For example the first thing the user has to do is fill in login and password fields and click on the btnLogin. Then the code execute the following command: PageMethods.GetUser(user, onGetUserSuccess, onGetUserError); with user being an array containing username and password. The C# GetUser webmethod returns its response to the onGetUserSuccess callback function. The application runs ok on my dev pc. I installed it on the production server, copying the aspx file, web.config file and the binary files. When I run it, I get an error message, something like error during the handling of your request.(freely translated from french!!) This error is displayed into a textbox by the onGetUserError callback function. I put an error trapping withing the webmethod, but its error message is not returned, leading me to think that this webmethod is not "entered". Therefore the javascript code is running ok, but the call to the webmethod is failing. I guess I missed to copy something like a javascript file from the framework, or something else. Do you have any kind of experience in this regard? NB: I also checked that the asp framework is of version 2.0 on the server, it's ok. TIA, Philippe Pons From shamil at smsconsulting.spb.ru Wed Dec 9 15:41:54 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 10 Dec 2009 00:41:54 +0300 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: References: <4B1FC705.9010902@colbyconsulting.com> <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Message-ID: <00d201ca7918$6e663b10$4b32b130$@spb.ru> Hi Charlotte -- Yes, it's easy to create cross-refs, and it's (usually) easy to solve cross-refs under Visual Studio - please provide an example where cross-refs resolving is a really tough task - this sample shouldn't be the case where one decides to resolve cross-refs in a legacy "spaghetti" set of projects IOW we assume we're talking about experienced developers who prevent having "cross-refs" spaghetti by doing code clean-up/refactoring/de-cross-referencing once in a while within a project's sources life-time... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, December 10, 2009 12:12 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Thoughts on my methods I have to point out that it is exceptionally easy to create circular references when the projects are set up like this. That's why in our apps we keep all the forms in a project, all the reports in a project, etc. Of course, if we were using libraries rather than projects under the solution, it would be different. But this way, it can get messy fast. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, December 09, 2009 12:59 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - Thoughts on my methods Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 9 16:44:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 17:44:08 -0500 Subject: [dba-VB] threading In-Reply-To: <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> References: <4B1FF708.1040700@colbyconsulting.com> <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> Message-ID: <4B202838.1080404@colbyconsulting.com> > Why not have several (FE) applications if they are so independent? - all developed within one VS solution but as separate (WinForms) projects sharing the same (set of) class library(-ies)? It seems like that may be what I am doing? I have a single solution. Inside of that solution's physical directory I have multiple projects, each in its own directory. As I expand the solution I do an add / new project from the main solution / project. Doing that takes care of creating a directory structure for each new project, but causes it to be created under the main solution directory. Each project does not depend in any way on any other project, though I do have some shared libraries. Each child project is referenced by the main project, but the child projects do not reference other child projects. Now whether each of these independent projects ends up as individual applications I don't have a clue. I was just tying them together with a single form / menu so that I have one central application to go to to find everything. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Why not have several (FE) applications if they are so independent? - all > developed within one VS solution but as separate (WinForms) projects sharing > the same (set of) class library(-ies)? > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 10:14 PM > To: VBA > Subject: [dba-VB] threading > > As mentioned in previous emails, I am developing an application to manage > all of the tasks for the > DBFH. This includes Backing up databases, creating orders, transferring > data between an external > app etc. I am trying to determine how to thread this app such that if I > start a process exporting > data to Accuzip, I could have another process importing data from Accuzip, > and also be working on an > order. > > As things currently stand, each of these tasks is a project and each project > has its own forms and > classes, and anything else necessary for that task. I really do want to be > able to do multiple > things like this at the same time. Exporting data to Accuzip can take > overnight, and actually > consists of an export and a matching import process. It makes perfect sense > (to me) to have threads > doing this kind of thing, and allow me to go back to the main application > and do something else. > > But at what level would I use a thread? Would I use a thread to open the > form that performs the AZ > process? This would allow me to get that started and immediately go back to > the main app and open > another form (using a new thread?) to start processing an order. > > Or would the form open and the button on the form start a thread that > executes the process? If a > form starts a thread, that allows the user (me) to do other things in that > form potentially changing > to a new directory or selecting a different database. Do you disable all > controls on a form when a > thread starts? I never had to think about this in VBA and it is all rather > confusing. > From jwcolby at colbyconsulting.com Wed Dec 9 16:48:36 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 17:48:36 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> References: <4B1FE174.90207@colbyconsulting.com> <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> Message-ID: <4B202944.8000306@colbyconsulting.com> > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? > From michael at ddisolutions.com.au Wed Dec 9 17:11:11 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 10 Dec 2009 10:11:11 +1100 Subject: [dba-VB] C# - zip / unzip References: <4B1FE174.90207@colbyconsulting.com><00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> <4B202944.8000306@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0158281F@ddi-01.DDI.local> I've never used it but there are builtin libraries for zipping/unzipping. Look in System.IO.Compression The help file looks, well, helpfull for a change :-) using System; using System.IO; using System.IO.Compression; public class GZipTest { private const int buffer_size = 100; public static int ReadAllBytesFromStream(Stream stream, byte[] buffer) { // Use this method is used to read all bytes from a stream. int offset = 0; int totalCount = 0; while (true) { int bytesRead = stream.Read(buffer, offset, buffer_size); if (bytesRead == 0) { break; } offset += bytesRead; totalCount += bytesRead; } return totalCount; } public static bool CompareData(byte[] buf1, int len1, byte[] buf2, int len2) { // Use this method to compare data from two different buffers. if (len1 != len2) { Console.WriteLine("Number of bytes in two buffer are different {0}:{1}", len1, len2); return false; } for (int i = 0; i < len1; i++) { if (buf1[i] != buf2[i]) { Console.WriteLine("byte {0} is different {1}|{2}", i, buf1[i], buf2[i]); return false; } } Console.WriteLine("All bytes compare."); return true; } public static void GZipCompressDecompress(string filename) { Console.WriteLine("Test compression and decompression on file {0}", filename); FileStream infile; try { // Open the file as a FileStream object. infile = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[infile.Length]; // Read the file to ensure it is readable. int count = infile.Read(buffer, 0, buffer.Length); if (count != buffer.Length) { infile.Close(); Console.WriteLine("Test Failed: Unable to read data from file"); return; } infile.Close(); MemoryStream ms = new MemoryStream(); // Use the newly created memory stream for the compressed data. GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true); Console.WriteLine("Compression"); compressedzipStream.Write(buffer, 0, buffer.Length); // Close the stream. compressedzipStream.Close(); Console.WriteLine("Original size: {0}, Compressed size: {1}", buffer.Length, ms.Length); // Reset the memory stream position to begin decompression. ms.Position = 0; GZipStream zipStream = new GZipStream(ms, CompressionMode.Decompress); Console.WriteLine("Decompression"); byte[] decompressedBuffer = new byte[buffer.Length + buffer_size]; // Use the ReadAllBytesFromStream to read the stream. int totalCount = GZipTest.ReadAllBytesFromStream(zipStream, decompressedBuffer); Console.WriteLine("Decompressed {0} bytes", totalCount); if (!GZipTest.CompareData(buffer, buffer.Length, decompressedBuffer, totalCount)) { Console.WriteLine("Error. The two buffers did not compare."); } zipStream.Close(); } // end try catch (InvalidDataException) { Console.WriteLine("Error: The file being read contains invalid data."); } catch (FileNotFoundException) { Console.WriteLine("Error:The file specified was not found."); } catch (ArgumentException) { Console.WriteLine("Error: path is a zero-length string, contains only white space, or contains one or more invalid characters"); } catch (PathTooLongException) { Console.WriteLine("Error: The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The specified path is invalid, such as being on an unmapped drive."); } catch (IOException) { Console.WriteLine("Error: An I/O error occurred while opening the file."); } catch (UnauthorizedAccessException) { Console.WriteLine("Error: path specified a file that is read-only, the path is a directory, or caller does not have the required permissions."); } catch (IndexOutOfRangeException) { Console.WriteLine("Error: You must provide parameters for MyGZIP."); } } public static void Main(string[] args) { string usageText = "Usage: MYGZIP "; //If no file name is specified, write usage text. if (args.Length == 0) { Console.WriteLine(usageText); } else { if (File.Exists(args[0])) GZipCompressDecompress(args[0]); } } } Cheers Michael M > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? > _______________________________________________ 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 - www.avg.com Version: 9.0.709 / Virus Database: 270.14.99/2553 - Release Date: 12/09/09 06:54:00 From Gustav at cactus.dk Thu Dec 10 04:22:54 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 10 Dec 2009 11:22:54 +0100 Subject: [dba-VB] C# - zip / unzip Message-ID: Hi Michael Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. A bit strange that this widely used function is missing from the framework. /gustav >>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> I've never used it but there are builtin libraries for zipping/unzipping. Look in System.IO.Compression The help file looks, well, helpfull for a change :-) using System; using System.IO; using System.IO.Compression; public class GZipTest { private const int buffer_size = 100; public static int ReadAllBytesFromStream(Stream stream, byte[] buffer) { // Use this method is used to read all bytes from a stream. int offset = 0; int totalCount = 0; while (true) { int bytesRead = stream.Read(buffer, offset, buffer_size); if (bytesRead == 0) { break; } offset += bytesRead; totalCount += bytesRead; } return totalCount; } public static bool CompareData(byte[] buf1, int len1, byte[] buf2, int len2) { // Use this method to compare data from two different buffers. if (len1 != len2) { Console.WriteLine("Number of bytes in two buffer are different {0}:{1}", len1, len2); return false; } for (int i = 0; i < len1; i++) { if (buf1[i] != buf2[i]) { Console.WriteLine("byte {0} is different {1}|{2}", i, buf1[i], buf2[i]); return false; } } Console.WriteLine("All bytes compare."); return true; } public static void GZipCompressDecompress(string filename) { Console.WriteLine("Test compression and decompression on file {0}", filename); FileStream infile; try { // Open the file as a FileStream object. infile = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[infile.Length]; // Read the file to ensure it is readable. int count = infile.Read(buffer, 0, buffer.Length); if (count != buffer.Length) { infile.Close(); Console.WriteLine("Test Failed: Unable to read data from file"); return; } infile.Close(); MemoryStream ms = new MemoryStream(); // Use the newly created memory stream for the compressed data. GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true); Console.WriteLine("Compression"); compressedzipStream.Write(buffer, 0, buffer.Length); // Close the stream. compressedzipStream.Close(); Console.WriteLine("Original size: {0}, Compressed size: {1}", buffer.Length, ms.Length); // Reset the memory stream position to begin decompression. ms.Position = 0; GZipStream zipStream = new GZipStream(ms, CompressionMode.Decompress); Console.WriteLine("Decompression"); byte[] decompressedBuffer = new byte[buffer.Length + buffer_size]; // Use the ReadAllBytesFromStream to read the stream. int totalCount = GZipTest.ReadAllBytesFromStream(zipStream, decompressedBuffer); Console.WriteLine("Decompressed {0} bytes", totalCount); if (!GZipTest.CompareData(buffer, buffer.Length, decompressedBuffer, totalCount)) { Console.WriteLine("Error. The two buffers did not compare."); } zipStream.Close(); } // end try catch (InvalidDataException) { Console.WriteLine("Error: The file being read contains invalid data."); } catch (FileNotFoundException) { Console.WriteLine("Error:The file specified was not found."); } catch (ArgumentException) { Console.WriteLine("Error: path is a zero-length string, contains only white space, or contains one or more invalid characters"); } catch (PathTooLongException) { Console.WriteLine("Error: The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The specified path is invalid, such as being on an unmapped drive."); } catch (IOException) { Console.WriteLine("Error: An I/O error occurred while opening the file."); } catch (UnauthorizedAccessException) { Console.WriteLine("Error: path specified a file that is read-only, the path is a directory, or caller does not have the required permissions."); } catch (IndexOutOfRangeException) { Console.WriteLine("Error: You must provide parameters for MyGZIP."); } } public static void Main(string[] args) { string usageText = "Usage: MYGZIP "; //If no file name is specified, write usage text. if (args.Length == 0) { Console.WriteLine(usageText); } else { if (File.Exists(args[0])) GZipCompressDecompress(args[0]); } } } Cheers Michael M > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? From jwcolby at colbyconsulting.com Thu Dec 10 07:12:44 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 10 Dec 2009 08:12:44 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: References: Message-ID: <4B20F3CC.4090604@colbyconsulting.com> Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple source. Several DLLs out there. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi Michael > > Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. > > A bit strange that this widely used function is missing from the framework. > > /gustav > > >>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> > I've never used it but there are builtin libraries for > zipping/unzipping. > Look in System.IO.Compression From dbdoug at gmail.com Thu Dec 10 08:20:06 2009 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 10 Dec 2009 06:20:06 -0800 Subject: [dba-VB] Slightly O/T - web development stuff Message-ID: <4dd71a0c0912100620w6ef71523w11fba8e1ab39a454@mail.gmail.com> www.sitepoint.com is putting one or more of their books/videos on sale every day this month. A couple of days ago I got seven 20 minute videos on Ajax and css for $15; yesterday I got 3 full books on Javascript/Ajax in pdf form for the same $15. Doug Steele From jwcolby at colbyconsulting.com Sun Dec 13 21:45:18 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 13 Dec 2009 22:45:18 -0500 Subject: [dba-VB] Do you wanna learn c#? Message-ID: <4B25B4CE.9010105@colbyconsulting.com> Have I got the book for you. http://www.amazon.com/Microsoft%C2%AE-XNA%C2%AE-Game-Studio-3-0/dp/0735626588/ref=sr_1_2?ie=UTF8&s=books&qid=1260761698&sr=1-2 I bought this book because I found the XNA studio and wanted to learn all about how it works. But this book is about teaching programming, and from that C#. For anyone who knows vba or VB.net it will start off easy, but for anyone who doesn't program at all it also starts off easy. This might be the best book for learning to program (in general) I have run into. Plus it is fun. You need Visual Studio (express is fine) and you need the XNA studio (it is also free). An XBox 360 game controller will be required pretty quickly. I bought the cheapest controller for $15 from Wally world. Then start reading (and writing). I am on chapter 5 now (in about three days) and working on through it. I swear you will learn C#, have fun while you are at it, AND learn how the XNA game studio framework works which is also an awesome tool. Really folks, this is the real deal, if you have always said "I should..." do this one. Or get your teenager involved in it. I bought the book new from Amazon for about $20, plus the controller. Everything else is free. That is a great deal folks! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 14 08:47:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Dec 2009 09:47:22 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B20F3CC.4090604@colbyconsulting.com> References: <4B20F3CC.4090604@colbyconsulting.com> Message-ID: <4B264FFA.5020603@colbyconsulting.com> I am working on creating a single field index on every field of a table. I promptly ran into so many problems making it generic that I punted and went back to hard coding the database / table name. I did find this: select Name as FldName from psm11203.sys.columns WHERE object_id = OBJECT_ID('PSM11203.dbo.tblOrderData') Which does give me a table of field names. Using this in a cursor I am then able to create an index on each field, so I am off and running. This is really a one off process that I need to run on my tblHSID - the table from hell from the database from hell. I have to tell you I am a bit hesitant to pull the trigger in this for the table from hell. It is going to take many minutes to build each index and there are well over 500 fields to index. I could end up locking up my database for the next month. ;) I did create a copy, created a clustered index and will be creating all of these indexes on that copy, but even then it pretty much uses all of the resources of the server. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple > source. Several DLLs out there. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi Michael >> >> Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. >> >> A bit strange that this widely used function is missing from the framework. >> >> /gustav >> >> >>>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> >> I've never used it but there are builtin libraries for >> zipping/unzipping. >> Look in System.IO.Compression > > _______________________________________________ > dba-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 Dec 14 09:02:42 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Dec 2009 10:02:42 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B264FFA.5020603@colbyconsulting.com> References: <4B20F3CC.4090604@colbyconsulting.com> <4B264FFA.5020603@colbyconsulting.com> Message-ID: <4B265392.3010107@colbyconsulting.com> Boy did I reply to the wrong email or what??? John W. Colby www.ColbyConsulting.com jwcolby wrote: > I am working on creating a single field index on every field of a table. I promptly ran into so > many problems making it generic that I punted and went back to hard coding the database / table > name. I did find this: > > select Name as FldName from psm11203.sys.columns > WHERE object_id = OBJECT_ID('PSM11203.dbo.tblOrderData') > > Which does give me a table of field names. Using this in a cursor I am then able to create an index > on each field, so I am off and running. > > This is really a one off process that I need to run on my tblHSID - the table from hell from the > database from hell. > > I have to tell you I am a bit hesitant to pull the trigger in this for the table from hell. It is > going to take many minutes to build each index and there are well over 500 fields to index. I could > end up locking up my database for the next month. ;) > > I did create a copy, created a clustered index and will be creating all of these indexes on that > copy, but even then it pretty much uses all of the resources of the server. > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: >> Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple >> source. Several DLLs out there. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Gustav Brock wrote: >>> Hi Michael >>> >>> Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. >>> >>> A bit strange that this widely used function is missing from the framework. >>> >>> /gustav >>> >>> >>>>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> >>> I've never used it but there are builtin libraries for >>> zipping/unzipping. >>> Look in System.IO.Compression >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Johncliviger at aol.com Tue Dec 15 04:10:47 2009 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 15 Dec 2009 05:10:47 EST Subject: [dba-VB] A Parameters syntax question Message-ID: Hi All I'm connecting a vb2005 DataGridView to an Access db via vb code to return a subset of records from a table. Using the GUID dataType it works fine but when I change the datatype I get all the records. I'm using the Imports system.Data.OleDb class. From there I have OleDb connection, Command, DataAdapter and a Dataset. EG. With Command .CommandText = "QueryName" .CommandType = CommandType.StoredProcedure .Connection = OleDbConnection .Parameters.Add("@REFNOC", OleDbType.Guid,16).Value = New Guid(REFNOC) end With Every thing works as it should. That is until I change the the datatype in the Parameter line and try to use a string or Integer. I can't get the syntax right for the .Parameters line. If for example I change the .Parameter to say .Parameters.Add("@REFNOC", OleDbType.Single).Value = REFNOC I get all records Can anyone cast a little light here? From Johncliviger at aol.com Tue Dec 15 04:39:12 2009 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 15 Dec 2009 05:39:12 EST Subject: [dba-VB] Parameters problem solved Message-ID: Now then who's a silly boy! When using parameters in vb.net connection one does need to specify the parameter in the back-end query!! Then it works a treat johncliviger From jwcolby at colbyconsulting.com Wed Dec 16 16:20:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 16 Dec 2009 17:20:08 -0500 Subject: [dba-VB] windows 7 media center Message-ID: <4B295D18.7070000@colbyconsulting.com> Well my Vista Windows Media Center (WMC) finally bit the dust. Something happened (a SP install I suspect) and the codec got trashed (I think) and suddenly WMC no workee - no tv of any kind, already recorded or off of the tv card. As a college student I qualify to buy a copy of Windows 7 for $29 which sounded too good to pass up. And that version supposedly had a much improved MCE. So I did. Bought it, and installed it ON A 30 gb FLASH DRIVE last night. Finished about 3:30 am. She workee again. In the meantime I also went from a low power dual core to a medium powered quad core, but twice the ghz rating. Needless to say the Home theater PC flies. Now if it will just work for a long time with no maintenance. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 17 20:37:41 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 17 Dec 2009 21:37:41 -0500 Subject: [dba-VB] SQL Server 2008 install broke my application Message-ID: <4B2AEAF5.3080201@colbyconsulting.com> A perfectly functioning application has all kinds of compile errors after the SQL Server install. A bunch of Microsoft.SQLServer.XXX references had to be deleted and rereferenced. The sole remaining issue that I still haven't gotten around is the Transfer object, supposedly part of the SMO object is suddenly gone missing. And I was using that to copy a database and all of its internal objects. Sigh. -- John W. Colby www.ColbyConsulting.com From bheid at sc.rr.com Sun Dec 20 00:29:55 2009 From: bheid at sc.rr.com (Bobby Heid) Date: Sun, 20 Dec 2009 01:29:55 -0500 Subject: [dba-VB] SQL Server 2008 install broke my application In-Reply-To: <4B2AEAF5.3080201@colbyconsulting.com> References: <4B2AEAF5.3080201@colbyconsulting.com> Message-ID: <000301ca813d$d82a7610$887f6230$@rr.com> Hey John, Did you install the SQL Client Tools? I was just reading something about this today. I think the SMO stuff is installed with the client tools. I am not positive though. If this does not solve your issue, I'll see if I can find that reference tomorrow. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 17, 2009 9:38 PM To: VBA Subject: [dba-VB] SQL Server 2008 install broke my application A perfectly functioning application has all kinds of compile errors after the SQL Server install. A bunch of Microsoft.SQLServer.XXX references had to be deleted and rereferenced. The sole remaining issue that I still haven't gotten around is the Transfer object, supposedly part of the SMO object is suddenly gone missing. And I was using that to copy a database and all of its internal objects. Sigh. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Dec 20 09:29:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 20 Dec 2009 10:29:39 -0500 Subject: [dba-VB] SPAM-LOW: Re: SQL Server 2008 install broke my application In-Reply-To: <000301ca813d$d82a7610$887f6230$@rr.com> References: <4B2AEAF5.3080201@colbyconsulting.com> <000301ca813d$d82a7610$887f6230$@rr.com> Message-ID: <4B2E42E3.4090208@colbyconsulting.com> I checked every box on the install. John W. Colby www.ColbyConsulting.com Bobby Heid wrote: > Hey John, > > Did you install the SQL Client Tools? I was just reading something about > this today. I think the SMO stuff is installed with the client tools. I am > not positive though. If this does not solve your issue, I'll see if I can > find that reference tomorrow. > > Bobby > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 17, 2009 9:38 PM > To: VBA > Subject: [dba-VB] SQL Server 2008 install broke my application > > A perfectly functioning application has all kinds of compile errors after > the SQL Server install. A > bunch of Microsoft.SQLServer.XXX references had to be deleted and > rereferenced. The sole remaining > issue that I still haven't gotten around is the Transfer object, supposedly > part of the SMO object > is suddenly gone missing. And I was using that to copy a database and all > of its internal objects. > > Sigh. > From jwcolby at colbyconsulting.com Tue Dec 22 10:18:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 22 Dec 2009 11:18:12 -0500 Subject: [dba-VB] Multimonitor toolbar Message-ID: <4B30F144.6090504@colbyconsulting.com> I just found this, WAY COOL! It puts a toolbar at the bottom of the second monitor that displays the icons for the programs being displayed on the second monitor. How come no one told me about this? http://www.mediachance.com/free/multimon.htm -- John W. Colby www.ColbyConsulting.com From paul.hartland at googlemail.com Thu Dec 24 06:09:00 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 24 Dec 2009 12:09:00 +0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False Message-ID: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com From andy at minstersystems.co.uk Thu Dec 24 06:59:11 2009 From: andy at minstersystems.co.uk (Andy Lacey) Date: Thu, 24 Dec 2009 12:59:11 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> Message-ID: <153B93F23C804502875134D824C863BA@MINSTER> Hi Paul Well I'll wait to be corrected but I reckon they're simply two syntactically different ways of saying the same thing. They'd surely compile into the same code. So it just comes down to preference of style and readability, i.e. totally subjective Andy -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: 24 December 2009 12:09 To: VisualBasicList Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Thu Dec 24 07:07:18 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 24 Dec 2009 13:07:18 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <153B93F23C804502875134D824C863BA@MINSTER> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> <153B93F23C804502875134D824C863BA@MINSTER> Message-ID: <4b33679b.0e67f10a.2282.ffffa79b@mx.google.com> Or you could do this (which I prefer) If not rst.eof then Do my stuff Else Msgbox "who nicked my records" Endif Ps. Who is the programmer? You, or the Project Manager? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Andy Lacey Sent: 24 December 2009 12:59 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False Hi Paul Well I'll wait to be corrected but I reckon they're simply two syntactically different ways of saying the same thing. They'd surely compile into the same code. So it just comes down to preference of style and readability, i.e. totally subjective Andy -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: 24 December 2009 12:09 To: VisualBasicList Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 24 10:14:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 24 Dec 2009 11:14:22 -0500 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> Message-ID: <4B33935E.5000607@colbyconsulting.com> Paul, Perhaps better would be: if MyRecordset.BOF and MyRecordset.EOF then msgbox "Empty" else do stuff here endif It is easier to read the true than the nots, especially when there is more than one. Either one works. If this is in a tight loop and speed matters, then the NOT might cause a very slight slowdown as it is two extra boolean operators. OTOH the compiler might just pick it up and rewrite it to my syntax anyway. John W. Colby www.ColbyConsulting.com Paul Hartland wrote: > To all, > > I use a lot of recordsets, and to detect they actually contain something I > have always used the following: > > If myrecordset.bof=false and myrecordset.eof=false then > do my stuff here > Else > msgbox "empty" > End If > > However my project manager prefers: > If not myrecordset.bof and not myrecordset.eof then > do my stuff here > Else > msgbox "empty" > End If > > Is there actually a prefered way, or is one quicker than the other, or is > there an even better way to do this ? > > Thanks in advance for any comments, and a very merry christmas & happy new > year to everyone. > From max.wanadoo at gmail.com Thu Dec 24 12:13:13 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 24 Dec 2009 18:13:13 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <4B33935E.5000607@colbyconsulting.com> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> <4B33935E.5000607@colbyconsulting.com> Message-ID: <4b33af5b.1067f10a.3ae6.ffffb846@mx.google.com> John, I don't think that will work...something from Getz etc sticks in my mind...might be old age though. maxx -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 24 December 2009 16:14 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False Paul, Perhaps better would be: if MyRecordset.BOF and MyRecordset.EOF then msgbox "Empty" else do stuff here endif It is easier to read the true than the nots, especially when there is more than one. Either one works. If this is in a tight loop and speed matters, then the NOT might cause a very slight slowdown as it is two extra boolean operators. OTOH the compiler might just pick it up and rewrite it to my syntax anyway. John W. Colby www.ColbyConsulting.com Paul Hartland wrote: > To all, > > I use a lot of recordsets, and to detect they actually contain something I > have always used the following: > > If myrecordset.bof=false and myrecordset.eof=false then > do my stuff here > Else > msgbox "empty" > End If > > However my project manager prefers: > If not myrecordset.bof and not myrecordset.eof then > do my stuff here > Else > msgbox "empty" > End If > > Is there actually a prefered way, or is one quicker than the other, or is > there an even better way to do this ? > > Thanks in advance for any comments, and a very merry christmas & happy new > year to everyone. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 31 16:29:43 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 31 Dec 2009 17:29:43 -0500 Subject: [dba-VB] Happy new year Message-ID: <4B3D25D7.2030404@colbyconsulting.com> I will likely be asleep when it actually happens locally, so I wish each and every one of you a MUCH better year in 2010. HAPPY NEW YEAR! -- John W. Colby www.ColbyConsulting.com From garykjos at gmail.com Thu Dec 31 16:35:55 2009 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 31 Dec 2009 16:35:55 -0600 Subject: [dba-VB] [AccessD] Happy new year In-Reply-To: <4B3D25D7.2030404@colbyconsulting.com> References: <4B3D25D7.2030404@colbyconsulting.com> Message-ID: Likewise for me too John. Early to bed, early to rise is my program for the most part. I echo your sentiments. Happy New Year! GK On Thu, Dec 31, 2009 at 4:29 PM, jwcolby wrote: > I will likely be asleep when it actually happens locally, so I wish each and every one of you a MUCH > better year in 2010. > > HAPPY NEW YEAR! > > -- > John W. Colby > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.com From marklbreen at gmail.com Tue Dec 1 09:12:22 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 1 Dec 2009 15:12:22 +0000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B14231F.3020905@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com> Message-ID: Hello John, I have struggled with this value, and mixed it up with the connectionTimeout also. As a result, when I think there will be a delay, I also set it to zero, and then I sleep easy. I did that two years ago with out troublesome app, and now it works and works and works. Whats the downside of infinite timeout. If it takes three weeks, you will find out anyway, but why kill it after ten mins when it would have finished successfully in 19.45 minutes. Mark 2009/11/30 jwcolby > Any words of wisdom on setting the command.Timeout property? I have stored > procedures that execute > instantly, and others that can take an hour or more (large appends). > > How can I discover how long a stored procedure takes to run so that I can > set this property > dynamically? As an example I have cases where I am appending 65 million > rows into a table of 6 > fields. This can take a long time (at the very least perhaps 20 minutes) > but if I could get a > "RecordsAffected" count for such queries as well as the time it took to > execute, then I could start > to discover that it takes "X seconds / million" records, and set the > timeout to a reasonable value > based on the records to be appended. > > This doesn't have to be any exact time value. I assume a simple pair of > time variables, then "stop > time - start time"? > > Or should I just discover worst case and set it to that? > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 09:24:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 10:24:10 -0500 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: References: <4B14231F.3020905@colbyconsulting.com> Message-ID: <4B15351A.40500@colbyconsulting.com> Mark, Thanks for the response. >If it takes three weeks, you will find out anyway, but why kill it after ten mins when it would have finished successfully in 19.45 minutes. I hear you! BTW how do you kill an executing stored procedure? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > I have struggled with this value, and mixed it up with the connectionTimeout > also. As a result, when I think there will be a delay, I also set it to > zero, and then I sleep easy. I did that two years ago with > out troublesome app, and now it works and works and works. Whats the > downside of infinite timeout. If it takes three weeks, you will find out > anyway, but why kill it after ten mins when it would have finished > successfully in 19.45 minutes. > > > Mark > > > > > 2009/11/30 jwcolby > >> Any words of wisdom on setting the command.Timeout property? I have stored >> procedures that execute >> instantly, and others that can take an hour or more (large appends). >> >> How can I discover how long a stored procedure takes to run so that I can >> set this property >> dynamically? As an example I have cases where I am appending 65 million >> rows into a table of 6 >> fields. This can take a long time (at the very least perhaps 20 minutes) >> but if I could get a >> "RecordsAffected" count for such queries as well as the time it took to >> execute, then I could start >> to discover that it takes "X seconds / million" records, and set the >> timeout to a reasonable value >> based on the records to be appended. >> >> This doesn't have to be any exact time value. I assume a simple pair of >> time variables, then "stop >> time - start time"? >> >> Or should I just discover worst case and set it to that? >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Tue Dec 1 09:49:01 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 1 Dec 2009 15:49:01 +0000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B15351A.40500@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com> <4B15351A.40500@colbyconsulting.com> Message-ID: Hello John, Not sure, but stopping the server is one way. My main problems were sprocs stopping when I did not want them to stop, for me, if it is still running after 24 hours, it is probably never going to stop. For you, you might increase that to 48 hours, but in general, they either finish promptly, or else will never finish, either way, timing out after 10, 20, 50, or even 600 minutes is almost never a good option, if there is a possibility that it will finish in 601 minutes. There is probably a way to stop a process, Francisco or some of the other experts may know how, but I would either stop the db server / service, or else in worst case, do a quick reboot. For the rest of the year, I would never worry about it, happy in the knowledge they the server must work till the death :) Thanks Mark 2009/12/1 jwcolby > Mark, > > Thanks for the response. > > >If it takes three weeks, you will find out anyway, but why kill it after > ten mins when it would > have finished successfully in 19.45 minutes. > > I hear you! > > BTW how do you kill an executing stored procedure? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: > > Hello John, > > > > I have struggled with this value, and mixed it up with the > connectionTimeout > > also. As a result, when I think there will be a delay, I also set it to > > zero, and then I sleep easy. I did that two years ago with > > out troublesome app, and now it works and works and works. Whats the > > downside of infinite timeout. If it takes three weeks, you will find out > > anyway, but why kill it after ten mins when it would have finished > > successfully in 19.45 minutes. > > > > > > Mark > > > > > > > > > > 2009/11/30 jwcolby > > > >> Any words of wisdom on setting the command.Timeout property? I have > stored > >> procedures that execute > >> instantly, and others that can take an hour or more (large appends). > >> > >> How can I discover how long a stored procedure takes to run so that I > can > >> set this property > >> dynamically? As an example I have cases where I am appending 65 million > >> rows into a table of 6 > >> fields. This can take a long time (at the very least perhaps 20 > minutes) > >> but if I could get a > >> "RecordsAffected" count for such queries as well as the time it took to > >> execute, then I could start > >> to discover that it takes "X seconds / million" records, and set the > >> timeout to a reasonable value > >> based on the records to be appended. > >> > >> This doesn't have to be any exact time value. I assume a simple pair of > >> time variables, then "stop > >> time - start time"? > >> > >> Or should I just discover worst case and set it to that? > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 09:58:36 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 10:58:36 -0500 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: References: <4B14231F.3020905@colbyconsulting.com> <4B15351A.40500@colbyconsulting.com> Message-ID: <4B153D2C.90100@colbyconsulting.com> Mark, >but I would either stop the db server / service, or else in worst case, do a quick reboot. I have done both. I have corrupted the database doing the reboot. Stopping the service seems to work, however I have also seen the database pick up where it left off when the service restarted. I am sure there is some way to "officially" stop a running process, I just don't know how. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > Not sure, but stopping the server is one way. My main problems were sprocs > stopping when I did not want them to stop, for me, if it is still running > after 24 hours, it is probably never going to stop. For you, you might > increase that to 48 hours, but in general, they either finish promptly, or > else will never finish, either way, timing out after 10, 20, 50, or even 600 > minutes is almost never a good option, if there is a possibility that it > will finish in 601 minutes. > > There is probably a way to stop a process, Francisco or some of the other > experts may know how, but I would either stop the db server / service, or > else in worst case, do a quick reboot. For the rest of the year, I would > never worry about it, happy in the knowledge they the server must work till > the death :) > > Thanks > > Mark > > > > > > > 2009/12/1 jwcolby > >> Mark, >> >> Thanks for the response. >> >> >If it takes three weeks, you will find out anyway, but why kill it after >> ten mins when it would >> have finished successfully in 19.45 minutes. >> >> I hear you! >> >> BTW how do you kill an executing stored procedure? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Mark Breen wrote: >>> Hello John, >>> >>> I have struggled with this value, and mixed it up with the >> connectionTimeout >>> also. As a result, when I think there will be a delay, I also set it to >>> zero, and then I sleep easy. I did that two years ago with >>> out troublesome app, and now it works and works and works. Whats the >>> downside of infinite timeout. If it takes three weeks, you will find out >>> anyway, but why kill it after ten mins when it would have finished >>> successfully in 19.45 minutes. >>> >>> >>> Mark >>> >>> >>> >>> >>> 2009/11/30 jwcolby >>> >>>> Any words of wisdom on setting the command.Timeout property? I have >> stored >>>> procedures that execute >>>> instantly, and others that can take an hour or more (large appends). >>>> >>>> How can I discover how long a stored procedure takes to run so that I >> can >>>> set this property >>>> dynamically? As an example I have cases where I am appending 65 million >>>> rows into a table of 6 >>>> fields. This can take a long time (at the very least perhaps 20 >> minutes) >>>> but if I could get a >>>> "RecordsAffected" count for such queries as well as the time it took to >>>> execute, then I could start >>>> to discover that it takes "X seconds / million" records, and set the >>>> timeout to a reasonable value >>>> based on the records to be appended. >>>> >>>> This doesn't have to be any exact time value. I assume a simple pair of >>>> time variables, then "stop >>>> time - start time"? >>>> >>>> Or should I just discover worst case and set it to that? >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-VB mailing list >>>> dba-VB at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 10:07:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 11:07:22 -0500 Subject: [dba-VB] C# - Records Affected Message-ID: <4B153F3A.8010102@colbyconsulting.com> I am trying to get a count of records appended, updated etc in my SPs and returning that to my C# supervisor. I am finding references to @@Rowcount however this is returning 1 instead of the actual number. Is this @@RowCount the real deal? The SP definition: ALTER PROCEDURE [dbo].[sp_AZOut_AZExportToOrderedChunk] -- Add the parameters for the stored procedure here @DBName varchar(50), @ErrorDesc varchar(4000) output, @ErrorNo int output, @RecsAffected int output AS BEGIN Setting the returned value EXEC (@SQL) select @RecsAffected = @@RowCount My c# code: intRecsAffected = sCmd.Parameters["@RecsAffected"].Value The code triggers the try block if there is no such parameter (I just ignore it) or returns 1 if the parameter exists. This is a functioning tested SP which typically appends millions of records, though the exact number depends on the database. Is there something I need to know here? -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Tue Dec 1 10:49:57 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 02 Dec 2009 02:49:57 +1000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B153D2C.90100@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com>, , <4B153D2C.90100@colbyconsulting.com> Message-ID: <4B154935.15271.1331E01@stuart.lexacorp.com.pg> http://windowsitpro.com/article/articleid/14148/how-can-i-stop-a-sql-server-process.html Do a select * from sysprocesses and identify the spid in question. Then do a "KILL " This will mark the spid as "dead". Note that it may take a while for the process to end as it has to rollback all the updates that it has been doing. Also kill only marks the process as dead - the process itself needs to check for this, and if it is stuck in a loop as the result of a bug or whateverthen it won't terminate. Also certain processes like dump and dbcc commands have significant code paths where the kill command is not checked for and so these can take some time to terminate. Also, if the process is in an extended-stored procedure, or is waiting on network traffic/remote stored-procedure it will not check whether it has been terminated until these actions have been completed. See Q171224 for more info - including details on the waittype that can tell you what a process is waiting on. If the process won't die for one of the above reasons then your only choice is to stop the sqlservr.exe process itself and re-start. See also http://msdn.microsoft.com/en-us/library/aa933230%28SQL.80%29.aspx for info on KILL x WITH STATUSONLY for tracking the rollback once you kill a process. -- Stuart On 1 Dec 2009 at 10:58, jwcolby wrote: > I am sure there is some way to "officially" stop a running process, I just don't know how. > From jwcolby at colbyconsulting.com Tue Dec 1 10:50:57 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 11:50:57 -0500 Subject: [dba-VB] C# - Records Affected In-Reply-To: <4B153F3A.8010102@colbyconsulting.com> References: <4B153F3A.8010102@colbyconsulting.com> Message-ID: <4B154971.4000207@colbyconsulting.com> Sorry for the ring, I found the problem. The SP that I took this code from actually worked but the code I was testing did not and came before this code. The problem was simply that in the SP I did not place the line that captured @@RowCount immediately after the EXEC (@SQL) statement. All of the examples clearly warned me that this was a requirement but you understand "senior moments". Anyway, this is now working. Piece by piece this thing is coming together. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I am trying to get a count of records appended, updated etc in my SPs and returning that to my C# > supervisor. I am finding references to @@Rowcount however this is returning 1 instead of the actual > number. > > Is this @@RowCount the real deal? > > The SP definition: > > ALTER PROCEDURE [dbo].[sp_AZOut_AZExportToOrderedChunk] > -- Add the parameters for the stored procedure here > @DBName varchar(50), > @ErrorDesc varchar(4000) output, > @ErrorNo int output, > @RecsAffected int output > > AS > BEGIN > > > Setting the returned value > > EXEC (@SQL) > select @RecsAffected = @@RowCount > > My c# code: > > intRecsAffected = sCmd.Parameters["@RecsAffected"].Value > > The code triggers the try block if there is no such parameter (I just ignore it) or returns 1 if the > parameter exists. > > This is a functioning tested SP which typically appends millions of records, though the exact number > depends on the database. > > Is there something I need to know here? From jwcolby at colbyconsulting.com Tue Dec 1 16:53:55 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 17:53:55 -0500 Subject: [dba-VB] C# - Direct data manipulation Message-ID: <4B159E83.4000006@colbyconsulting.com> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 2 00:54:07 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 09:54:07 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B159E83.4000006@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> Message-ID: <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> Hi John -- I must say I have never done that "dynamic" t-SQL via C# - I guess it should be doable: using SMO or even SqlCommand's .ExecuteNonQuery(?) it should be possible to create SPs and UDFs, and then execute them as usual... BTW, UDFs, which return tables are very often a good substitute for all kinds of temp tables and dynamic SQL... I wonder what for all that "dynamism" there? Do you have constantly changing database structure? Do you have constantly changing customer requests, which do not allow you to create a set of stable parameterized SPs and UDFs, and for small(?) changing part of queries use LINQ for SQL or ADO.NET EF? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 1:54 AM To: VBA Subject: [dba-VB] C# - Direct data manipulation As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4653 (20091201) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 01:19:20 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 08:19:20 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. /gustav >>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Dec 2 01:31:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 08:31:02 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next-week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Wed Dec 2 02:05:18 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 11:05:18 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <00aa01ca7326$31634020$9429c060$@spb.ru> Hi Gustav -- Congrats! <<< A full day just sitting, listening, and learning! >>> Not easy. I usually very quick fall semi-asleep during such presentations as they look so slow - hope Scott Guthrie will make this one you'll attend tomorrow a very dynamic experience... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4653 (20091201) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 02:17:19 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 09:17:19 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil Oh, I know that feeling, indeed if the presenter has a voice like a priest and your knowledge about the topic is a little too high. But I'm confident that Scott Guthrie will keep me awake! /gustav >>> shamil at smsconsulting.spb.ru 02-12-2009 09:05 >>> Hi Gustav -- Congrats! <<< A full day just sitting, listening, and learning! >>> Not easy. I usually very quick fall semi-asleep during such presentations as they look so slow - hope Scott Guthrie will make this one you'll attend tomorrow a very dynamic experience... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From marklbreen at gmail.com Wed Dec 2 04:23:09 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 2 Dec 2009 10:23:09 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow Message-ID: Hello All, I am running VS 2008 on a powerful machine with loads of resources. My project is a DNN project sitting in the wwwroot folder which allows me to change a few lines of code and then immediately see the results in the web app. However, when I manipulate the Data Context Objects in the AppCode Folder, the response times are dreadfully, slow. It takes three to four minutes to open, edit, save and close one of these objects. I have tried it on a second machine and the results are similar. I can edit the Dbml files outside of the solution, but I am not sure whether that is safe to do so, when I edit them outside the solution (copying and pasting to another folder and then opening the dbml file from there), they open instantly. When I say "safe to do so", does the project file or the sln file need to be updated with the changes that have been made. I do get some warning message about "cannot find web.config, so using the file from the dbml file instead" which I accepted. I recall Shamil mentioned that manually editing these within the individual files is not a good idea, so i guess that he may have been suffering the same problems as I am, IE so sloooow to open and close. TIA for an help, if I have not expressed the problem clearly enough, let me know, Mark From shamil at smsconsulting.spb.ru Wed Dec 2 07:20:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 16:20:11 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: Message-ID: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Hello Mark -- First of all try to switch to FireFox - forget IE while debugging large ASP.NET apps from within VS.... I can only note that debugging large ASP.NET applications is a real PITA - this is why I'm always trying to get out as much as possible BL and DAL code into separate projects and develop, debug/test them without UI (ASP.NET or WinForms or WCF)... And DNN is a "huge ASP.NET" app with a lot of classlibs, which are so tightly coupled together that there is no way to debug part of them outside of running DNN instance - with all the consequences - bad luck... I suppose you can edit DNN's Data Context Objects source code from AppCode outside of VS (e.g. within notepad) - when the edits are saved then DNN will restart, that could take a while, quite a while.... A temp solution could be to keep *all* the source code of DNN module's control within that control's code behind .aspx.cs (.aspx.vb) during development - when you edit your code there then ASP.NET app will not restart it will just recompile .aspx and .aspx.cs - so it should work considerably quicker... All in all I think DNN custom modules development is a RPITA - one can never know how much it will finally take for a given project if they will not try to find a way to debug/ test as much as possible code outside of running DNN: something like develop a separate ASP.NET application, make it working and then port it to DNN environmnet... Be prepared for "crazy debug sessions" (if I'm not missing something and there are some "miracle" tools, which simplify DNN custom development debugging)... Philosophic note: DNN seems to be a good example that there "are no miracles in this world" - DNN is a great prototyping tool and CMS, when one has ready to use DNN modules and skins, and DNN is becoming RPITA when one have to develop a(n) (advanced) custom module. Rhetoric Question: Why in this world there couldn't be a "silver-bullet" tool able to support both standard and custom development with the same ease as DNN does support CMS development? I guess "Ruby on Rails" could be "what doctor ordered"?... Or ASP.NET MVC2 Framework? DNN did grow from a "junky" MS ASP.NET sample code base, and even advanced developers as DNN Core Development Team members are can't still "convert" that original "junk" to pearls... Hopefully they will do that in DNN v.7? - they "just" need to clean-up DNN huge code base and to implement what is called "Inversion of Control" (http://martinfowler.com/articles/injection.html) to "untight" DNN Core classlibs as much as possible... Please correct me if I'm wrong - in fact I'd be really happy to be wrong here as I have had to suspend one of the DNN projects, which didn't go smoothly because of PITA DNN custom modules development experience... Sorry, Mark, I have no a definitive answer for you here - just some "soap" and "bubbles" and PITA of my own DNN custom modules development experience, which I need to find a way to workaround, or quit the idea of DNN custom development completely as it's too expensive to be true. Still hope I missed some approaches to simplify this development - I mean ready to use approaches and tools without long learning curve... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Wednesday, December 02, 2009 1:23 PM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Why are my data Context Objects soooo sloooow Hello All, I am running VS 2008 on a powerful machine with loads of resources. My project is a DNN project sitting in the wwwroot folder which allows me to change a few lines of code and then immediately see the results in the web app. However, when I manipulate the Data Context Objects in the AppCode Folder, the response times are dreadfully, slow. It takes three to four minutes to open, edit, save and close one of these objects. I have tried it on a second machine and the results are similar. I can edit the Dbml files outside of the solution, but I am not sure whether that is safe to do so, when I edit them outside the solution (copying and pasting to another folder and then opening the dbml file from there), they open instantly. When I say "safe to do so", does the project file or the sln file need to be updated with the changes that have been made. I do get some warning message about "cannot find web.config, so using the file from the dbml file instead" which I accepted. I recall Shamil mentioned that manually editing these within the individual files is not a good idea, so i guess that he may have been suffering the same problems as I am, IE so sloooow to open and close. TIA for an help, if I have not expressed the problem clearly enough, let me know, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From marklbreen at gmail.com Wed Dec 2 07:39:14 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 2 Dec 2009 13:39:14 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Message-ID: Hello Shamil, Thank you for your detailed response. *Browsers* Some comments, I am actually using Chrome to View my work, but I am not doing any debugging, in the traditional sense, I code a few lines, click save and then view the results in Chrome, when I am not happy, I flick back to VS, change it and continue again. So, it is true to say, I am not really debugging, just viewing. However, I stopped using IE a few years ago, and since I switched to Chrome, it is the first thing I install on new machines. With the exception of the MSDN site, it works perfect for me. *Slow Data Contexts* So can I assume that this slowness is simply to be accepted, it is either a) the way VS2008 usually performs, or b) the way VS2008 performs when data contexts are involved in a large project such as DNN. I did not notice any difference when I copied the code from the wwwroot folder, so I hope that is not part of the problem. *DNN Development* Probably I am not doing real DNN custom programming, but I am currently building web user controls, and simply saving them, and then creating a module for DNN and including the web user control on that module. I know this is not real DNN programming, but have created about 20 module so far like this. DNN gives me, as a script kiddie type programmer, they ability to do a simple web app, but it manages the users and authentication, something that I could never program. IOW, with the exception of a few DNN hooks, I am doing simple programming, but throwing the results into DNN. *Free Lunch* I have to say I agree with you, there are limitations everywhere. My appoach is always to keep it as simple as possible until I absolutely know that I need to make it more complex. Thanks, Mark 2009/12/2 Shamil Salakhetdinov > Hello Mark -- > > First of all try to switch to FireFox - forget IE while debugging large > ASP.NET apps from within VS.... > > I can only note that debugging large ASP.NET applications is a real PITA > - > this is why I'm always trying to get out as much as possible BL and DAL > code > into separate projects and develop, debug/test them without UI (ASP.NET or > WinForms or WCF)... > > And DNN is a "huge ASP.NET" app with a lot of classlibs, which are so > tightly coupled together that there is no way to debug part of them outside > of running DNN instance - with all the consequences - bad luck... > > I suppose you can edit DNN's Data Context Objects source code from AppCode > outside of VS (e.g. within notepad) - when the edits are saved then DNN > will > restart, that could take a while, quite a while.... > > A temp solution could be to keep *all* the source code of DNN module's > control within that control's code behind .aspx.cs (.aspx.vb) during > development - when you edit your code there then ASP.NET app will not > restart it will just recompile .aspx and .aspx.cs - so it should work > considerably quicker... > > All in all I think DNN custom modules development is a RPITA - one can > never > know how much it will finally take for a given project if they will not try > to find a way to debug/ test as much as possible code outside of running > DNN: something like develop a separate ASP.NET application, make it > working > and then port it to DNN environmnet... > > Be prepared for "crazy debug sessions" (if I'm not missing something and > there are some "miracle" tools, which simplify DNN custom development > debugging)... > > Philosophic note: DNN seems to be a good example that there "are no > miracles > in this world" - DNN is a great prototyping tool and CMS, when one has > ready > to use DNN modules and skins, and DNN is becoming RPITA when one have to > develop a(n) (advanced) custom module. Rhetoric Question: Why in this world > there couldn't be a "silver-bullet" tool able to support both standard and > custom development with the same ease as DNN does support CMS development? > > I guess "Ruby on Rails" could be "what doctor ordered"?... > > Or ASP.NET MVC2 Framework? > > DNN did grow from a "junky" MS ASP.NET sample code base, and even advanced > developers as DNN Core Development Team members are can't still "convert" > that original "junk" to pearls... > > Hopefully they will do that in DNN v.7? - they "just" need to clean-up DNN > huge code base and to implement what is called "Inversion of Control" > (http://martinfowler.com/articles/injection.html) to "untight" DNN Core > classlibs as much as possible... > > Please correct me if I'm wrong - in fact I'd be really happy to be wrong > here as I have had to suspend one of the DNN projects, which didn't go > smoothly because of PITA DNN custom modules development experience... > > Sorry, Mark, I have no a definitive answer for you here - just some "soap" > and "bubbles" and PITA of my own DNN custom modules development experience, > which I need to find a way to workaround, or quit the idea of DNN custom > development completely as it's too expensive to be true. Still hope I > missed > some approaches to simplify this development - I mean ready to use > approaches and tools without long learning curve... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Wednesday, December 02, 2009 1:23 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello All, > > I am running VS 2008 on a powerful machine with loads of resources. My > project is a DNN project sitting in the wwwroot folder which allows me to > change a few lines of code and then immediately see the results in the web > app. > > However, when I manipulate the Data Context Objects in the AppCode Folder, > the response times are dreadfully, slow. It takes three to four minutes to > open, edit, save and close one of these objects. > > I have tried it on a second machine and the results are similar. > > I can edit the Dbml files outside of the solution, but I am not sure > whether > that is safe to do so, when I edit them outside the solution (copying and > pasting to another folder and then opening the dbml file from there), they > open instantly. When I say "safe to do so", does the project file or the > sln file need to be updated with the changes that have been made. I do get > some warning message about "cannot find web.config, so using the file from > the dbml file instead" which I accepted. > > I recall Shamil mentioned that manually editing these within the individual > files is not a good idea, so i guess that he may have been suffering the > same problems as I am, IE so sloooow to open and close. > > TIA for an help, if I have not expressed the problem clearly enough, let me > know, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Wed Dec 2 08:28:45 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 17:28:45 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Message-ID: <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Hi Mark, <<< *Slow Data Contexts* >>> What do you mean by that? - editing and saving your DNN Data Context Objects source code in \AppCode subfolder? What do you mean by "Dbml"? <<< but have created about 20 module so far like this. >>> OK, I have also made 30+ DNN5.x custom modules properly packed etc. - all very similar to each other but to get the first one was a time-consuming issue. "Tired" from that. Need a break. Then I maybe will make some more... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Wednesday, December 02, 2009 4:39 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow Hello Shamil, Thank you for your detailed response. *Browsers* Some comments, I am actually using Chrome to View my work, but I am not doing any debugging, in the traditional sense, I code a few lines, click save and then view the results in Chrome, when I am not happy, I flick back to VS, change it and continue again. So, it is true to say, I am not really debugging, just viewing. However, I stopped using IE a few years ago, and since I switched to Chrome, it is the first thing I install on new machines. With the exception of the MSDN site, it works perfect for me. *Slow Data Contexts* So can I assume that this slowness is simply to be accepted, it is either a) the way VS2008 usually performs, or b) the way VS2008 performs when data contexts are involved in a large project such as DNN. I did not notice any difference when I copied the code from the wwwroot folder, so I hope that is not part of the problem. *DNN Development* Probably I am not doing real DNN custom programming, but I am currently building web user controls, and simply saving them, and then creating a module for DNN and including the web user control on that module. I know this is not real DNN programming, but have created about 20 module so far like this. DNN gives me, as a script kiddie type programmer, they ability to do a simple web app, but it manages the users and authentication, something that I could never program. IOW, with the exception of a few DNN hooks, I am doing simple programming, but throwing the results into DNN. *Free Lunch* I have to say I agree with you, there are limitations everywhere. My appoach is always to keep it as simple as possible until I absolutely know that I need to make it more complex. Thanks, Mark <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 2 09:51:31 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 10:51:31 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> Message-ID: <4B168D03.3010706@colbyconsulting.com> Shamil, As I have discussed in the past, the business is doing the exact same process to many different tables. Because of the size of these tables and the processing involved I find it useful to store each table in it's own database. These are just lists of names, each list comes from a different source and is called something by the client, something that makes sense to him. These lists (a table) will always be millions of names / addresses, and often are 50 million or more. When you have 50 million names, the database, with just this one single table will be 10 or 20 gigabytes. Once you start processing it can mushroom to 50 gigabytes. Thus storing a dozen of these tables in a single database just doesn't make sense (to me). Thus I have a dozen different databases. I have to apply all of these stored procedures to each one of these databases once a month. Thus write the stored procedure such that I can pass in a database name and a table name. Voila, the SP works for all of my databases. But that means dynamic SQL. I really don't have an issue with dynamic SQL, although I have witnessed first hand the time required for SQL Server to do the "compile" - creating the execution plan. If I run the SP a second time with the same db and table name the time to execute drops sharply. BTW, these lists become the source for "orders" of names. Each of these orders also are stored in its own database, and I have to execute these same (or similar) SPs against each of these orders. Over the last 4 years I have perhaps a hundred of these order databases. This is what I do for this client, create these databases, and apply processes against these databases. The processes are exactly the same across all of the databases, thus having a stored procedure that performs some part of that process but can be applied to any of these databases makes sense (to me). I have spent the last five years performing these processes entirely manually, then one by one creating a stored procedure to automate one of the steps, then the next step, and the next. By now I have an entire master library with (let me go check) 42 different stored procedures that, taken together, automate my work for the client. THAT is the point of the C# side of things. Automating the automation so to speak. Taking these 42 stored procedures and stringing sets of them together, 7 which perform the output of data to an external program for processing, 6 more that get the processed data back in, a half dozen more that perform some other processing, another set that do order processing, etc. This is not a bank, or a company or a call center or a manufacturer, or any of the other "typical" SQL Server databases. It is name / address list processing and creating orders from these lists. Really pretty simple but extremely painstaking. And like anything else we do, I can't be making mistakes, it must be done in a specific manner, a specific sequence, EVERY time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > I must say I have never done that "dynamic" t-SQL via C# - I guess it should > be doable: using SMO or even SqlCommand's .ExecuteNonQuery(?) it should be > possible to create SPs and UDFs, and then execute them as usual... > > BTW, UDFs, which return tables are very often a good substitute for all > kinds of temp tables and dynamic SQL... > > I wonder what for all that "dynamism" there? > Do you have constantly changing database structure? > Do you have constantly changing customer requests, which do not allow you to > create a set of stable parameterized SPs and UDFs, and for small(?) changing > part of queries use LINQ for SQL or ADO.NET EF? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 02, 2009 1:54 AM > To: VBA > Subject: [dba-VB] C# - Direct data manipulation > > As previously mentioned, over the last couple of years I have built up a set > of stored procedures > which perform TSQL. I then run sets of these stored procedures to perform > processes. The TSQL is > always dynamic. > > As an example a stored procedure might build a table, with boilerplate field > names and data types, > but a passed in database and table name. Inside of the stored procedure I > build up the correct SQL > to create the table in the database specified, with the name specified. > Another stored procedure > might create in index, with boilerplate field names, but a passed in > database and table name. Again > the stored procedure builds up the TSQL statement to create the index in the > correct db and table. > > I already have these stored procedures debugged and working and have been > using them in sets to > perform "big picture processes" for quite some time, but the whole "execute > a stored procedure" > using a command object, parameter objects in a parameter array, interpreting > the parameters etc just > seems so... 1950s. I feel like I am flipping switches on the front panel of > a computer in a 50s > sci-fi movie as a tape reel spins madly in the background. > > Now that I am moving to C# I am wondering if this is required any more. Can > C# execute TSQL > directly somehow? Can I assemble this boiler plate plus database / table > kind of thing into a TSQL > statement directly in C# and then somehow tell SQL Server to execute that > TSQL? I understand the > "SQL optimization" thing but it seems like (not sure here) that because the > TSQL is dynamically > constructed in the stored procedure, the whole "optimization" thing goes > right out the window. If I > can execute TSQL directly from C#, what can I get back? Rows affected? > Error codes? And how? > > As it stands I am happily flipping switches, tape reels whirring, exporting > data for address > validation. This is good, I am happy, but ... > From paul.hartland at googlemail.com Wed Dec 2 10:05:20 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Wed, 2 Dec 2009 16:05:20 +0000 Subject: [dba-VB] Read XML File Using xsd Schema File Message-ID: <38c884770912020805s570c99e1ia753bf4f81b4d0f7@mail.gmail.com> To all, We have been a given what looks to me like a fairly complex XML file, we have also been given a xsd schema file. I tried using the SQLXMLBulkLoad object in VB6 and was getting the error Schema: relationship expected on 'Company'. The company that gave us both the files insist that the xsd is correct (according to my project manager). I downloaded and installed Stylus Studio 2010, with which I loaded the XML, and then generated my own xsd schame file. Tried again and this time get the same error as above, but instead of 'Company' the error was 'Groups' The VB6 code I am using is as follows: Dim objBL Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1" objBL.KeepIdentity = True objBL.errorlogfile = "C:\XML_StylusStudio\Error.log" objBL.checkconstraints = True objBL.xmlfragment = True objBL.schemagen = True objBL.sgdroptables = True objBL.Execute "C:\XML_StylusStudio\newschema.xsd", "C:\XML_StylusStudio\CDFull_Original.xml" Set objBl=Nothing The object of the exercise being that we generate related tables in SQL Server 2005 of the XML data. Would be grateful if anyone could help with this (would be happy to send example XML file and the schema offline), as I haven't got much hair left to pull out. Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From shamil at smsconsulting.spb.ru Wed Dec 2 11:23:04 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 20:23:04 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B168D03.3010706@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> Message-ID: <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> Hi John -- Thank you for your reply. Do you use your different databases for data input, or you also have to update those different databases' tables? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 6:52 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, As I have discussed in the past, the business is doing the exact same process to many different tables. Because of the size of these tables and the processing involved I find it useful to store each table in it's own database. These are just lists of names, each list comes from a different source and is called something by the client, something that makes sense to him. These lists (a table) will always be millions of names / addresses, and often are 50 million or more. When you have 50 million names, the database, with just this one single table will be 10 or 20 gigabytes. Once you start processing it can mushroom to 50 gigabytes. Thus storing a dozen of these tables in a single database just doesn't make sense (to me). Thus I have a dozen different databases. I have to apply all of these stored procedures to each one of these databases once a month. Thus write the stored procedure such that I can pass in a database name and a table name. Voila, the SP works for all of my databases. But that means dynamic SQL. I really don't have an issue with dynamic SQL, although I have witnessed first hand the time required for SQL Server to do the "compile" - creating the execution plan. If I run the SP a second time with the same db and table name the time to execute drops sharply. BTW, these lists become the source for "orders" of names. Each of these orders also are stored in its own database, and I have to execute these same (or similar) SPs against each of these orders. Over the last 4 years I have perhaps a hundred of these order databases. This is what I do for this client, create these databases, and apply processes against these databases. The processes are exactly the same across all of the databases, thus having a stored procedure that performs some part of that process but can be applied to any of these databases makes sense (to me). I have spent the last five years performing these processes entirely manually, then one by one creating a stored procedure to automate one of the steps, then the next step, and the next. By now I have an entire master library with (let me go check) 42 different stored procedures that, taken together, automate my work for the client. THAT is the point of the C# side of things. Automating the automation so to speak. Taking these 42 stored procedures and stringing sets of them together, 7 which perform the output of data to an external program for processing, 6 more that get the processed data back in, a half dozen more that perform some other processing, another set that do order processing, etc. This is not a bank, or a company or a call center or a manufacturer, or any of the other "typical" SQL Server databases. It is name / address list processing and creating orders from these lists. Really pretty simple but extremely painstaking. And like anything else we do, I can't be making mistakes, it must be done in a specific manner, a specific sequence, EVERY time. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 11:27:33 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 18:27:33 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John et al Don't forget LINQPad. Why LINQ beats SQL: http://www.linqpad.net/WhyLINQBeatsSQL.aspx /gustav >>> Gustav at cactus.dk 02-12-2009 08:19 >>> Hi John As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. /gustav >>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 2 12:34:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 13:34:54 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> Message-ID: <4B16B34E.8050702@colbyconsulting.com> Shamil, I receive lists of names in CSV or fixed width files. I import those into SQL Server, creating a PKID in the process. I then have to export the PKID plus the name / address monthly for address validation. Once validated, I have to import the data back in. This is the monthly process. Approximately 1% of all the people on any given list move each month. So I have to go back in to the original list and update 1% of the addresses, or simply swap out the new list (table) for the old. There is never any manual processing of individual names inside of these lists, IOW people never look at them, modify them, add new ones, delete address or anything like that. The list is "stable" in that regard. These lists become the source for orders of names. Orders are a whole 'nother process, but also use SPs to do their thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your reply. > > Do you use your different databases for data input, or you also have to > update those different databases' tables? > > -- > Shamil From jwcolby at colbyconsulting.com Wed Dec 2 12:46:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 13:46:09 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B16B5F1.4040003@colbyconsulting.com> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav > > >>>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> > As previously mentioned, over the last couple of years I have built up a set of stored procedures > which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is > always dynamic. > > As an example a stored procedure might build a table, with boilerplate field names and data types, > but a passed in database and table name. Inside of the stored procedure I build up the correct SQL > to create the table in the database specified, with the name specified. Another stored procedure > might create in index, with boilerplate field names, but a passed in database and table name. Again > the stored procedure builds up the TSQL statement to create the index in the correct db and table. > > I already have these stored procedures debugged and working and have been using them in sets to > perform "big picture processes" for quite some time, but the whole "execute a stored procedure" > using a command object, parameter objects in a parameter array, interpreting the parameters etc just > seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s > sci-fi movie as a tape reel spins madly in the background. > > Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL > directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL > statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the > "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically > constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I > can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? > > As it stands I am happily flipping switches, tape reels whirring, exporting data for address > validation. This is good, I am happy, but ... > From shamil at smsconsulting.spb.ru Wed Dec 2 13:19:29 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 22:19:29 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B16B34E.8050702@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> Message-ID: <00d501ca7384$600b48b0$2021da10$@spb.ru> John -- Have you tried to use MS SQL database filegroups and partitioned tables & views? http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx With them I suppose only initial import/insert of data have to be parameterized with table name, and the rest can be done without any dynamic T-SQL. Please correct me if I'm wrong. Please note I'm not trying to "force" you to change your current working solution - just wondering is there a legal way to solve your task without dynamic T-SQL... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 9:35 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, I receive lists of names in CSV or fixed width files. I import those into SQL Server, creating a PKID in the process. I then have to export the PKID plus the name / address monthly for address validation. Once validated, I have to import the data back in. This is the monthly process. Approximately 1% of all the people on any given list move each month. So I have to go back in to the original list and update 1% of the addresses, or simply swap out the new list (table) for the old. There is never any manual processing of individual names inside of these lists, IOW people never look at them, modify them, add new ones, delete address or anything like that. The list is "stable" in that regard. These lists become the source for orders of names. Orders are a whole 'nother process, but also use SPs to do their thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your reply. > > Do you use your different databases for data input, or you also have to > update those different databases' tables? > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 2 13:32:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 14:32:10 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <00d501ca7384$600b48b0$2021da10$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> <00d501ca7384$600b48b0$2021da10$@spb.ru> Message-ID: <4B16C0BA.7010601@colbyconsulting.com> Shamil, I have not. All of that is rather esoteric stuff for a non DBA. My job is processing data, and that is only a small part of my job, i.e. this is only one of many clients, and the only one that needs this kind of SQL Server stuff. As I have said many times, if my job was to go into a company every day and play DBA then I would learn many more things SQL Server related. As things stand I learn just enough to make things work, and a LITTLE extra in search of efficiency. It is certainly not that I don't want to, I just don't have the time. In the end I find the method I use comfortable from many angles. I have to do some things that require creating views, other "processing" tables and so forth. It really just works (for me) to do things this way, have separate databases to hold all of the "junk" associated with each list. Kind of the old "encapsulation" thing. Your suggestion would of course end up with all tables inside of a single "database", and as such the need for the Database parameter would go away but I still have to do the same thing to many different tables. Again, could this be done by one of the experts on the SQL Server list. Probably! Will I ever get there? Uhhhh doubtful. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > John -- > > Have you tried to use MS SQL database filegroups and partitioned tables & > views? > > http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx > > With them I suppose only initial import/insert of data have to be > parameterized with table name, and the rest can be done without any dynamic > T-SQL. Please correct me if I'm wrong. > > Please note I'm not trying to "force" you to change your current working > solution - just wondering is there a legal way to solve your task without > dynamic T-SQL... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 02, 2009 9:35 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# - Direct data manipulation > > Shamil, > From dbdoug at gmail.com Wed Dec 2 19:27:15 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 2 Dec 2009 17:27:15 -0800 Subject: [dba-VB] NorthwindNet time summary Message-ID: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> I believe that some time after the NorthwindNet project was finished, someone (Shamil?) posted an email with a summary of the time taken/number of forms/number of reports, etc. But I can't find it in my archives. I'm having a (friendly so far) discussion with a client who has given me an extremely ambitious schedule for converting a big Access project to C# ASP.NET, and I'd like some ammunition for my side of the argument! Thanks, Doug Steele From dwaters at usinternet.com Wed Dec 2 19:34:28 2009 From: dwaters at usinternet.com (Dan Waters) Date: Wed, 2 Dec 2009 19:34:28 -0600 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> Message-ID: Hi Doug, I used this site as well in making a quote to convert an Access System to a VB System. http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 Good Luck! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, December 02, 2009 7:27 PM To: dba-vb Subject: [dba-VB] NorthwindNet time summary I believe that some time after the NorthwindNet project was finished, someone (Shamil?) posted an email with a summary of the time taken/number of forms/number of reports, etc. But I can't find it in my archives. I'm having a (friendly so far) discussion with a client who has given me an extremely ambitious schedule for converting a big Access project to C# ASP.NET, and I'd like some ammunition for my side of the argument! Thanks, Doug Steele _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dbdoug at gmail.com Wed Dec 2 20:57:03 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 2 Dec 2009 18:57:03 -0800 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> Message-ID: <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> Perfect! Thanks, Dan. Doug On Wed, Dec 2, 2009 at 5:34 PM, Dan Waters wrote: > Hi Doug, > > I used this site as well in making a quote to convert an Access System to a > VB System. > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > Good Luck! > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, December 02, 2009 7:27 PM > To: dba-vb > Subject: [dba-VB] NorthwindNet time summary > > I believe that some time after the NorthwindNet project was finished, > someone (Shamil?) posted an email with a summary of the time taken/number > of > forms/number of reports, etc. But I can't find it in my archives. > > I'm having a (friendly so far) discussion with a client who has given me an > extremely ambitious schedule for converting a big Access project to C# > ASP.NET, and I'd like some ammunition for my side of the argument! > > Thanks, > > Doug Steele > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Thu Dec 3 05:29:49 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 14:29:49 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B16C0BA.7010601@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> <00d501ca7384$600b48b0$2021da10$@spb.ru> <4B16C0BA.7010601@colbyconsulting.com> Message-ID: <00f601ca740b$ee013800$ca03a800$@spb.ru> Hi John -- OK. Don't break it with implementation of other approaches if it works... Just for the future projects - I suppose (I might be missing something as I do not have that experience but I plan to try, maybe within our Northwind.NET project) this partitioning stuff is just practical for the tasks as you do (similar stuff was available for non-relational DBMSs in the end of 70-es/beginning of 80ies, and for Oracle it's available for years now AFAIHH), and this stuff doesn't take that much time to learn (one day?) and use (a few short reusable T-SQL scripts?) that it would take to program and to test and to support dynamic T-SQ: for many SPs and UDFs... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 10:32 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, I have not. All of that is rather esoteric stuff for a non DBA. My job is processing data, and that is only a small part of my job, i.e. this is only one of many clients, and the only one that needs this kind of SQL Server stuff. As I have said many times, if my job was to go into a company every day and play DBA then I would learn many more things SQL Server related. As things stand I learn just enough to make things work, and a LITTLE extra in search of efficiency. It is certainly not that I don't want to, I just don't have the time. In the end I find the method I use comfortable from many angles. I have to do some things that require creating views, other "processing" tables and so forth. It really just works (for me) to do things this way, have separate databases to hold all of the "junk" associated with each list. Kind of the old "encapsulation" thing. Your suggestion would of course end up with all tables inside of a single "database", and as such the need for the Database parameter would go away but I still have to do the same thing to many different tables. Again, could this be done by one of the experts on the SQL Server list. Probably! Will I ever get there? Uhhhh doubtful. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4656 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Thu Dec 3 05:29:49 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 14:29:49 +0300 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> Message-ID: <00f701ca740b$ef56b5e0$ce0421a0$@spb.ru> Hi Dan and Doug, If that stats will help you to quote and to plan your projects, please write a short note to be posted there (myself or Gustav can post it) http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 This project is currently in suspended state, and good feedback might help to plan and to implement some useful follow-ups. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Thursday, December 03, 2009 5:57 AM To: dwaters; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] NorthwindNet time summary Perfect! Thanks, Dan. Doug On Wed, Dec 2, 2009 at 5:34 PM, Dan Waters wrote: > Hi Doug, > > I used this site as well in making a quote to convert an Access System to a > VB System. > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > Good Luck! > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, December 02, 2009 7:27 PM > To: dba-vb > Subject: [dba-VB] NorthwindNet time summary > > I believe that some time after the NorthwindNet project was finished, > someone (Shamil?) posted an email with a summary of the time taken/number > of > forms/number of reports, etc. But I can't find it in my archives. > > I'm having a (friendly so far) discussion with a client who has given me an > extremely ambitious schedule for converting a big Access project to C# > ASP.NET, and I'd like some ammunition for my side of the argument! > > Thanks, > > Doug Steele __________ Information from ESET NOD32 Antivirus, version of virus signature database 4656 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Thu Dec 3 06:08:57 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 15:08:57 +0300 Subject: [dba-VB] C# 4.0: ExpandoObject, dynamic ... Message-ID: <00fa01ca7411$65b61be0$312253a0$@spb.ru> Hi All, Here is information on C# 4.0: ExpandoObject, dynamic etc. - you can see here why all that stuff is more powerful and useful than VB6/VBA late binding... http://blogs.msdn.com/csharpfaq/archive/2009/10/01/dynamic-in-c-4-0-introduc ing-the-expandoobject.aspx http://blogs.msdn.com/csharpfaq/archive/2009/10/19/dynamic-in-c-4-0-creating -wrappers-with-dynamicobject.aspx Thank you. -- Shamil From marklbreen at gmail.com Thu Dec 3 08:34:16 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 3 Dec 2009 14:34:16 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Message-ID: Hello Shamil, In VS2008, when I create a folder in app_Code, and then create a new Linq to SQL Class is it assigned the extention of dbml, default name is DataClasses.dbml It is these classes that are sooo slooow to do anything with. I timed the time it takes to just click create, drop a table onto the design surface, and then click save. It is taking 4 minutes to do that, so when I needed 20 - 25 objects or so, I have to sit like a donkey and click for almost two hours. It still takes four minutes to open and edit one. A PITA for sure. If I open the class as a standalone file, I can operate with instant performance, but it does not play well with the project/ solution. I have to say, I wish I knew more about these data classes and how they really should be used in real world applications. Thanks Mark 2009/12/2 Shamil Salakhetdinov > Hi Mark, > > <<< > *Slow Data Contexts* > >>> > What do you mean by that? - editing and saving your DNN Data Context > Objects > source code in \AppCode subfolder? > What do you mean by "Dbml"? > > <<< > but have created about 20 module so far > like this. > >>> > OK, I have also made 30+ DNN5.x custom modules properly packed etc. - all > very similar to each other but to get the first one was a time-consuming > issue. "Tired" from that. Need a break. Then I maybe will make some more... > > Thank you. > > -- > Shamil > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Wednesday, December 02, 2009 4:39 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello Shamil, > > Thank you for your detailed response. > > *Browsers* > Some comments, I am actually using Chrome to View my work, but I am not > doing any debugging, in the traditional sense, I code a few lines, click > save and then view the results in Chrome, when I am not happy, I flick back > to VS, change it and continue again. So, it is true to say, I am not > really > debugging, just viewing. However, I stopped using IE a few years ago, and > since I switched to Chrome, it is the first thing I install on new > machines. > With the exception of the MSDN site, it works perfect for me. > > > *Slow Data Contexts* > So can I assume that this slowness is simply to be accepted, it is either > a) > the way VS2008 usually performs, or b) the way VS2008 performs when data > contexts are involved in a large project such as DNN. I did not notice any > difference when I copied the code from the wwwroot folder, so I hope that > is > not part of the problem. > > *DNN Development* > Probably I am not doing real DNN custom programming, but I am currently > building web user controls, and simply saving them, and then creating a > module for DNN and including the web user control on that module. I know > this is not real DNN programming, but have created about 20 module so far > like this. DNN gives me, as a script kiddie type programmer, they ability > to do a simple web app, but it manages the users and authentication, > something that I could never program. > > IOW, with the exception of a few DNN hooks, I am doing simple programming, > but throwing the results into DNN. > > > *Free Lunch* > I have to say I agree with you, there are limitations everywhere. My > appoach is always to keep it as simple as possible until I absolutely know > that I need to make it more complex. > > > > Thanks, > > Mark > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Thu Dec 3 09:08:28 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 18:08:28 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Message-ID: <012201ca742a$79c0d710$6d428530$@spb.ru> Hello Mark -- OK, I suppose you can create custom DLL(s) working with LINQ to SQL in a solution outside of your custom DNN solution, and then just use your custom DLL within custom DNN solution - your LINQ to SQL objects from DLL should be public and this DLL should also have its own config file... I have done something like that but with POCO-objects (http://en.wikipedia.org/wiki/Plain_Old_CLR_Object), which I used as ObjectDataSources for web forms within DNN custom solutions' custom modules... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Thursday, December 03, 2009 5:34 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow Hello Shamil, In VS2008, when I create a folder in app_Code, and then create a new Linq to SQL Class is it assigned the extention of dbml, default name is DataClasses.dbml It is these classes that are sooo slooow to do anything with. I timed the time it takes to just click create, drop a table onto the design surface, and then click save. It is taking 4 minutes to do that, so when I needed 20 - 25 objects or so, I have to sit like a donkey and click for almost two hours. It still takes four minutes to open and edit one. A PITA for sure. If I open the class as a standalone file, I can operate with instant performance, but it does not play well with the project/ solution. I have to say, I wish I knew more about these data classes and how they really should be used in real world applications. Thanks Mark <<< snip>>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4658 (20091203) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From marklbreen at gmail.com Thu Dec 3 16:01:58 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 3 Dec 2009 22:01:58 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <012201ca742a$79c0d710$6d428530$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> <012201ca742a$79c0d710$6d428530$@spb.ru> Message-ID: Hello Shamil, I guess this is an option for me, but to be honest, it will probably more easier for me to take the delay of waiting that attempt to manage the additional layer of complexity. As with all things in life, I suppose if I take the time to review this, it will save me time, but I am afraid to spend a day on it only to save myself a few minutes a few times a day. Thanks any way for the suggestion, Mark 2009/12/3 Shamil Salakhetdinov > Hello Mark -- > > OK, I suppose you can create custom DLL(s) working with LINQ to SQL in a > solution outside of your custom DNN solution, and then just use your custom > DLL within custom DNN solution - your LINQ to SQL objects from DLL should > be > public and this DLL should also have its own config file... > > I have done something like that but with POCO-objects > (http://en.wikipedia.org/wiki/Plain_Old_CLR_Object), which I used as > ObjectDataSources for web forms within DNN custom solutions' custom > modules... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, December 03, 2009 5:34 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello Shamil, > > In VS2008, when I create a folder in app_Code, and then create a new Linq > to > SQL Class is it assigned the extention of dbml, default name is > DataClasses.dbml > > It is these classes that are sooo slooow to do anything with. I timed the > time it takes to just click create, drop a table onto the design surface, > and then click save. It is taking 4 minutes to do that, so when I needed > 20 > - 25 objects or so, I have to sit like a donkey and click for almost two > hours. > > It still takes four minutes to open and edit one. > > A PITA for sure. > > If I open the class as a standalone file, I can operate with > instant performance, but it does not play well with the project/ solution. > > I have to say, I wish I knew more about these data classes and how they > really should be used in real world applications. > > Thanks > > Mark > > > <<< snip>>> > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4658 (20091203) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Dec 3 17:38:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 03 Dec 2009 18:38:39 -0500 Subject: [dba-VB] Application settings Message-ID: <4B184BFF.6040203@colbyconsulting.com> I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Thu Dec 3 18:07:23 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 4 Dec 2009 11:07:23 +1100 Subject: [dba-VB] Application settings References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> Hi John, Is this what your after? global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting = "New Value"; global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); cheers Michael M I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From cfoust at infostatsystems.com Thu Dec 3 18:26:56 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 3 Dec 2009 18:26:56 -0600 Subject: [dba-VB] Application settings In-Reply-To: <4B184BFF.6040203@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: - - 0 Microsoft.Jet.OLEDB.4.0 C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb RIMUser false - 1 sqloledb infoserver RIMDrillDataSQL true We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. Shared ds As DataSet Shared _connectionString As String Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath Private Shared Sub ReadSettingsFile() If IO.File.Exists(_xmlPath) Then Call CreateSchema() ds.ReadXml(_xmlPath) Call DecryptPassword() _connectionString = GetConnectionString() Else If ds.Tables(0).Rows.Count = 0 Then 'placeholder for jet settings Dim row As DataRow = ds.Tables(0).NewRow row("dbtype") = 0 row("provider") = "Microsoft.Jet.OLEDB.4.0" ds.Tables(0).Rows.Add(row) 'placeholder for sql settings row = ds.Tables(0).NewRow row("dbtype") = 1 row("provider") = "sqloledb" ds.Tables(0).Rows.Add(row) End If End If End Sub Private Shared Sub CreateSchema() ds = New DataSet Dim table As New DataTable("connection") table.Columns.Add("dbtype", GetType(Integer)) table.Columns.Add("provider", GetType(String)) table.Columns.Add("datasource", GetType(String)) table.Columns.Add("userid", GetType(String)) table.Columns.Add("password", GetType(String)) table.Columns.Add("initialcatalog", GetType(String)) table.Columns.Add("trusted", GetType(Boolean)) table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} ds.Tables.Add(table) End Sub Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 03, 2009 3:39 PM To: VBA Subject: [dba-VB] Application settings I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Thu Dec 3 18:43:32 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 4 Dec 2009 11:43:32 +1100 Subject: [dba-VB] Application settings References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827EA@ddi-01.DDI.local> Hi Charlotte, I see this as useful, but, If you need a complex setting structure why not just create a 'MySettings' class and serialise or deserialise it as needed? I think John has already worked with the Serializable attribute. Am I missing something? Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, 4 December 2009 11:27 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: - - 0 Microsoft.Jet.OLEDB.4.0 C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb RIMUser false - 1 sqloledb infoserver RIMDrillDataSQL true We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. Shared ds As DataSet Shared _connectionString As String Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath Private Shared Sub ReadSettingsFile() If IO.File.Exists(_xmlPath) Then Call CreateSchema() ds.ReadXml(_xmlPath) Call DecryptPassword() _connectionString = GetConnectionString() Else If ds.Tables(0).Rows.Count = 0 Then 'placeholder for jet settings Dim row As DataRow = ds.Tables(0).NewRow row("dbtype") = 0 row("provider") = "Microsoft.Jet.OLEDB.4.0" ds.Tables(0).Rows.Add(row) 'placeholder for sql settings row = ds.Tables(0).NewRow row("dbtype") = 1 row("provider") = "sqloledb" ds.Tables(0).Rows.Add(row) End If End If End Sub Private Shared Sub CreateSchema() ds = New DataSet Dim table As New DataTable("connection") table.Columns.Add("dbtype", GetType(Integer)) table.Columns.Add("provider", GetType(String)) table.Columns.Add("datasource", GetType(String)) table.Columns.Add("userid", GetType(String)) table.Columns.Add("password", GetType(String)) table.Columns.Add("initialcatalog", GetType(String)) table.Columns.Add("trusted", GetType(Boolean)) table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} ds.Tables.Add(table) End Sub Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 03, 2009 3:39 PM To: VBA Subject: [dba-VB] Application settings I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From Gustav at cactus.dk Fri Dec 4 02:48:35 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 09:48:35 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John Yes and no. I used an old version for some time but the current version is more powerful. Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. /gustav >>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav From Gustav at cactus.dk Fri Dec 4 04:08:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 11:08:03 +0100 Subject: [dba-VB] LINQ example (was: C# - Direct data manipulation) Message-ID: Hi John et all Further to the notes below on Joseph Albahari's LINQPad, it contains a link to download all the example code from "LINQ in Action". Also, it has a link to this amazing demo of the power of LINQ: http://blogs.msdn.com/lukeh/archive/2007/03/19/using-linq-to-solve-puzzles.aspx It's a true eye-opener and a good example showing that the scope of LINQ is much wider than "normal" database querying. The code is included in LINQPad when downloaded, ready for you to play with at: Tab Samples, C# 3.0 in a Nutshell, Chapter 9 - LINQ Operators, Joining, Extra - Weights Puzzle. It's Friday and soon weekend! /gustav >>> Gustav at cactus.dk 04-12-2009 09:48 >>> Hi John Yes and no. I used an old version for some time but the current version is more powerful. Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. /gustav >>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 05:53:41 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 06:53:41 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B18F845.1090500@colbyconsulting.com> I really meant do you use linq in your C# apps? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes and no. I used an old version for some time but the current version is more powerful. > > Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. > > /gustav > >>>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> > Do you use it? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John et al >> >> Don't forget LINQPad. >> >> Why LINQ beats SQL: >> http://www.linqpad.net/WhyLINQBeatsSQL.aspx >> >> /gustav >> >> >>>>> Gustav at cactus.dk 02-12-2009 08:19 >>> >> Hi John >> >> As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. >> >> ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. >> >> /gustav > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From paul.hartland at googlemail.com Fri Dec 4 05:59:23 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 4 Dec 2009 11:59:23 +0000 Subject: [dba-VB] Test Message-ID: <38c884770912040359r58db94e3w44b86c077590457d@mail.gmail.com> Please delete as test email, sent question about XML problem about two days ago, and haven't seen it appear. -- Paul Hartland paul.hartland at googlemail.com From paul.hartland at googlemail.com Fri Dec 4 06:19:01 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 4 Dec 2009 12:19:01 +0000 Subject: [dba-VB] Read XML File Using xsd Schema File Message-ID: <38c884770912040419xdc61c66y2c315b820cd6fb09@mail.gmail.com> To all, We have been a given what looks to me like a fairly complex XML file, we have also been given a xsd schema file. I tried using the SQLXMLBulkLoad object in VB6 and was getting the error Schema: relationship expected on 'Company'. The company that gave us both the files insist that the xsd is correct (according to my project manager). I downloaded and installed Stylus Studio 2010, with which I loaded the XML, and then generated my own xsd schame file. Tried again and this time get the same error as above, but instead of 'Company' the error was 'Groups' The VB6 code I am using is as follows: Dim objBL Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1" objBL.KeepIdentity = True objBL.errorlogfile = "C:\XML_StylusStudio\Error.log" objBL.checkconstraints = True objBL.xmlfragment = True objBL.schemagen = True objBL.sgdroptables = True objBL.Execute "C:\XML_StylusStudio\newschema.xsd", "C:\XML_StylusStudio\CDFull_Original.xml" Set objBl=Nothing The object of the exercise being that we generate related tables in SQL Server 2005 of the XML data. Would be grateful if anyone could help with this (would be happy to send example XML file and the schema offline), as I haven't got much hair left to pull out. Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From Gustav at cactus.dk Fri Dec 4 06:33:36 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 13:33:36 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John Oh, I misunderstood you. Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 12:53 >>> I really meant do you use linq in your C# apps? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes and no. I used an old version for some time but the current version is more powerful. > > Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. > > /gustav > >>>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> > Do you use it? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John et al >> >> Don't forget LINQPad. >> >> Why LINQ beats SQL: >> http://www.linqpad.net/WhyLINQBeatsSQL.aspx >> >> /gustav >> >> >>>>> Gustav at cactus.dk 02-12-2009 08:19 >>> >> Hi John >> >> As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. >> >> ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. >> >> /gustav From jwcolby at colbyconsulting.com Fri Dec 4 07:54:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 08:54:21 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B19148D.9070607@colbyconsulting.com> >I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) I have to say that as a developer of a higher level language, I can see where avoiding TSQL would be something we would try to do. While I understand that SQL Server can be integrated into and used straight from the VS environment, most of us come at it from the built-in editor which frankly sucks. And I mean REALLY BADLY sucks, no apologies to our admin friends. I guess I have been doing SP development for a couple of years now and I still hate the built-in editor. And yet... that is what I use. IMHO this is an area where MS has fallen down on the job. If this integration thing is so darned simple, then MS should push education, seminars, books, education, education to get us working in VS to run (program) SQL Server. From a development perspective, and that is what SPs and UDF are after all, SQL Server should just be a tool used to manipulate data, NOT a dev environment. Over the last month I have found two APIs that allow C# to do a ton of stuff directly in SQL Server. WAY COOL stuff, but you would think it was porn the way you don't see it in the mainstream. These APIs allow you to manipulate SQL server the same way you can manipulate any other object - create, delete, observe, modify, manipulate anything in SQL Server - straight from VS. But where are the forums, the blogs, the developer excitement? It appears to me that there is a very real "here is your database" aimed at the developers who use SQL Server, and the admins just do things the way they always have for the last 20 years. And they buy tools from the RedGates of the world who undoubtedly do salivate over these new APIs. Just my humble opinion. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I misunderstood you. > Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 07:56:15 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 08:56:15 -0500 Subject: [dba-VB] Application settings In-Reply-To: References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <4B1914FF.1050705@colbyconsulting.com> Charlotte, My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: > > > - > - > 0 > Microsoft.Jet.OLEDB.4.0 > C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb > RIMUser > > > false > > - > 1 > sqloledb > infoserver > > > RIMDrillDataSQL > true > > > > We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. > > Shared ds As DataSet > Shared _connectionString As String > > Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath > > Private Shared Sub ReadSettingsFile() > If IO.File.Exists(_xmlPath) Then > Call CreateSchema() > ds.ReadXml(_xmlPath) > Call DecryptPassword() > _connectionString = GetConnectionString() > Else > If ds.Tables(0).Rows.Count = 0 Then > 'placeholder for jet settings > Dim row As DataRow = ds.Tables(0).NewRow > row("dbtype") = 0 > row("provider") = "Microsoft.Jet.OLEDB.4.0" > ds.Tables(0).Rows.Add(row) > > 'placeholder for sql settings > row = ds.Tables(0).NewRow > row("dbtype") = 1 > row("provider") = "sqloledb" > ds.Tables(0).Rows.Add(row) > End If > End If > End Sub > > Private Shared Sub CreateSchema() > ds = New DataSet > Dim table As New DataTable("connection") > table.Columns.Add("dbtype", GetType(Integer)) > table.Columns.Add("provider", GetType(String)) > table.Columns.Add("datasource", GetType(String)) > table.Columns.Add("userid", GetType(String)) > table.Columns.Add("password", GetType(String)) > table.Columns.Add("initialcatalog", GetType(String)) > table.Columns.Add("trusted", GetType(Boolean)) > table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} > > ds.Tables.Add(table) > End Sub > > Charlotte > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 03, 2009 3:39 PM > To: VBA > Subject: [dba-VB] Application settings > > I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Dec 4 08:17:12 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 15:17:12 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 14:54 >>> >I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) I have to say that as a developer of a higher level language, I can see where avoiding TSQL would be something we would try to do. While I understand that SQL Server can be integrated into and used straight from the VS environment, most of us come at it from the built-in editor which frankly sucks. And I mean REALLY BADLY sucks, no apologies to our admin friends. I guess I have been doing SP development for a couple of years now and I still hate the built-in editor. And yet... that is what I use. IMHO this is an area where MS has fallen down on the job. If this integration thing is so darned simple, then MS should push education, seminars, books, education, education to get us working in VS to run (program) SQL Server. From a development perspective, and that is what SPs and UDF are after all, SQL Server should just be a tool used to manipulate data, NOT a dev environment. Over the last month I have found two APIs that allow C# to do a ton of stuff directly in SQL Server. WAY COOL stuff, but you would think it was porn the way you don't see it in the mainstream. These APIs allow you to manipulate SQL server the same way you can manipulate any other object - create, delete, observe, modify, manipulate anything in SQL Server - straight from VS. But where are the forums, the blogs, the developer excitement? It appears to me that there is a very real "here is your database" aimed at the developers who use SQL Server, and the admins just do things the way they always have for the last 20 years. And they buy tools from the RedGates of the world who undoubtedly do salivate over these new APIs. Just my humble opinion. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I misunderstood you. > Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 08:43:46 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 09:43:46 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B192022.5080005@colbyconsulting.com> >they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. I actually think that is a good thing, developers who just use data shouldn't need to be learning SQL Server to get their data. That is really not the audience I am addressing however. IMHO the built-in editor of SQL Server should either be removed entirely or at least brought into the current century. It is notepad with pretty colors. How many millions of man hours have been wasted trying to track down errors when the only error message presented was "error near (insert some unrelated thing here)". Why bother even throwing up an error like that, and that is 99.9% of the errors I have EVER seen in two years working with SQL Server. Notepad, with pretty colors. For all of the rude comments us Access developers get about Access being "a toy", the code editor in Access is in a complete other galaxy from the code editor in SQL Server. SQL Server editor looks like it was designed in 1986 and never upgraded. Of course with the "real men don't use code editors" mentality of the DBA side of the fence I can see why MS doesn't bother spending time on this. Someday I really am going to have to figure out how to use VS to run / debug my SPs and stuff. To me VS just seems over-the-top complex for the level of stuff I am trying to do. An Access type of code editor would be just the right level of convenience and capability - built right into SSMS. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. > > /gustav From Gustav at cactus.dk Fri Dec 4 09:32:07 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 16:32:07 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John LINQPad does pure SQL too, though not with IntelliSense, and error messages seem to be those from SQL Server. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 15:43 >>> >they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. I actually think that is a good thing, developers who just use data shouldn't need to be learning SQL Server to get their data. That is really not the audience I am addressing however. IMHO the built-in editor of SQL Server should either be removed entirely or at least brought into the current century. It is notepad with pretty colors. How many millions of man hours have been wasted trying to track down errors when the only error message presented was "error near (insert some unrelated thing here)". Why bother even throwing up an error like that, and that is 99.9% of the errors I have EVER seen in two years working with SQL Server. Notepad, with pretty colors. For all of the rude comments us Access developers get about Access being "a toy", the code editor in Access is in a complete other galaxy from the code editor in SQL Server. SQL Server editor looks like it was designed in 1986 and never upgraded. Of course with the "real men don't use code editors" mentality of the DBA side of the fence I can see why MS doesn't bother spending time on this. Someday I really am going to have to figure out how to use VS to run / debug my SPs and stuff. To me VS just seems over-the-top complex for the level of stuff I am trying to do. An Access type of code editor would be just the right level of convenience and capability - built right into SSMS. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. > > /gustav From cfoust at infostatsystems.com Fri Dec 4 10:10:23 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 4 Dec 2009 10:10:23 -0600 Subject: [dba-VB] Application settings In-Reply-To: <4B1914FF.1050705@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> Message-ID: OK, then I don't understand the question. What do you mean about the settings "area" of the project? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 04, 2009 5:56 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Charlotte, My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: > > > - > - > 0 > Microsoft.Jet.OLEDB.4.0 > C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb > RIMUser > > > false > > - > 1 > sqloledb > infoserver > > > RIMDrillDataSQL > true > > > > We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. > > Shared ds As DataSet > Shared _connectionString As String > > Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath > > Private Shared Sub ReadSettingsFile() > If IO.File.Exists(_xmlPath) Then > Call CreateSchema() > ds.ReadXml(_xmlPath) > Call DecryptPassword() > _connectionString = GetConnectionString() > Else > If ds.Tables(0).Rows.Count = 0 Then > 'placeholder for jet settings > Dim row As DataRow = ds.Tables(0).NewRow > row("dbtype") = 0 > row("provider") = "Microsoft.Jet.OLEDB.4.0" > ds.Tables(0).Rows.Add(row) > > 'placeholder for sql settings > row = ds.Tables(0).NewRow > row("dbtype") = 1 > row("provider") = "sqloledb" > ds.Tables(0).Rows.Add(row) > End If > End If > End Sub > > Private Shared Sub CreateSchema() > ds = New DataSet > Dim table As New DataTable("connection") > table.Columns.Add("dbtype", GetType(Integer)) > table.Columns.Add("provider", GetType(String)) > table.Columns.Add("datasource", GetType(String)) > table.Columns.Add("userid", GetType(String)) > table.Columns.Add("password", GetType(String)) > table.Columns.Add("initialcatalog", GetType(String)) > table.Columns.Add("trusted", GetType(Boolean)) > table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} > > ds.Tables.Add(table) > End Sub > > Charlotte > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 03, 2009 3:39 PM > To: VBA > Subject: [dba-VB] Application settings > > I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ From jwcolby at colbyconsulting.com Fri Dec 4 10:33:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 11:33:52 -0500 Subject: [dba-VB] Application settings In-Reply-To: References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> Message-ID: <4B1939F0.7020905@colbyconsulting.com> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > OK, then I don't understand the question. What do you mean about the settings "area" of the project? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 04, 2009 5:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Application settings > > Charlotte, > > My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. > > John W. Colby > www.ColbyConsulting.com > From shamil at smsconsulting.spb.ru Fri Dec 4 10:46:41 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 4 Dec 2009 19:46:41 +0300 Subject: [dba-VB] Application settings In-Reply-To: <4B1939F0.7020905@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> <4B1939F0.7020905@colbyconsulting.com> Message-ID: <01b001ca7501$5c9e3650$15daa2f0$@spb.ru> Hi John, You can access those properties using: Properties.Settings.Default.{{PropertyName}} Or {{Root Namespace}}.Properties.Settings.Default.{{PropertyName}} -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 04, 2009 7:34 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 11:24:46 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 18:24:46 +0100 Subject: [dba-VB] Application settings Message-ID: Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6-66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > OK, then I don't understand the question. What do you mean about the settings "area" of the project? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 04, 2009 5:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Application settings > > Charlotte, > > My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. > > John W. Colby > www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 4 12:30:32 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 13:30:32 -0500 Subject: [dba-VB] Code Search Message-ID: <4B195548.4030300@colbyconsulting.com> Has anyone noticed this on Google? http://www.google.com/codesearch?hl=en Anyone using it? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 4 14:33:00 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 4 Dec 2009 23:33:00 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 15:39:43 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 22:39:43 +0100 Subject: [dba-VB] Application settings Message-ID: Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 21:33 >>> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 4 16:06:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 01:06:11 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01be01ca752d$ff4dfe40$fde9fac0$@spb.ru> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 21:33 >>> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 16:18:39 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 23:18:39 +0100 Subject: [dba-VB] Application settings Message-ID: Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 23:06 >>> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav From cfoust at infostatsystems.com Fri Dec 4 19:24:01 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 4 Dec 2009 19:24:01 -0600 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: That was my understanding as well, Gustav. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 2:19 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 23:06 >>> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Dec 5 07:03:33 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 16:03:33 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <01d001ca75ab$5adb7670$10926350$@spb.ru> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Sat Dec 5 07:03:33 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 16:03:33 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01d101ca75ab$5c18d870$144a8950$@spb.ru> Hi Gustav and all, JC original request was "to access/modify" application settings AFAIU: <<< I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. >>> -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 1:19 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Sat Dec 5 12:57:15 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sat, 05 Dec 2009 19:57:15 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Sat Dec 5 16:54:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 6 Dec 2009 01:54:50 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <01e001ca75fd$f4891280$dd9b3780$@spb.ru> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Sun Dec 6 09:04:00 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 06 Dec 2009 16:04:00 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From michael at ddisolutions.com.au Sun Dec 6 16:00:52 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 7 Dec 2009 09:00:52 +1100 Subject: [dba-VB] Code Search References: <4B195548.4030300@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827F2@ddi-01.DDI.local> Hi John, No and not yet! Cheers Michael M Has anyone noticed this on Google? http://www.google.com/codesearch?hl=en Anyone using it? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From michael at ddisolutions.com.au Sun Dec 6 16:03:36 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 7 Dec 2009 09:03:36 +1100 Subject: [dba-VB] Application settings - Test References: <4B184BFF.6040203@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Test reply, Am I getting through??? Or am I being ignored??? :-) Cheers Michael M Hi John, Is this what your after? global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting = "New Value"; global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); cheers Michael M I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 _______________________________________________ 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 - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From jwcolby at colbyconsulting.com Sun Dec 6 16:45:30 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 06 Dec 2009 17:45:30 -0500 Subject: [dba-VB] Application settings - Test In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> References: <4B184BFF.6040203@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Message-ID: <4B1C340A.7090004@colbyconsulting.com> LOL. We'd never ignore you! John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Test reply, > Am I getting through??? > Or am I being ignored??? :-) > > Cheers > > Michael M > > > Hi John, > > Is this what your after? > > > global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting > = "New Value"; > > global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); > > cheers > > Michael M > > I want to create application settings for things like the server > instance that the program will bang > on, the name of my database that I save my custom UDFs and SPs in etc. > It is trivial to get there > in the interface but Google is not my friend tonight in discovering how > to access / modify them > through code. > > Anybody? > From wdhindman at dejpolsystems.com Sun Dec 6 16:29:05 2009 From: wdhindman at dejpolsystems.com (William Hindman) Date: Sun, 6 Dec 2009 17:29:05 -0500 Subject: [dba-VB] Application settings - Test In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> References: <4B184BFF.6040203@colbyconsulting.com><59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Message-ID: <59B0F0614709418884DE2B4E1551B143@jislaptopdev> ...yes, but we're ignoring you ...its Sunday here, eh :) William -------------------------------------------------- From: "Michael Maddison" Sent: Sunday, December 06, 2009 5:03 PM To: "Discussion concerning Visual Basic and related programming issues." Subject: Re: [dba-VB] Application settings - Test > Test reply, > Am I getting through??? > Or am I being ignored??? :-) > > Cheers > > Michael M > > > Hi John, > > Is this what your after? > > > global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting > = "New Value"; > > global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); > > cheers > > Michael M > > I want to create application settings for things like the server > instance that the program will bang > on, the name of my database that I save my custom UDFs and SPs in etc. > It is trivial to get there > in the interface but Google is not my friend tonight in discovering how > to access / modify them > through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: > 12/04/09 06:36:00 > > _______________________________________________ > 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 - www.avg.com > Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: > 12/04/09 06:36:00 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Mon Dec 7 01:47:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 7 Dec 2009 10:47:50 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <021101ca7711$949ff220$bddfd660$@spb.ru> Hi Gustav -- Thank you. OK, March 22 - official release - so January 2010 MSDN might have it... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, December 06, 2009 6:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732- A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Mon Dec 7 01:53:42 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 07 Dec 2009 08:53:42 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil I cannot tell - and I don't have an MSDN subscription ... /gustav >>> shamil at smsconsulting.spb.ru 07-12-2009 08:47 >>> Hi Gustav -- Thank you. OK, March 22 - official release - so January 2010 MSDN might have it... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, December 06, 2009 6:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil From jwcolby at colbyconsulting.com Mon Dec 7 07:46:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 08:46:22 -0500 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <4B1D072E.6060008@colbyconsulting.com> I have to say... "Scott Guthrie" ... with a name like that he should have been a musician. John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 7 07:56:31 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 08:56:31 -0500 Subject: [dba-VB] Application settings In-Reply-To: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> References: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> Message-ID: <4B1D098F.30807@colbyconsulting.com> OK, I am trying to reference Properties.Settings.Default["ServerName"].ToString() and get the error 'System.Windows.Forms.PropertyStore' does not contain a definition for 'Settings' and no extension method 'Settings' accepting a first argument of type 'System.Windows.Forms.PropertyStore' could be found (are you missing a using directive or an assembly reference?) John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Gustav, > > You can set > > Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; > > and save settings having "User" scope: > > Properties.Settings.Default.Save(); > > And they are saved not in {{ApplicationExecutableFileName}}.config, which > you deliver with you app's executable but anywhere else on your system - > probably somewhere in user's Application Settings - standard windows folder. > I have never had time to find out where settings are saved. Anybody? > > Recap: > > - settings are loaded from {{ApplicationExecutableFileName}}.config when you > deliver you application, and it runs first time; > - as soon as you save "User" scope settings they are saved in and loaded > from {{UnknownPlace}}; > - if you move your application files into another folder on the same system > the settings are again loaded on first run from > {{ApplicationExecutableFileName}}; > - ... > > That looks confusing a bit but it's how it works... > > You can click "Learn more about application settings..." on top right of > VS2008 application settings window available by Solution Explorer -> Project > name -> Right-Click -> Settings... > > But if you wanted to have rather complicated structure of your application > settings file then better use your own custom XML files, which can be loaded > from/saved to files many ways without almost any coding... > > Thank you. > > -- > Shamil > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, December 04, 2009 8:25 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Application settings > > Hi John > > Shamil is right, but that method is for reading only. > Please note that the Properties' collection object is read-only, thus it > takes quite a few steps to add a property: > > http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- > 66be-44ce-8a65-ab548f6f4f04 > > I have not used this as I haven't had any need to add properties on the fly. > Reading and writing was fine for me, and new properties I added manually. > > You may find it much easier and perhaps more convenient to just have a > dataset which you read and write from/to an XML-file. I've posted code for > this before. > > /gustav > > >>>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> > Under the project is a properties object. Double click that and an entire > multi-tabbed dialog opens. > > Click the settings tab. There you will see a form where you can enter name, > type, scope, value. > > As far as I can tell this is a place where I (the developer) can create > settings that my program > will use and manipulate, settings (for example) to tell my program the name > of the SQL Server > instance to use in a connection string, the name of my control database > where I store my stored > procedures and UDFs. Stuff like that. Stuff that I am currently hard > coding, but which really > should be in a settings tab so that I don't have to remember where that > constant is in code, I can > just go to the settings tab to change. > > My expectation is that there is an object somewhere in the .net namespace > that allows you to do > something like "Something.Somethingelse.Settings["MyServerName"]...." to > access these things. > > I expect to be able to create new ones, edit existing ones, delete them etc > from a .Net object. I > am looking for that .Net syntax that allows me to do this from code. > > John W. Colby > www.ColbyConsulting.com > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4661 (20091204) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-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 Dec 7 08:03:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 09:03:10 -0500 Subject: [dba-VB] Application settings In-Reply-To: <01d101ca75ab$5c18d870$144a8950$@spb.ru> References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> Message-ID: <4B1D0B1E.1090109@colbyconsulting.com> OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Gustav and all, > > JC original request was "to access/modify" application settings AFAIU: > <<< > I want to create application settings for things like the server instance > that the program will bang on, the name of my database that I save my custom > UDFs and SPs in etc. It is trivial to get there in the interface but Google > is not my friend tonight in discovering how to access / modify them through > code. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Saturday, December 05, 2009 1:19 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Application settings > > Hi Shamil > > I guess I'm too busy today. I read it as JC wanted to create these on the > fly ... > > /gustav > > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4661 (20091204) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > 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 Dec 7 09:00:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 07 Dec 2009 16:00:02 +0100 Subject: [dba-VB] Application settings Message-ID: Hi John The file containing the settings is app.config. To hold "global" settings you could create a small project with just this file and reference it from any other project. /gustav >>> jwcolby at colbyconsulting.com 07-12-2009 15:03 >>> OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com From mmattys at rochester.rr.com Mon Dec 7 10:57:22 2009 From: mmattys at rochester.rr.com (Mike Mattys) Date: Mon, 7 Dec 2009 11:57:22 -0500 Subject: [dba-VB] Application settings References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> <4B1D0B1E.1090109@colbyconsulting.com> Message-ID: My understanding of Properties.Settings is that settings must be by User in order to be saved and the xml file will reside in the Local Setting/Applications directory under the user's My Documents folder. In that case, all projects under a solution could read a single xml file. We decided to use cryptographic services for the i/o of the xml by using an internal static class that reads/writes to a string collection using methods we created like bof, eof, movefirst, addnew, etc. - Michael R Mattys MapPoint and Database Dev www.mattysconsulting.com - ----- Original Message ----- From: "jwcolby" To: "Discussion concerning Visual Basic and related programming issues." Sent: Monday, December 07, 2009 9:03 AM Subject: Re: [dba-VB] Application settings > OK, it appears that each project has its own set of properties. If I set > the same property in the > current project's property set then > > Properties.Settings.Default["ServerName"].ToString() > > works just fine. > > But that is not the behavior I want. I need a SOLUTION property set, > which appears to not exist? > Which perhaps would explain why those who have done this before roll their > own? > > Does anyone have code to do this so I don't have to roll my own (a.k.a. > reinvent the wheel) too? > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: >> Hi Gustav and all, >> >> JC original request was "to access/modify" application settings AFAIU: >> <<< >> I want to create application settings for things like the server instance >> that the program will bang on, the name of my database that I save my >> custom >> UDFs and SPs in etc. It is trivial to get there in the interface but >> Google >> is not my friend tonight in discovering how to access / modify them >> through >> code. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Saturday, December 05, 2009 1:19 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] Application settings >> >> Hi Shamil >> >> I guess I'm too busy today. I read it as JC wanted to create these on the >> fly ... >> >> /gustav >> >> >> <<< snip >>> >> >> >> __________ Information from ESET NOD32 Antivirus, version of virus >> signature >> database 4661 (20091204) __________ >> >> The message was checked by ESET NOD32 Antivirus. >> >> http://www.esetnod32.ru >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From pharold at proftesting.com Mon Dec 7 11:18:37 2009 From: pharold at proftesting.com (Perry L Harold) Date: Mon, 7 Dec 2009 12:18:37 -0500 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: <4B1D072E.6060008@colbyconsulting.com> References: <4B1D072E.6060008@colbyconsulting.com> Message-ID: Maybe Arlo's brother? Perry -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 07, 2009 8:46 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Scott Guthrie in town I have to say... "Scott Guthrie" ... with a name like that he should have been a musician. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Dec 7 13:54:55 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 7 Dec 2009 22:54:55 +0300 Subject: [dba-VB] Application settings In-Reply-To: <4B1D0B1E.1090109@colbyconsulting.com> References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> <4B1D0B1E.1090109@colbyconsulting.com> Message-ID: <001b01ca7777$2741d5c0$75c58140$@spb.ru> Hi John -- For solution you can select one of the projects to be used to handle settings. That project is usually a core(utility/generic/settings) class library. Then if you wish you can additionally wrap Properties.Settings.Default... for every/most of the settings into your custom global (Solution scope) properties' wrappers. Such wrapping makes your referencing projects independent on actual implementation of handling of application settings. When that done and works OK you can go and "reinvent the wheel" if needed without any changes in referencing projects... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 07, 2009 5:03 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4668 (20091207) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Dec 8 01:55:00 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 8 Dec 2009 07:55:00 -0000 Subject: [dba-VB] OT: Thin SQL Client for Linux In-Reply-To: References: Message-ID: <4b1e0661.0f67f10a.205a.ffffd8ee@mx.google.com> OT: Thin SQL Client for Linux Can anybody find me a good THIN sql client for Linux I need to find one in the next day, I am stuck on an escalation and we really need this. So any help appreciated. Thanks Max From Gustav at cactus.dk Tue Dec 8 10:11:52 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 08 Dec 2009 17:11:52 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil et al He has posted links to the PP slides and demo code here: http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe-december-2009.aspx for: ASP.NET 4 and VS 2010 Web Development: Slides + Demos + Blog Posts ASP.NET MVC 2.0: Slides + Walkthrough Silverlight 4: Slides (warning: large download) /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Tue Dec 8 11:52:14 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 8 Dec 2009 20:52:14 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <006c01ca782f$2e61ae30$8b250a90$@spb.ru> Hi Gustav, Thank you for the links. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, December 08, 2009 7:12 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil et al He has posted links to the PP slides and demo code here: http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe -december-2009.aspx for: ASP.NET 4 and VS 2010 Web Development: Slides + Demos + Blog Posts ASP.NET MVC 2.0: Slides + Walkthrough Silverlight 4: Slides (warning: large download) /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4670 (20091208) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 9 08:04:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 09:04:21 -0500 Subject: [dba-VB] c# Browse folder dialog Message-ID: <4B1FAE65.2070700@colbyconsulting.com> When I set the BrowseFolder.SelectedPath property, it displays the directory tree with the selected directory NOT expanded. I would like to cause the selected directory to already be expanded. Does anyone know if this is possible? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Dec 9 08:43:38 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 09 Dec 2009 15:43:38 +0100 Subject: [dba-VB] c# Browse folder dialog Message-ID: Hi John I think not. This old project uses the Shell dialogue and has a SetExpanded method. Maybe you can get some ideas: http://www.codeproject.com/KB/selection/folderbrowser.aspx /gustav >>> jwcolby at colbyconsulting.com 09-12-2009 15:04:21 >>> When I set the BrowseFolder.SelectedPath property, it displays the directory tree with the selected directory NOT expanded. I would like to cause the selected directory to already be expanded. Does anyone know if this is possible? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 09:49:25 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 10:49:25 -0500 Subject: [dba-VB] C# - Thoughts on my methods Message-ID: <4B1FC705.9010902@colbyconsulting.com> As a consultant in a home office I work in total isolation except for this email group. So I need your input, to keep me sane and to keep me on the right path. I would like your thoughts on what I am doing and what I am intending to do. As you know, I have "the database from hell", for which I am developing an application to allow me to manipulate the various pieces from an application interface rather than directly from stored procedures and the SSMS or from Access, which is what I have done to this point. With C# I am able to do more than I was able from Access, including getting back output parameters from stored procedures. So... my process so far. First off, I am developing the overall application as a set of child projects inside of the application. The main application opens a form with a menu, and that menu takes me to forms in the child projects to perform pieces of the application. For example I have a database backup project where I can backup and restore specific databases or groups of databases. I have an Accuzip project where I can export CSV files to and import resulting CSV files from the external Accuzip program. I have an Orders project where I can create and manipulate the orders I create for the client. Each child project is physically located underneath the main application directory. In order to reference (open) the forms in the child projects, I have to set a reference to that project and I have to set a using statement in the form. I still do not understand what these two pieces do. Why do I have to set a reference and a using? I assume you cannot set a using statement unless the project references the library (or project)? I also don't understand why some objects in a referenced project class can be seen but others cannot. IOW I can use one class in a namespace as a type to dimension an object, but another class in the same namespace is not visible, cannot be so used. I don't understand a whole ton of things of this nature and I have to say that the whole "break into projects" idea is turning out to be more work than it might be worth. Any comments on this email will be much appreciated. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 11:42:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 12:42:12 -0500 Subject: [dba-VB] C# - zip / unzip Message-ID: <4B1FE174.90207@colbyconsulting.com> Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 13:14:16 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 14:14:16 -0500 Subject: [dba-VB] threading Message-ID: <4B1FF708.1040700@colbyconsulting.com> As mentioned in previous emails, I am developing an application to manage all of the tasks for the DBFH. This includes Backing up databases, creating orders, transferring data between an external app etc. I am trying to determine how to thread this app such that if I start a process exporting data to Accuzip, I could have another process importing data from Accuzip, and also be working on an order. As things currently stand, each of these tasks is a project and each project has its own forms and classes, and anything else necessary for that task. I really do want to be able to do multiple things like this at the same time. Exporting data to Accuzip can take overnight, and actually consists of an export and a matching import process. It makes perfect sense (to me) to have threads doing this kind of thing, and allow me to go back to the main application and do something else. But at what level would I use a thread? Would I use a thread to open the form that performs the AZ process? This would allow me to get that started and immediately go back to the main app and open another form (using a new thread?) to start processing an order. Or would the form open and the button on the form start a thread that executes the process? If a form starts a thread, that allows the user (me) to do other things in that form potentially changing to a new directory or selecting a different database. Do you disable all controls on a form when a thread starts? I never had to think about this in VBA and it is all rather confusing. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] threading In-Reply-To: <4B1FF708.1040700@colbyconsulting.com> References: <4B1FF708.1040700@colbyconsulting.com> Message-ID: <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> Hi John -- Why not have several (FE) applications if they are so independent? - all developed within one VS solution but as separate (WinForms) projects sharing the same (set of) class library(-ies)? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 10:14 PM To: VBA Subject: [dba-VB] threading As mentioned in previous emails, I am developing an application to manage all of the tasks for the DBFH. This includes Backing up databases, creating orders, transferring data between an external app etc. I am trying to determine how to thread this app such that if I start a process exporting data to Accuzip, I could have another process importing data from Accuzip, and also be working on an order. As things currently stand, each of these tasks is a project and each project has its own forms and classes, and anything else necessary for that task. I really do want to be able to do multiple things like this at the same time. Exporting data to Accuzip can take overnight, and actually consists of an export and a matching import process. It makes perfect sense (to me) to have threads doing this kind of thing, and allow me to go back to the main application and do something else. But at what level would I use a thread? Would I use a thread to open the form that performs the AZ process? This would allow me to get that started and immediately go back to the main app and open another form (using a new thread?) to start processing an order. Or would the form open and the button on the form start a thread that executes the process? If a form starts a thread, that allows the user (me) to do other things in that form potentially changing to a new directory or selecting a different database. Do you disable all controls on a form when a thread starts? I never had to think about this in VBA and it is all rather confusing. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B1FE174.90207@colbyconsulting.com> References: <4B1FE174.90207@colbyconsulting.com> Message-ID: <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> Hi John, Have a look for DotNetNuke sources - they have free sources for zipping/unzipping. Those sources are used in core DNN functionality (modules setup) - IOW they tested well, they are stable and thry work very well. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 8:42 PM To: VBA Subject: [dba-VB] C# - zip / unzip Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: <4B1FC705.9010902@colbyconsulting.com> References: <4B1FC705.9010902@colbyconsulting.com> Message-ID: <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 6:49 PM To: VBA Subject: [dba-VB] C# - Thoughts on my methods As a consultant in a home office I work in total isolation except for this email group. So I need your input, to keep me sane and to keep me on the right path. I would like your thoughts on what I am doing and what I am intending to do. As you know, I have "the database from hell", for which I am developing an application to allow me to manipulate the various pieces from an application interface rather than directly from stored procedures and the SSMS or from Access, which is what I have done to this point. With C# I am able to do more than I was able from Access, including getting back output parameters from stored procedures. So... my process so far. First off, I am developing the overall application as a set of child projects inside of the application. The main application opens a form with a menu, and that menu takes me to forms in the child projects to perform pieces of the application. For example I have a database backup project where I can backup and restore specific databases or groups of databases. I have an Accuzip project where I can export CSV files to and import resulting CSV files from the external Accuzip program. I have an Orders project where I can create and manipulate the orders I create for the client. Each child project is physically located underneath the main application directory. In order to reference (open) the forms in the child projects, I have to set a reference to that project and I have to set a using statement in the form. I still do not understand what these two pieces do. Why do I have to set a reference and a using? I assume you cannot set a using statement unless the project references the library (or project)? I also don't understand why some objects in a referenced project class can be seen but others cannot. IOW I can use one class in a namespace as a type to dimension an object, but another class in the same namespace is not visible, cannot be so used. I don't understand a whole ton of things of this nature and I have to say that the whole "break into projects" idea is turning out to be more work than it might be worth. Any comments on this email will be much appreciated. -- John W. Colby www.ColbyConsulting.com _______________________________________________ __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From cfoust at infostatsystems.com Wed Dec 9 15:11:49 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 9 Dec 2009 15:11:49 -0600 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> References: <4B1FC705.9010902@colbyconsulting.com> <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Message-ID: I have to point out that it is exceptionally easy to create circular references when the projects are set up like this. That's why in our apps we keep all the forms in a project, all the reports in a project, etc. Of course, if we were using libraries rather than projects under the solution, it would be different. But this way, it can get messy fast. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, December 09, 2009 12:59 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - Thoughts on my methods Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil From cfoust at infostatsystems.com Wed Dec 9 15:17:15 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 9 Dec 2009 15:17:15 -0600 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B1FE174.90207@colbyconsulting.com> References: <4B1FE174.90207@colbyconsulting.com> Message-ID: You can roll your own using J# from within VS. Idid that originally and it only takes minor translation to put it into C# or VB. That said, we currently use Xceed. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 9:42 AM To: VBA Subject: [dba-VB] C# - zip / unzip Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From phpons at free.fr Wed Dec 9 15:24:33 2009 From: phpons at free.fr (Philippe) Date: Wed, 9 Dec 2009 22:24:33 +0100 Subject: [dba-VB] Ajax application problem Message-ID: <3262DDC894CA427DB254732FCE5E70AF@VOSTRO> Hi all, I have problems putting an ajax application on a production server. The application consists of an aspx page that keeps the javascript code. This code talks with C# page methods to access Web services and interact with the database. For example the first thing the user has to do is fill in login and password fields and click on the btnLogin. Then the code execute the following command: PageMethods.GetUser(user, onGetUserSuccess, onGetUserError); with user being an array containing username and password. The C# GetUser webmethod returns its response to the onGetUserSuccess callback function. The application runs ok on my dev pc. I installed it on the production server, copying the aspx file, web.config file and the binary files. When I run it, I get an error message, something like error during the handling of your request.(freely translated from french!!) This error is displayed into a textbox by the onGetUserError callback function. I put an error trapping withing the webmethod, but its error message is not returned, leading me to think that this webmethod is not "entered". Therefore the javascript code is running ok, but the call to the webmethod is failing. I guess I missed to copy something like a javascript file from the framework, or something else. Do you have any kind of experience in this regard? NB: I also checked that the asp framework is of version 2.0 on the server, it's ok. TIA, Philippe Pons From shamil at smsconsulting.spb.ru Wed Dec 9 15:41:54 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 10 Dec 2009 00:41:54 +0300 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: References: <4B1FC705.9010902@colbyconsulting.com> <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Message-ID: <00d201ca7918$6e663b10$4b32b130$@spb.ru> Hi Charlotte -- Yes, it's easy to create cross-refs, and it's (usually) easy to solve cross-refs under Visual Studio - please provide an example where cross-refs resolving is a really tough task - this sample shouldn't be the case where one decides to resolve cross-refs in a legacy "spaghetti" set of projects IOW we assume we're talking about experienced developers who prevent having "cross-refs" spaghetti by doing code clean-up/refactoring/de-cross-referencing once in a while within a project's sources life-time... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, December 10, 2009 12:12 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Thoughts on my methods I have to point out that it is exceptionally easy to create circular references when the projects are set up like this. That's why in our apps we keep all the forms in a project, all the reports in a project, etc. Of course, if we were using libraries rather than projects under the solution, it would be different. But this way, it can get messy fast. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, December 09, 2009 12:59 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - Thoughts on my methods Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 9 16:44:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 17:44:08 -0500 Subject: [dba-VB] threading In-Reply-To: <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> References: <4B1FF708.1040700@colbyconsulting.com> <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> Message-ID: <4B202838.1080404@colbyconsulting.com> > Why not have several (FE) applications if they are so independent? - all developed within one VS solution but as separate (WinForms) projects sharing the same (set of) class library(-ies)? It seems like that may be what I am doing? I have a single solution. Inside of that solution's physical directory I have multiple projects, each in its own directory. As I expand the solution I do an add / new project from the main solution / project. Doing that takes care of creating a directory structure for each new project, but causes it to be created under the main solution directory. Each project does not depend in any way on any other project, though I do have some shared libraries. Each child project is referenced by the main project, but the child projects do not reference other child projects. Now whether each of these independent projects ends up as individual applications I don't have a clue. I was just tying them together with a single form / menu so that I have one central application to go to to find everything. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Why not have several (FE) applications if they are so independent? - all > developed within one VS solution but as separate (WinForms) projects sharing > the same (set of) class library(-ies)? > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 10:14 PM > To: VBA > Subject: [dba-VB] threading > > As mentioned in previous emails, I am developing an application to manage > all of the tasks for the > DBFH. This includes Backing up databases, creating orders, transferring > data between an external > app etc. I am trying to determine how to thread this app such that if I > start a process exporting > data to Accuzip, I could have another process importing data from Accuzip, > and also be working on an > order. > > As things currently stand, each of these tasks is a project and each project > has its own forms and > classes, and anything else necessary for that task. I really do want to be > able to do multiple > things like this at the same time. Exporting data to Accuzip can take > overnight, and actually > consists of an export and a matching import process. It makes perfect sense > (to me) to have threads > doing this kind of thing, and allow me to go back to the main application > and do something else. > > But at what level would I use a thread? Would I use a thread to open the > form that performs the AZ > process? This would allow me to get that started and immediately go back to > the main app and open > another form (using a new thread?) to start processing an order. > > Or would the form open and the button on the form start a thread that > executes the process? If a > form starts a thread, that allows the user (me) to do other things in that > form potentially changing > to a new directory or selecting a different database. Do you disable all > controls on a form when a > thread starts? I never had to think about this in VBA and it is all rather > confusing. > From jwcolby at colbyconsulting.com Wed Dec 9 16:48:36 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 17:48:36 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> References: <4B1FE174.90207@colbyconsulting.com> <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> Message-ID: <4B202944.8000306@colbyconsulting.com> > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? > From michael at ddisolutions.com.au Wed Dec 9 17:11:11 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 10 Dec 2009 10:11:11 +1100 Subject: [dba-VB] C# - zip / unzip References: <4B1FE174.90207@colbyconsulting.com><00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> <4B202944.8000306@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0158281F@ddi-01.DDI.local> I've never used it but there are builtin libraries for zipping/unzipping. Look in System.IO.Compression The help file looks, well, helpfull for a change :-) using System; using System.IO; using System.IO.Compression; public class GZipTest { private const int buffer_size = 100; public static int ReadAllBytesFromStream(Stream stream, byte[] buffer) { // Use this method is used to read all bytes from a stream. int offset = 0; int totalCount = 0; while (true) { int bytesRead = stream.Read(buffer, offset, buffer_size); if (bytesRead == 0) { break; } offset += bytesRead; totalCount += bytesRead; } return totalCount; } public static bool CompareData(byte[] buf1, int len1, byte[] buf2, int len2) { // Use this method to compare data from two different buffers. if (len1 != len2) { Console.WriteLine("Number of bytes in two buffer are different {0}:{1}", len1, len2); return false; } for (int i = 0; i < len1; i++) { if (buf1[i] != buf2[i]) { Console.WriteLine("byte {0} is different {1}|{2}", i, buf1[i], buf2[i]); return false; } } Console.WriteLine("All bytes compare."); return true; } public static void GZipCompressDecompress(string filename) { Console.WriteLine("Test compression and decompression on file {0}", filename); FileStream infile; try { // Open the file as a FileStream object. infile = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[infile.Length]; // Read the file to ensure it is readable. int count = infile.Read(buffer, 0, buffer.Length); if (count != buffer.Length) { infile.Close(); Console.WriteLine("Test Failed: Unable to read data from file"); return; } infile.Close(); MemoryStream ms = new MemoryStream(); // Use the newly created memory stream for the compressed data. GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true); Console.WriteLine("Compression"); compressedzipStream.Write(buffer, 0, buffer.Length); // Close the stream. compressedzipStream.Close(); Console.WriteLine("Original size: {0}, Compressed size: {1}", buffer.Length, ms.Length); // Reset the memory stream position to begin decompression. ms.Position = 0; GZipStream zipStream = new GZipStream(ms, CompressionMode.Decompress); Console.WriteLine("Decompression"); byte[] decompressedBuffer = new byte[buffer.Length + buffer_size]; // Use the ReadAllBytesFromStream to read the stream. int totalCount = GZipTest.ReadAllBytesFromStream(zipStream, decompressedBuffer); Console.WriteLine("Decompressed {0} bytes", totalCount); if (!GZipTest.CompareData(buffer, buffer.Length, decompressedBuffer, totalCount)) { Console.WriteLine("Error. The two buffers did not compare."); } zipStream.Close(); } // end try catch (InvalidDataException) { Console.WriteLine("Error: The file being read contains invalid data."); } catch (FileNotFoundException) { Console.WriteLine("Error:The file specified was not found."); } catch (ArgumentException) { Console.WriteLine("Error: path is a zero-length string, contains only white space, or contains one or more invalid characters"); } catch (PathTooLongException) { Console.WriteLine("Error: The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The specified path is invalid, such as being on an unmapped drive."); } catch (IOException) { Console.WriteLine("Error: An I/O error occurred while opening the file."); } catch (UnauthorizedAccessException) { Console.WriteLine("Error: path specified a file that is read-only, the path is a directory, or caller does not have the required permissions."); } catch (IndexOutOfRangeException) { Console.WriteLine("Error: You must provide parameters for MyGZIP."); } } public static void Main(string[] args) { string usageText = "Usage: MYGZIP "; //If no file name is specified, write usage text. if (args.Length == 0) { Console.WriteLine(usageText); } else { if (File.Exists(args[0])) GZipCompressDecompress(args[0]); } } } Cheers Michael M > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? > _______________________________________________ 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 - www.avg.com Version: 9.0.709 / Virus Database: 270.14.99/2553 - Release Date: 12/09/09 06:54:00 From Gustav at cactus.dk Thu Dec 10 04:22:54 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 10 Dec 2009 11:22:54 +0100 Subject: [dba-VB] C# - zip / unzip Message-ID: Hi Michael Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. A bit strange that this widely used function is missing from the framework. /gustav >>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> I've never used it but there are builtin libraries for zipping/unzipping. Look in System.IO.Compression The help file looks, well, helpfull for a change :-) using System; using System.IO; using System.IO.Compression; public class GZipTest { private const int buffer_size = 100; public static int ReadAllBytesFromStream(Stream stream, byte[] buffer) { // Use this method is used to read all bytes from a stream. int offset = 0; int totalCount = 0; while (true) { int bytesRead = stream.Read(buffer, offset, buffer_size); if (bytesRead == 0) { break; } offset += bytesRead; totalCount += bytesRead; } return totalCount; } public static bool CompareData(byte[] buf1, int len1, byte[] buf2, int len2) { // Use this method to compare data from two different buffers. if (len1 != len2) { Console.WriteLine("Number of bytes in two buffer are different {0}:{1}", len1, len2); return false; } for (int i = 0; i < len1; i++) { if (buf1[i] != buf2[i]) { Console.WriteLine("byte {0} is different {1}|{2}", i, buf1[i], buf2[i]); return false; } } Console.WriteLine("All bytes compare."); return true; } public static void GZipCompressDecompress(string filename) { Console.WriteLine("Test compression and decompression on file {0}", filename); FileStream infile; try { // Open the file as a FileStream object. infile = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[infile.Length]; // Read the file to ensure it is readable. int count = infile.Read(buffer, 0, buffer.Length); if (count != buffer.Length) { infile.Close(); Console.WriteLine("Test Failed: Unable to read data from file"); return; } infile.Close(); MemoryStream ms = new MemoryStream(); // Use the newly created memory stream for the compressed data. GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true); Console.WriteLine("Compression"); compressedzipStream.Write(buffer, 0, buffer.Length); // Close the stream. compressedzipStream.Close(); Console.WriteLine("Original size: {0}, Compressed size: {1}", buffer.Length, ms.Length); // Reset the memory stream position to begin decompression. ms.Position = 0; GZipStream zipStream = new GZipStream(ms, CompressionMode.Decompress); Console.WriteLine("Decompression"); byte[] decompressedBuffer = new byte[buffer.Length + buffer_size]; // Use the ReadAllBytesFromStream to read the stream. int totalCount = GZipTest.ReadAllBytesFromStream(zipStream, decompressedBuffer); Console.WriteLine("Decompressed {0} bytes", totalCount); if (!GZipTest.CompareData(buffer, buffer.Length, decompressedBuffer, totalCount)) { Console.WriteLine("Error. The two buffers did not compare."); } zipStream.Close(); } // end try catch (InvalidDataException) { Console.WriteLine("Error: The file being read contains invalid data."); } catch (FileNotFoundException) { Console.WriteLine("Error:The file specified was not found."); } catch (ArgumentException) { Console.WriteLine("Error: path is a zero-length string, contains only white space, or contains one or more invalid characters"); } catch (PathTooLongException) { Console.WriteLine("Error: The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The specified path is invalid, such as being on an unmapped drive."); } catch (IOException) { Console.WriteLine("Error: An I/O error occurred while opening the file."); } catch (UnauthorizedAccessException) { Console.WriteLine("Error: path specified a file that is read-only, the path is a directory, or caller does not have the required permissions."); } catch (IndexOutOfRangeException) { Console.WriteLine("Error: You must provide parameters for MyGZIP."); } } public static void Main(string[] args) { string usageText = "Usage: MYGZIP "; //If no file name is specified, write usage text. if (args.Length == 0) { Console.WriteLine(usageText); } else { if (File.Exists(args[0])) GZipCompressDecompress(args[0]); } } } Cheers Michael M > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? From jwcolby at colbyconsulting.com Thu Dec 10 07:12:44 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 10 Dec 2009 08:12:44 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: References: Message-ID: <4B20F3CC.4090604@colbyconsulting.com> Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple source. Several DLLs out there. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi Michael > > Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. > > A bit strange that this widely used function is missing from the framework. > > /gustav > > >>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> > I've never used it but there are builtin libraries for > zipping/unzipping. > Look in System.IO.Compression From dbdoug at gmail.com Thu Dec 10 08:20:06 2009 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 10 Dec 2009 06:20:06 -0800 Subject: [dba-VB] Slightly O/T - web development stuff Message-ID: <4dd71a0c0912100620w6ef71523w11fba8e1ab39a454@mail.gmail.com> www.sitepoint.com is putting one or more of their books/videos on sale every day this month. A couple of days ago I got seven 20 minute videos on Ajax and css for $15; yesterday I got 3 full books on Javascript/Ajax in pdf form for the same $15. Doug Steele From jwcolby at colbyconsulting.com Sun Dec 13 21:45:18 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 13 Dec 2009 22:45:18 -0500 Subject: [dba-VB] Do you wanna learn c#? Message-ID: <4B25B4CE.9010105@colbyconsulting.com> Have I got the book for you. http://www.amazon.com/Microsoft%C2%AE-XNA%C2%AE-Game-Studio-3-0/dp/0735626588/ref=sr_1_2?ie=UTF8&s=books&qid=1260761698&sr=1-2 I bought this book because I found the XNA studio and wanted to learn all about how it works. But this book is about teaching programming, and from that C#. For anyone who knows vba or VB.net it will start off easy, but for anyone who doesn't program at all it also starts off easy. This might be the best book for learning to program (in general) I have run into. Plus it is fun. You need Visual Studio (express is fine) and you need the XNA studio (it is also free). An XBox 360 game controller will be required pretty quickly. I bought the cheapest controller for $15 from Wally world. Then start reading (and writing). I am on chapter 5 now (in about three days) and working on through it. I swear you will learn C#, have fun while you are at it, AND learn how the XNA game studio framework works which is also an awesome tool. Really folks, this is the real deal, if you have always said "I should..." do this one. Or get your teenager involved in it. I bought the book new from Amazon for about $20, plus the controller. Everything else is free. That is a great deal folks! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 14 08:47:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Dec 2009 09:47:22 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B20F3CC.4090604@colbyconsulting.com> References: <4B20F3CC.4090604@colbyconsulting.com> Message-ID: <4B264FFA.5020603@colbyconsulting.com> I am working on creating a single field index on every field of a table. I promptly ran into so many problems making it generic that I punted and went back to hard coding the database / table name. I did find this: select Name as FldName from psm11203.sys.columns WHERE object_id = OBJECT_ID('PSM11203.dbo.tblOrderData') Which does give me a table of field names. Using this in a cursor I am then able to create an index on each field, so I am off and running. This is really a one off process that I need to run on my tblHSID - the table from hell from the database from hell. I have to tell you I am a bit hesitant to pull the trigger in this for the table from hell. It is going to take many minutes to build each index and there are well over 500 fields to index. I could end up locking up my database for the next month. ;) I did create a copy, created a clustered index and will be creating all of these indexes on that copy, but even then it pretty much uses all of the resources of the server. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple > source. Several DLLs out there. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi Michael >> >> Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. >> >> A bit strange that this widely used function is missing from the framework. >> >> /gustav >> >> >>>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> >> I've never used it but there are builtin libraries for >> zipping/unzipping. >> Look in System.IO.Compression > > _______________________________________________ > dba-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 Dec 14 09:02:42 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Dec 2009 10:02:42 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B264FFA.5020603@colbyconsulting.com> References: <4B20F3CC.4090604@colbyconsulting.com> <4B264FFA.5020603@colbyconsulting.com> Message-ID: <4B265392.3010107@colbyconsulting.com> Boy did I reply to the wrong email or what??? John W. Colby www.ColbyConsulting.com jwcolby wrote: > I am working on creating a single field index on every field of a table. I promptly ran into so > many problems making it generic that I punted and went back to hard coding the database / table > name. I did find this: > > select Name as FldName from psm11203.sys.columns > WHERE object_id = OBJECT_ID('PSM11203.dbo.tblOrderData') > > Which does give me a table of field names. Using this in a cursor I am then able to create an index > on each field, so I am off and running. > > This is really a one off process that I need to run on my tblHSID - the table from hell from the > database from hell. > > I have to tell you I am a bit hesitant to pull the trigger in this for the table from hell. It is > going to take many minutes to build each index and there are well over 500 fields to index. I could > end up locking up my database for the next month. ;) > > I did create a copy, created a clustered index and will be creating all of these indexes on that > copy, but even then it pretty much uses all of the resources of the server. > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: >> Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple >> source. Several DLLs out there. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Gustav Brock wrote: >>> Hi Michael >>> >>> Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. >>> >>> A bit strange that this widely used function is missing from the framework. >>> >>> /gustav >>> >>> >>>>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> >>> I've never used it but there are builtin libraries for >>> zipping/unzipping. >>> Look in System.IO.Compression >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Johncliviger at aol.com Tue Dec 15 04:10:47 2009 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 15 Dec 2009 05:10:47 EST Subject: [dba-VB] A Parameters syntax question Message-ID: Hi All I'm connecting a vb2005 DataGridView to an Access db via vb code to return a subset of records from a table. Using the GUID dataType it works fine but when I change the datatype I get all the records. I'm using the Imports system.Data.OleDb class. From there I have OleDb connection, Command, DataAdapter and a Dataset. EG. With Command .CommandText = "QueryName" .CommandType = CommandType.StoredProcedure .Connection = OleDbConnection .Parameters.Add("@REFNOC", OleDbType.Guid,16).Value = New Guid(REFNOC) end With Every thing works as it should. That is until I change the the datatype in the Parameter line and try to use a string or Integer. I can't get the syntax right for the .Parameters line. If for example I change the .Parameter to say .Parameters.Add("@REFNOC", OleDbType.Single).Value = REFNOC I get all records Can anyone cast a little light here? From Johncliviger at aol.com Tue Dec 15 04:39:12 2009 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 15 Dec 2009 05:39:12 EST Subject: [dba-VB] Parameters problem solved Message-ID: Now then who's a silly boy! When using parameters in vb.net connection one does need to specify the parameter in the back-end query!! Then it works a treat johncliviger From jwcolby at colbyconsulting.com Wed Dec 16 16:20:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 16 Dec 2009 17:20:08 -0500 Subject: [dba-VB] windows 7 media center Message-ID: <4B295D18.7070000@colbyconsulting.com> Well my Vista Windows Media Center (WMC) finally bit the dust. Something happened (a SP install I suspect) and the codec got trashed (I think) and suddenly WMC no workee - no tv of any kind, already recorded or off of the tv card. As a college student I qualify to buy a copy of Windows 7 for $29 which sounded too good to pass up. And that version supposedly had a much improved MCE. So I did. Bought it, and installed it ON A 30 gb FLASH DRIVE last night. Finished about 3:30 am. She workee again. In the meantime I also went from a low power dual core to a medium powered quad core, but twice the ghz rating. Needless to say the Home theater PC flies. Now if it will just work for a long time with no maintenance. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 17 20:37:41 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 17 Dec 2009 21:37:41 -0500 Subject: [dba-VB] SQL Server 2008 install broke my application Message-ID: <4B2AEAF5.3080201@colbyconsulting.com> A perfectly functioning application has all kinds of compile errors after the SQL Server install. A bunch of Microsoft.SQLServer.XXX references had to be deleted and rereferenced. The sole remaining issue that I still haven't gotten around is the Transfer object, supposedly part of the SMO object is suddenly gone missing. And I was using that to copy a database and all of its internal objects. Sigh. -- John W. Colby www.ColbyConsulting.com From bheid at sc.rr.com Sun Dec 20 00:29:55 2009 From: bheid at sc.rr.com (Bobby Heid) Date: Sun, 20 Dec 2009 01:29:55 -0500 Subject: [dba-VB] SQL Server 2008 install broke my application In-Reply-To: <4B2AEAF5.3080201@colbyconsulting.com> References: <4B2AEAF5.3080201@colbyconsulting.com> Message-ID: <000301ca813d$d82a7610$887f6230$@rr.com> Hey John, Did you install the SQL Client Tools? I was just reading something about this today. I think the SMO stuff is installed with the client tools. I am not positive though. If this does not solve your issue, I'll see if I can find that reference tomorrow. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 17, 2009 9:38 PM To: VBA Subject: [dba-VB] SQL Server 2008 install broke my application A perfectly functioning application has all kinds of compile errors after the SQL Server install. A bunch of Microsoft.SQLServer.XXX references had to be deleted and rereferenced. The sole remaining issue that I still haven't gotten around is the Transfer object, supposedly part of the SMO object is suddenly gone missing. And I was using that to copy a database and all of its internal objects. Sigh. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Dec 20 09:29:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 20 Dec 2009 10:29:39 -0500 Subject: [dba-VB] SPAM-LOW: Re: SQL Server 2008 install broke my application In-Reply-To: <000301ca813d$d82a7610$887f6230$@rr.com> References: <4B2AEAF5.3080201@colbyconsulting.com> <000301ca813d$d82a7610$887f6230$@rr.com> Message-ID: <4B2E42E3.4090208@colbyconsulting.com> I checked every box on the install. John W. Colby www.ColbyConsulting.com Bobby Heid wrote: > Hey John, > > Did you install the SQL Client Tools? I was just reading something about > this today. I think the SMO stuff is installed with the client tools. I am > not positive though. If this does not solve your issue, I'll see if I can > find that reference tomorrow. > > Bobby > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 17, 2009 9:38 PM > To: VBA > Subject: [dba-VB] SQL Server 2008 install broke my application > > A perfectly functioning application has all kinds of compile errors after > the SQL Server install. A > bunch of Microsoft.SQLServer.XXX references had to be deleted and > rereferenced. The sole remaining > issue that I still haven't gotten around is the Transfer object, supposedly > part of the SMO object > is suddenly gone missing. And I was using that to copy a database and all > of its internal objects. > > Sigh. > From jwcolby at colbyconsulting.com Tue Dec 22 10:18:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 22 Dec 2009 11:18:12 -0500 Subject: [dba-VB] Multimonitor toolbar Message-ID: <4B30F144.6090504@colbyconsulting.com> I just found this, WAY COOL! It puts a toolbar at the bottom of the second monitor that displays the icons for the programs being displayed on the second monitor. How come no one told me about this? http://www.mediachance.com/free/multimon.htm -- John W. Colby www.ColbyConsulting.com From paul.hartland at googlemail.com Thu Dec 24 06:09:00 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 24 Dec 2009 12:09:00 +0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False Message-ID: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com From andy at minstersystems.co.uk Thu Dec 24 06:59:11 2009 From: andy at minstersystems.co.uk (Andy Lacey) Date: Thu, 24 Dec 2009 12:59:11 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> Message-ID: <153B93F23C804502875134D824C863BA@MINSTER> Hi Paul Well I'll wait to be corrected but I reckon they're simply two syntactically different ways of saying the same thing. They'd surely compile into the same code. So it just comes down to preference of style and readability, i.e. totally subjective Andy -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: 24 December 2009 12:09 To: VisualBasicList Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Thu Dec 24 07:07:18 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 24 Dec 2009 13:07:18 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <153B93F23C804502875134D824C863BA@MINSTER> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> <153B93F23C804502875134D824C863BA@MINSTER> Message-ID: <4b33679b.0e67f10a.2282.ffffa79b@mx.google.com> Or you could do this (which I prefer) If not rst.eof then Do my stuff Else Msgbox "who nicked my records" Endif Ps. Who is the programmer? You, or the Project Manager? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Andy Lacey Sent: 24 December 2009 12:59 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False Hi Paul Well I'll wait to be corrected but I reckon they're simply two syntactically different ways of saying the same thing. They'd surely compile into the same code. So it just comes down to preference of style and readability, i.e. totally subjective Andy -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: 24 December 2009 12:09 To: VisualBasicList Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 24 10:14:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 24 Dec 2009 11:14:22 -0500 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> Message-ID: <4B33935E.5000607@colbyconsulting.com> Paul, Perhaps better would be: if MyRecordset.BOF and MyRecordset.EOF then msgbox "Empty" else do stuff here endif It is easier to read the true than the nots, especially when there is more than one. Either one works. If this is in a tight loop and speed matters, then the NOT might cause a very slight slowdown as it is two extra boolean operators. OTOH the compiler might just pick it up and rewrite it to my syntax anyway. John W. Colby www.ColbyConsulting.com Paul Hartland wrote: > To all, > > I use a lot of recordsets, and to detect they actually contain something I > have always used the following: > > If myrecordset.bof=false and myrecordset.eof=false then > do my stuff here > Else > msgbox "empty" > End If > > However my project manager prefers: > If not myrecordset.bof and not myrecordset.eof then > do my stuff here > Else > msgbox "empty" > End If > > Is there actually a prefered way, or is one quicker than the other, or is > there an even better way to do this ? > > Thanks in advance for any comments, and a very merry christmas & happy new > year to everyone. > From max.wanadoo at gmail.com Thu Dec 24 12:13:13 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 24 Dec 2009 18:13:13 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <4B33935E.5000607@colbyconsulting.com> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> <4B33935E.5000607@colbyconsulting.com> Message-ID: <4b33af5b.1067f10a.3ae6.ffffb846@mx.google.com> John, I don't think that will work...something from Getz etc sticks in my mind...might be old age though. maxx -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 24 December 2009 16:14 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False Paul, Perhaps better would be: if MyRecordset.BOF and MyRecordset.EOF then msgbox "Empty" else do stuff here endif It is easier to read the true than the nots, especially when there is more than one. Either one works. If this is in a tight loop and speed matters, then the NOT might cause a very slight slowdown as it is two extra boolean operators. OTOH the compiler might just pick it up and rewrite it to my syntax anyway. John W. Colby www.ColbyConsulting.com Paul Hartland wrote: > To all, > > I use a lot of recordsets, and to detect they actually contain something I > have always used the following: > > If myrecordset.bof=false and myrecordset.eof=false then > do my stuff here > Else > msgbox "empty" > End If > > However my project manager prefers: > If not myrecordset.bof and not myrecordset.eof then > do my stuff here > Else > msgbox "empty" > End If > > Is there actually a prefered way, or is one quicker than the other, or is > there an even better way to do this ? > > Thanks in advance for any comments, and a very merry christmas & happy new > year to everyone. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 31 16:29:43 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 31 Dec 2009 17:29:43 -0500 Subject: [dba-VB] Happy new year Message-ID: <4B3D25D7.2030404@colbyconsulting.com> I will likely be asleep when it actually happens locally, so I wish each and every one of you a MUCH better year in 2010. HAPPY NEW YEAR! -- John W. Colby www.ColbyConsulting.com From garykjos at gmail.com Thu Dec 31 16:35:55 2009 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 31 Dec 2009 16:35:55 -0600 Subject: [dba-VB] [AccessD] Happy new year In-Reply-To: <4B3D25D7.2030404@colbyconsulting.com> References: <4B3D25D7.2030404@colbyconsulting.com> Message-ID: Likewise for me too John. Early to bed, early to rise is my program for the most part. I echo your sentiments. Happy New Year! GK On Thu, Dec 31, 2009 at 4:29 PM, jwcolby wrote: > I will likely be asleep when it actually happens locally, so I wish each and every one of you a MUCH > better year in 2010. > > HAPPY NEW YEAR! > > -- > John W. Colby > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.com From marklbreen at gmail.com Tue Dec 1 09:12:22 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 1 Dec 2009 15:12:22 +0000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B14231F.3020905@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com> Message-ID: Hello John, I have struggled with this value, and mixed it up with the connectionTimeout also. As a result, when I think there will be a delay, I also set it to zero, and then I sleep easy. I did that two years ago with out troublesome app, and now it works and works and works. Whats the downside of infinite timeout. If it takes three weeks, you will find out anyway, but why kill it after ten mins when it would have finished successfully in 19.45 minutes. Mark 2009/11/30 jwcolby > Any words of wisdom on setting the command.Timeout property? I have stored > procedures that execute > instantly, and others that can take an hour or more (large appends). > > How can I discover how long a stored procedure takes to run so that I can > set this property > dynamically? As an example I have cases where I am appending 65 million > rows into a table of 6 > fields. This can take a long time (at the very least perhaps 20 minutes) > but if I could get a > "RecordsAffected" count for such queries as well as the time it took to > execute, then I could start > to discover that it takes "X seconds / million" records, and set the > timeout to a reasonable value > based on the records to be appended. > > This doesn't have to be any exact time value. I assume a simple pair of > time variables, then "stop > time - start time"? > > Or should I just discover worst case and set it to that? > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 09:24:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 10:24:10 -0500 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: References: <4B14231F.3020905@colbyconsulting.com> Message-ID: <4B15351A.40500@colbyconsulting.com> Mark, Thanks for the response. >If it takes three weeks, you will find out anyway, but why kill it after ten mins when it would have finished successfully in 19.45 minutes. I hear you! BTW how do you kill an executing stored procedure? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > I have struggled with this value, and mixed it up with the connectionTimeout > also. As a result, when I think there will be a delay, I also set it to > zero, and then I sleep easy. I did that two years ago with > out troublesome app, and now it works and works and works. Whats the > downside of infinite timeout. If it takes three weeks, you will find out > anyway, but why kill it after ten mins when it would have finished > successfully in 19.45 minutes. > > > Mark > > > > > 2009/11/30 jwcolby > >> Any words of wisdom on setting the command.Timeout property? I have stored >> procedures that execute >> instantly, and others that can take an hour or more (large appends). >> >> How can I discover how long a stored procedure takes to run so that I can >> set this property >> dynamically? As an example I have cases where I am appending 65 million >> rows into a table of 6 >> fields. This can take a long time (at the very least perhaps 20 minutes) >> but if I could get a >> "RecordsAffected" count for such queries as well as the time it took to >> execute, then I could start >> to discover that it takes "X seconds / million" records, and set the >> timeout to a reasonable value >> based on the records to be appended. >> >> This doesn't have to be any exact time value. I assume a simple pair of >> time variables, then "stop >> time - start time"? >> >> Or should I just discover worst case and set it to that? >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Tue Dec 1 09:49:01 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 1 Dec 2009 15:49:01 +0000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B15351A.40500@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com> <4B15351A.40500@colbyconsulting.com> Message-ID: Hello John, Not sure, but stopping the server is one way. My main problems were sprocs stopping when I did not want them to stop, for me, if it is still running after 24 hours, it is probably never going to stop. For you, you might increase that to 48 hours, but in general, they either finish promptly, or else will never finish, either way, timing out after 10, 20, 50, or even 600 minutes is almost never a good option, if there is a possibility that it will finish in 601 minutes. There is probably a way to stop a process, Francisco or some of the other experts may know how, but I would either stop the db server / service, or else in worst case, do a quick reboot. For the rest of the year, I would never worry about it, happy in the knowledge they the server must work till the death :) Thanks Mark 2009/12/1 jwcolby > Mark, > > Thanks for the response. > > >If it takes three weeks, you will find out anyway, but why kill it after > ten mins when it would > have finished successfully in 19.45 minutes. > > I hear you! > > BTW how do you kill an executing stored procedure? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: > > Hello John, > > > > I have struggled with this value, and mixed it up with the > connectionTimeout > > also. As a result, when I think there will be a delay, I also set it to > > zero, and then I sleep easy. I did that two years ago with > > out troublesome app, and now it works and works and works. Whats the > > downside of infinite timeout. If it takes three weeks, you will find out > > anyway, but why kill it after ten mins when it would have finished > > successfully in 19.45 minutes. > > > > > > Mark > > > > > > > > > > 2009/11/30 jwcolby > > > >> Any words of wisdom on setting the command.Timeout property? I have > stored > >> procedures that execute > >> instantly, and others that can take an hour or more (large appends). > >> > >> How can I discover how long a stored procedure takes to run so that I > can > >> set this property > >> dynamically? As an example I have cases where I am appending 65 million > >> rows into a table of 6 > >> fields. This can take a long time (at the very least perhaps 20 > minutes) > >> but if I could get a > >> "RecordsAffected" count for such queries as well as the time it took to > >> execute, then I could start > >> to discover that it takes "X seconds / million" records, and set the > >> timeout to a reasonable value > >> based on the records to be appended. > >> > >> This doesn't have to be any exact time value. I assume a simple pair of > >> time variables, then "stop > >> time - start time"? > >> > >> Or should I just discover worst case and set it to that? > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 09:58:36 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 10:58:36 -0500 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: References: <4B14231F.3020905@colbyconsulting.com> <4B15351A.40500@colbyconsulting.com> Message-ID: <4B153D2C.90100@colbyconsulting.com> Mark, >but I would either stop the db server / service, or else in worst case, do a quick reboot. I have done both. I have corrupted the database doing the reboot. Stopping the service seems to work, however I have also seen the database pick up where it left off when the service restarted. I am sure there is some way to "officially" stop a running process, I just don't know how. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > Not sure, but stopping the server is one way. My main problems were sprocs > stopping when I did not want them to stop, for me, if it is still running > after 24 hours, it is probably never going to stop. For you, you might > increase that to 48 hours, but in general, they either finish promptly, or > else will never finish, either way, timing out after 10, 20, 50, or even 600 > minutes is almost never a good option, if there is a possibility that it > will finish in 601 minutes. > > There is probably a way to stop a process, Francisco or some of the other > experts may know how, but I would either stop the db server / service, or > else in worst case, do a quick reboot. For the rest of the year, I would > never worry about it, happy in the knowledge they the server must work till > the death :) > > Thanks > > Mark > > > > > > > 2009/12/1 jwcolby > >> Mark, >> >> Thanks for the response. >> >> >If it takes three weeks, you will find out anyway, but why kill it after >> ten mins when it would >> have finished successfully in 19.45 minutes. >> >> I hear you! >> >> BTW how do you kill an executing stored procedure? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Mark Breen wrote: >>> Hello John, >>> >>> I have struggled with this value, and mixed it up with the >> connectionTimeout >>> also. As a result, when I think there will be a delay, I also set it to >>> zero, and then I sleep easy. I did that two years ago with >>> out troublesome app, and now it works and works and works. Whats the >>> downside of infinite timeout. If it takes three weeks, you will find out >>> anyway, but why kill it after ten mins when it would have finished >>> successfully in 19.45 minutes. >>> >>> >>> Mark >>> >>> >>> >>> >>> 2009/11/30 jwcolby >>> >>>> Any words of wisdom on setting the command.Timeout property? I have >> stored >>>> procedures that execute >>>> instantly, and others that can take an hour or more (large appends). >>>> >>>> How can I discover how long a stored procedure takes to run so that I >> can >>>> set this property >>>> dynamically? As an example I have cases where I am appending 65 million >>>> rows into a table of 6 >>>> fields. This can take a long time (at the very least perhaps 20 >> minutes) >>>> but if I could get a >>>> "RecordsAffected" count for such queries as well as the time it took to >>>> execute, then I could start >>>> to discover that it takes "X seconds / million" records, and set the >>>> timeout to a reasonable value >>>> based on the records to be appended. >>>> >>>> This doesn't have to be any exact time value. I assume a simple pair of >>>> time variables, then "stop >>>> time - start time"? >>>> >>>> Or should I just discover worst case and set it to that? >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-VB mailing list >>>> dba-VB at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 10:07:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 11:07:22 -0500 Subject: [dba-VB] C# - Records Affected Message-ID: <4B153F3A.8010102@colbyconsulting.com> I am trying to get a count of records appended, updated etc in my SPs and returning that to my C# supervisor. I am finding references to @@Rowcount however this is returning 1 instead of the actual number. Is this @@RowCount the real deal? The SP definition: ALTER PROCEDURE [dbo].[sp_AZOut_AZExportToOrderedChunk] -- Add the parameters for the stored procedure here @DBName varchar(50), @ErrorDesc varchar(4000) output, @ErrorNo int output, @RecsAffected int output AS BEGIN Setting the returned value EXEC (@SQL) select @RecsAffected = @@RowCount My c# code: intRecsAffected = sCmd.Parameters["@RecsAffected"].Value The code triggers the try block if there is no such parameter (I just ignore it) or returns 1 if the parameter exists. This is a functioning tested SP which typically appends millions of records, though the exact number depends on the database. Is there something I need to know here? -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Tue Dec 1 10:49:57 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 02 Dec 2009 02:49:57 +1000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B153D2C.90100@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com>, , <4B153D2C.90100@colbyconsulting.com> Message-ID: <4B154935.15271.1331E01@stuart.lexacorp.com.pg> http://windowsitpro.com/article/articleid/14148/how-can-i-stop-a-sql-server-process.html Do a select * from sysprocesses and identify the spid in question. Then do a "KILL " This will mark the spid as "dead". Note that it may take a while for the process to end as it has to rollback all the updates that it has been doing. Also kill only marks the process as dead - the process itself needs to check for this, and if it is stuck in a loop as the result of a bug or whateverthen it won't terminate. Also certain processes like dump and dbcc commands have significant code paths where the kill command is not checked for and so these can take some time to terminate. Also, if the process is in an extended-stored procedure, or is waiting on network traffic/remote stored-procedure it will not check whether it has been terminated until these actions have been completed. See Q171224 for more info - including details on the waittype that can tell you what a process is waiting on. If the process won't die for one of the above reasons then your only choice is to stop the sqlservr.exe process itself and re-start. See also http://msdn.microsoft.com/en-us/library/aa933230%28SQL.80%29.aspx for info on KILL x WITH STATUSONLY for tracking the rollback once you kill a process. -- Stuart On 1 Dec 2009 at 10:58, jwcolby wrote: > I am sure there is some way to "officially" stop a running process, I just don't know how. > From jwcolby at colbyconsulting.com Tue Dec 1 10:50:57 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 11:50:57 -0500 Subject: [dba-VB] C# - Records Affected In-Reply-To: <4B153F3A.8010102@colbyconsulting.com> References: <4B153F3A.8010102@colbyconsulting.com> Message-ID: <4B154971.4000207@colbyconsulting.com> Sorry for the ring, I found the problem. The SP that I took this code from actually worked but the code I was testing did not and came before this code. The problem was simply that in the SP I did not place the line that captured @@RowCount immediately after the EXEC (@SQL) statement. All of the examples clearly warned me that this was a requirement but you understand "senior moments". Anyway, this is now working. Piece by piece this thing is coming together. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I am trying to get a count of records appended, updated etc in my SPs and returning that to my C# > supervisor. I am finding references to @@Rowcount however this is returning 1 instead of the actual > number. > > Is this @@RowCount the real deal? > > The SP definition: > > ALTER PROCEDURE [dbo].[sp_AZOut_AZExportToOrderedChunk] > -- Add the parameters for the stored procedure here > @DBName varchar(50), > @ErrorDesc varchar(4000) output, > @ErrorNo int output, > @RecsAffected int output > > AS > BEGIN > > > Setting the returned value > > EXEC (@SQL) > select @RecsAffected = @@RowCount > > My c# code: > > intRecsAffected = sCmd.Parameters["@RecsAffected"].Value > > The code triggers the try block if there is no such parameter (I just ignore it) or returns 1 if the > parameter exists. > > This is a functioning tested SP which typically appends millions of records, though the exact number > depends on the database. > > Is there something I need to know here? From jwcolby at colbyconsulting.com Tue Dec 1 16:53:55 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 17:53:55 -0500 Subject: [dba-VB] C# - Direct data manipulation Message-ID: <4B159E83.4000006@colbyconsulting.com> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 2 00:54:07 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 09:54:07 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B159E83.4000006@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> Message-ID: <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> Hi John -- I must say I have never done that "dynamic" t-SQL via C# - I guess it should be doable: using SMO or even SqlCommand's .ExecuteNonQuery(?) it should be possible to create SPs and UDFs, and then execute them as usual... BTW, UDFs, which return tables are very often a good substitute for all kinds of temp tables and dynamic SQL... I wonder what for all that "dynamism" there? Do you have constantly changing database structure? Do you have constantly changing customer requests, which do not allow you to create a set of stable parameterized SPs and UDFs, and for small(?) changing part of queries use LINQ for SQL or ADO.NET EF? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 1:54 AM To: VBA Subject: [dba-VB] C# - Direct data manipulation As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4653 (20091201) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 01:19:20 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 08:19:20 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. /gustav >>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Dec 2 01:31:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 08:31:02 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next-week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Wed Dec 2 02:05:18 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 11:05:18 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <00aa01ca7326$31634020$9429c060$@spb.ru> Hi Gustav -- Congrats! <<< A full day just sitting, listening, and learning! >>> Not easy. I usually very quick fall semi-asleep during such presentations as they look so slow - hope Scott Guthrie will make this one you'll attend tomorrow a very dynamic experience... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4653 (20091201) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 02:17:19 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 09:17:19 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil Oh, I know that feeling, indeed if the presenter has a voice like a priest and your knowledge about the topic is a little too high. But I'm confident that Scott Guthrie will keep me awake! /gustav >>> shamil at smsconsulting.spb.ru 02-12-2009 09:05 >>> Hi Gustav -- Congrats! <<< A full day just sitting, listening, and learning! >>> Not easy. I usually very quick fall semi-asleep during such presentations as they look so slow - hope Scott Guthrie will make this one you'll attend tomorrow a very dynamic experience... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From marklbreen at gmail.com Wed Dec 2 04:23:09 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 2 Dec 2009 10:23:09 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow Message-ID: Hello All, I am running VS 2008 on a powerful machine with loads of resources. My project is a DNN project sitting in the wwwroot folder which allows me to change a few lines of code and then immediately see the results in the web app. However, when I manipulate the Data Context Objects in the AppCode Folder, the response times are dreadfully, slow. It takes three to four minutes to open, edit, save and close one of these objects. I have tried it on a second machine and the results are similar. I can edit the Dbml files outside of the solution, but I am not sure whether that is safe to do so, when I edit them outside the solution (copying and pasting to another folder and then opening the dbml file from there), they open instantly. When I say "safe to do so", does the project file or the sln file need to be updated with the changes that have been made. I do get some warning message about "cannot find web.config, so using the file from the dbml file instead" which I accepted. I recall Shamil mentioned that manually editing these within the individual files is not a good idea, so i guess that he may have been suffering the same problems as I am, IE so sloooow to open and close. TIA for an help, if I have not expressed the problem clearly enough, let me know, Mark From shamil at smsconsulting.spb.ru Wed Dec 2 07:20:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 16:20:11 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: Message-ID: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Hello Mark -- First of all try to switch to FireFox - forget IE while debugging large ASP.NET apps from within VS.... I can only note that debugging large ASP.NET applications is a real PITA - this is why I'm always trying to get out as much as possible BL and DAL code into separate projects and develop, debug/test them without UI (ASP.NET or WinForms or WCF)... And DNN is a "huge ASP.NET" app with a lot of classlibs, which are so tightly coupled together that there is no way to debug part of them outside of running DNN instance - with all the consequences - bad luck... I suppose you can edit DNN's Data Context Objects source code from AppCode outside of VS (e.g. within notepad) - when the edits are saved then DNN will restart, that could take a while, quite a while.... A temp solution could be to keep *all* the source code of DNN module's control within that control's code behind .aspx.cs (.aspx.vb) during development - when you edit your code there then ASP.NET app will not restart it will just recompile .aspx and .aspx.cs - so it should work considerably quicker... All in all I think DNN custom modules development is a RPITA - one can never know how much it will finally take for a given project if they will not try to find a way to debug/ test as much as possible code outside of running DNN: something like develop a separate ASP.NET application, make it working and then port it to DNN environmnet... Be prepared for "crazy debug sessions" (if I'm not missing something and there are some "miracle" tools, which simplify DNN custom development debugging)... Philosophic note: DNN seems to be a good example that there "are no miracles in this world" - DNN is a great prototyping tool and CMS, when one has ready to use DNN modules and skins, and DNN is becoming RPITA when one have to develop a(n) (advanced) custom module. Rhetoric Question: Why in this world there couldn't be a "silver-bullet" tool able to support both standard and custom development with the same ease as DNN does support CMS development? I guess "Ruby on Rails" could be "what doctor ordered"?... Or ASP.NET MVC2 Framework? DNN did grow from a "junky" MS ASP.NET sample code base, and even advanced developers as DNN Core Development Team members are can't still "convert" that original "junk" to pearls... Hopefully they will do that in DNN v.7? - they "just" need to clean-up DNN huge code base and to implement what is called "Inversion of Control" (http://martinfowler.com/articles/injection.html) to "untight" DNN Core classlibs as much as possible... Please correct me if I'm wrong - in fact I'd be really happy to be wrong here as I have had to suspend one of the DNN projects, which didn't go smoothly because of PITA DNN custom modules development experience... Sorry, Mark, I have no a definitive answer for you here - just some "soap" and "bubbles" and PITA of my own DNN custom modules development experience, which I need to find a way to workaround, or quit the idea of DNN custom development completely as it's too expensive to be true. Still hope I missed some approaches to simplify this development - I mean ready to use approaches and tools without long learning curve... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Wednesday, December 02, 2009 1:23 PM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Why are my data Context Objects soooo sloooow Hello All, I am running VS 2008 on a powerful machine with loads of resources. My project is a DNN project sitting in the wwwroot folder which allows me to change a few lines of code and then immediately see the results in the web app. However, when I manipulate the Data Context Objects in the AppCode Folder, the response times are dreadfully, slow. It takes three to four minutes to open, edit, save and close one of these objects. I have tried it on a second machine and the results are similar. I can edit the Dbml files outside of the solution, but I am not sure whether that is safe to do so, when I edit them outside the solution (copying and pasting to another folder and then opening the dbml file from there), they open instantly. When I say "safe to do so", does the project file or the sln file need to be updated with the changes that have been made. I do get some warning message about "cannot find web.config, so using the file from the dbml file instead" which I accepted. I recall Shamil mentioned that manually editing these within the individual files is not a good idea, so i guess that he may have been suffering the same problems as I am, IE so sloooow to open and close. TIA for an help, if I have not expressed the problem clearly enough, let me know, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From marklbreen at gmail.com Wed Dec 2 07:39:14 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 2 Dec 2009 13:39:14 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Message-ID: Hello Shamil, Thank you for your detailed response. *Browsers* Some comments, I am actually using Chrome to View my work, but I am not doing any debugging, in the traditional sense, I code a few lines, click save and then view the results in Chrome, when I am not happy, I flick back to VS, change it and continue again. So, it is true to say, I am not really debugging, just viewing. However, I stopped using IE a few years ago, and since I switched to Chrome, it is the first thing I install on new machines. With the exception of the MSDN site, it works perfect for me. *Slow Data Contexts* So can I assume that this slowness is simply to be accepted, it is either a) the way VS2008 usually performs, or b) the way VS2008 performs when data contexts are involved in a large project such as DNN. I did not notice any difference when I copied the code from the wwwroot folder, so I hope that is not part of the problem. *DNN Development* Probably I am not doing real DNN custom programming, but I am currently building web user controls, and simply saving them, and then creating a module for DNN and including the web user control on that module. I know this is not real DNN programming, but have created about 20 module so far like this. DNN gives me, as a script kiddie type programmer, they ability to do a simple web app, but it manages the users and authentication, something that I could never program. IOW, with the exception of a few DNN hooks, I am doing simple programming, but throwing the results into DNN. *Free Lunch* I have to say I agree with you, there are limitations everywhere. My appoach is always to keep it as simple as possible until I absolutely know that I need to make it more complex. Thanks, Mark 2009/12/2 Shamil Salakhetdinov > Hello Mark -- > > First of all try to switch to FireFox - forget IE while debugging large > ASP.NET apps from within VS.... > > I can only note that debugging large ASP.NET applications is a real PITA > - > this is why I'm always trying to get out as much as possible BL and DAL > code > into separate projects and develop, debug/test them without UI (ASP.NET or > WinForms or WCF)... > > And DNN is a "huge ASP.NET" app with a lot of classlibs, which are so > tightly coupled together that there is no way to debug part of them outside > of running DNN instance - with all the consequences - bad luck... > > I suppose you can edit DNN's Data Context Objects source code from AppCode > outside of VS (e.g. within notepad) - when the edits are saved then DNN > will > restart, that could take a while, quite a while.... > > A temp solution could be to keep *all* the source code of DNN module's > control within that control's code behind .aspx.cs (.aspx.vb) during > development - when you edit your code there then ASP.NET app will not > restart it will just recompile .aspx and .aspx.cs - so it should work > considerably quicker... > > All in all I think DNN custom modules development is a RPITA - one can > never > know how much it will finally take for a given project if they will not try > to find a way to debug/ test as much as possible code outside of running > DNN: something like develop a separate ASP.NET application, make it > working > and then port it to DNN environmnet... > > Be prepared for "crazy debug sessions" (if I'm not missing something and > there are some "miracle" tools, which simplify DNN custom development > debugging)... > > Philosophic note: DNN seems to be a good example that there "are no > miracles > in this world" - DNN is a great prototyping tool and CMS, when one has > ready > to use DNN modules and skins, and DNN is becoming RPITA when one have to > develop a(n) (advanced) custom module. Rhetoric Question: Why in this world > there couldn't be a "silver-bullet" tool able to support both standard and > custom development with the same ease as DNN does support CMS development? > > I guess "Ruby on Rails" could be "what doctor ordered"?... > > Or ASP.NET MVC2 Framework? > > DNN did grow from a "junky" MS ASP.NET sample code base, and even advanced > developers as DNN Core Development Team members are can't still "convert" > that original "junk" to pearls... > > Hopefully they will do that in DNN v.7? - they "just" need to clean-up DNN > huge code base and to implement what is called "Inversion of Control" > (http://martinfowler.com/articles/injection.html) to "untight" DNN Core > classlibs as much as possible... > > Please correct me if I'm wrong - in fact I'd be really happy to be wrong > here as I have had to suspend one of the DNN projects, which didn't go > smoothly because of PITA DNN custom modules development experience... > > Sorry, Mark, I have no a definitive answer for you here - just some "soap" > and "bubbles" and PITA of my own DNN custom modules development experience, > which I need to find a way to workaround, or quit the idea of DNN custom > development completely as it's too expensive to be true. Still hope I > missed > some approaches to simplify this development - I mean ready to use > approaches and tools without long learning curve... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Wednesday, December 02, 2009 1:23 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello All, > > I am running VS 2008 on a powerful machine with loads of resources. My > project is a DNN project sitting in the wwwroot folder which allows me to > change a few lines of code and then immediately see the results in the web > app. > > However, when I manipulate the Data Context Objects in the AppCode Folder, > the response times are dreadfully, slow. It takes three to four minutes to > open, edit, save and close one of these objects. > > I have tried it on a second machine and the results are similar. > > I can edit the Dbml files outside of the solution, but I am not sure > whether > that is safe to do so, when I edit them outside the solution (copying and > pasting to another folder and then opening the dbml file from there), they > open instantly. When I say "safe to do so", does the project file or the > sln file need to be updated with the changes that have been made. I do get > some warning message about "cannot find web.config, so using the file from > the dbml file instead" which I accepted. > > I recall Shamil mentioned that manually editing these within the individual > files is not a good idea, so i guess that he may have been suffering the > same problems as I am, IE so sloooow to open and close. > > TIA for an help, if I have not expressed the problem clearly enough, let me > know, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Wed Dec 2 08:28:45 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 17:28:45 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Message-ID: <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Hi Mark, <<< *Slow Data Contexts* >>> What do you mean by that? - editing and saving your DNN Data Context Objects source code in \AppCode subfolder? What do you mean by "Dbml"? <<< but have created about 20 module so far like this. >>> OK, I have also made 30+ DNN5.x custom modules properly packed etc. - all very similar to each other but to get the first one was a time-consuming issue. "Tired" from that. Need a break. Then I maybe will make some more... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Wednesday, December 02, 2009 4:39 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow Hello Shamil, Thank you for your detailed response. *Browsers* Some comments, I am actually using Chrome to View my work, but I am not doing any debugging, in the traditional sense, I code a few lines, click save and then view the results in Chrome, when I am not happy, I flick back to VS, change it and continue again. So, it is true to say, I am not really debugging, just viewing. However, I stopped using IE a few years ago, and since I switched to Chrome, it is the first thing I install on new machines. With the exception of the MSDN site, it works perfect for me. *Slow Data Contexts* So can I assume that this slowness is simply to be accepted, it is either a) the way VS2008 usually performs, or b) the way VS2008 performs when data contexts are involved in a large project such as DNN. I did not notice any difference when I copied the code from the wwwroot folder, so I hope that is not part of the problem. *DNN Development* Probably I am not doing real DNN custom programming, but I am currently building web user controls, and simply saving them, and then creating a module for DNN and including the web user control on that module. I know this is not real DNN programming, but have created about 20 module so far like this. DNN gives me, as a script kiddie type programmer, they ability to do a simple web app, but it manages the users and authentication, something that I could never program. IOW, with the exception of a few DNN hooks, I am doing simple programming, but throwing the results into DNN. *Free Lunch* I have to say I agree with you, there are limitations everywhere. My appoach is always to keep it as simple as possible until I absolutely know that I need to make it more complex. Thanks, Mark <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 2 09:51:31 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 10:51:31 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> Message-ID: <4B168D03.3010706@colbyconsulting.com> Shamil, As I have discussed in the past, the business is doing the exact same process to many different tables. Because of the size of these tables and the processing involved I find it useful to store each table in it's own database. These are just lists of names, each list comes from a different source and is called something by the client, something that makes sense to him. These lists (a table) will always be millions of names / addresses, and often are 50 million or more. When you have 50 million names, the database, with just this one single table will be 10 or 20 gigabytes. Once you start processing it can mushroom to 50 gigabytes. Thus storing a dozen of these tables in a single database just doesn't make sense (to me). Thus I have a dozen different databases. I have to apply all of these stored procedures to each one of these databases once a month. Thus write the stored procedure such that I can pass in a database name and a table name. Voila, the SP works for all of my databases. But that means dynamic SQL. I really don't have an issue with dynamic SQL, although I have witnessed first hand the time required for SQL Server to do the "compile" - creating the execution plan. If I run the SP a second time with the same db and table name the time to execute drops sharply. BTW, these lists become the source for "orders" of names. Each of these orders also are stored in its own database, and I have to execute these same (or similar) SPs against each of these orders. Over the last 4 years I have perhaps a hundred of these order databases. This is what I do for this client, create these databases, and apply processes against these databases. The processes are exactly the same across all of the databases, thus having a stored procedure that performs some part of that process but can be applied to any of these databases makes sense (to me). I have spent the last five years performing these processes entirely manually, then one by one creating a stored procedure to automate one of the steps, then the next step, and the next. By now I have an entire master library with (let me go check) 42 different stored procedures that, taken together, automate my work for the client. THAT is the point of the C# side of things. Automating the automation so to speak. Taking these 42 stored procedures and stringing sets of them together, 7 which perform the output of data to an external program for processing, 6 more that get the processed data back in, a half dozen more that perform some other processing, another set that do order processing, etc. This is not a bank, or a company or a call center or a manufacturer, or any of the other "typical" SQL Server databases. It is name / address list processing and creating orders from these lists. Really pretty simple but extremely painstaking. And like anything else we do, I can't be making mistakes, it must be done in a specific manner, a specific sequence, EVERY time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > I must say I have never done that "dynamic" t-SQL via C# - I guess it should > be doable: using SMO or even SqlCommand's .ExecuteNonQuery(?) it should be > possible to create SPs and UDFs, and then execute them as usual... > > BTW, UDFs, which return tables are very often a good substitute for all > kinds of temp tables and dynamic SQL... > > I wonder what for all that "dynamism" there? > Do you have constantly changing database structure? > Do you have constantly changing customer requests, which do not allow you to > create a set of stable parameterized SPs and UDFs, and for small(?) changing > part of queries use LINQ for SQL or ADO.NET EF? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 02, 2009 1:54 AM > To: VBA > Subject: [dba-VB] C# - Direct data manipulation > > As previously mentioned, over the last couple of years I have built up a set > of stored procedures > which perform TSQL. I then run sets of these stored procedures to perform > processes. The TSQL is > always dynamic. > > As an example a stored procedure might build a table, with boilerplate field > names and data types, > but a passed in database and table name. Inside of the stored procedure I > build up the correct SQL > to create the table in the database specified, with the name specified. > Another stored procedure > might create in index, with boilerplate field names, but a passed in > database and table name. Again > the stored procedure builds up the TSQL statement to create the index in the > correct db and table. > > I already have these stored procedures debugged and working and have been > using them in sets to > perform "big picture processes" for quite some time, but the whole "execute > a stored procedure" > using a command object, parameter objects in a parameter array, interpreting > the parameters etc just > seems so... 1950s. I feel like I am flipping switches on the front panel of > a computer in a 50s > sci-fi movie as a tape reel spins madly in the background. > > Now that I am moving to C# I am wondering if this is required any more. Can > C# execute TSQL > directly somehow? Can I assemble this boiler plate plus database / table > kind of thing into a TSQL > statement directly in C# and then somehow tell SQL Server to execute that > TSQL? I understand the > "SQL optimization" thing but it seems like (not sure here) that because the > TSQL is dynamically > constructed in the stored procedure, the whole "optimization" thing goes > right out the window. If I > can execute TSQL directly from C#, what can I get back? Rows affected? > Error codes? And how? > > As it stands I am happily flipping switches, tape reels whirring, exporting > data for address > validation. This is good, I am happy, but ... > From paul.hartland at googlemail.com Wed Dec 2 10:05:20 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Wed, 2 Dec 2009 16:05:20 +0000 Subject: [dba-VB] Read XML File Using xsd Schema File Message-ID: <38c884770912020805s570c99e1ia753bf4f81b4d0f7@mail.gmail.com> To all, We have been a given what looks to me like a fairly complex XML file, we have also been given a xsd schema file. I tried using the SQLXMLBulkLoad object in VB6 and was getting the error Schema: relationship expected on 'Company'. The company that gave us both the files insist that the xsd is correct (according to my project manager). I downloaded and installed Stylus Studio 2010, with which I loaded the XML, and then generated my own xsd schame file. Tried again and this time get the same error as above, but instead of 'Company' the error was 'Groups' The VB6 code I am using is as follows: Dim objBL Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1" objBL.KeepIdentity = True objBL.errorlogfile = "C:\XML_StylusStudio\Error.log" objBL.checkconstraints = True objBL.xmlfragment = True objBL.schemagen = True objBL.sgdroptables = True objBL.Execute "C:\XML_StylusStudio\newschema.xsd", "C:\XML_StylusStudio\CDFull_Original.xml" Set objBl=Nothing The object of the exercise being that we generate related tables in SQL Server 2005 of the XML data. Would be grateful if anyone could help with this (would be happy to send example XML file and the schema offline), as I haven't got much hair left to pull out. Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From shamil at smsconsulting.spb.ru Wed Dec 2 11:23:04 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 20:23:04 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B168D03.3010706@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> Message-ID: <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> Hi John -- Thank you for your reply. Do you use your different databases for data input, or you also have to update those different databases' tables? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 6:52 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, As I have discussed in the past, the business is doing the exact same process to many different tables. Because of the size of these tables and the processing involved I find it useful to store each table in it's own database. These are just lists of names, each list comes from a different source and is called something by the client, something that makes sense to him. These lists (a table) will always be millions of names / addresses, and often are 50 million or more. When you have 50 million names, the database, with just this one single table will be 10 or 20 gigabytes. Once you start processing it can mushroom to 50 gigabytes. Thus storing a dozen of these tables in a single database just doesn't make sense (to me). Thus I have a dozen different databases. I have to apply all of these stored procedures to each one of these databases once a month. Thus write the stored procedure such that I can pass in a database name and a table name. Voila, the SP works for all of my databases. But that means dynamic SQL. I really don't have an issue with dynamic SQL, although I have witnessed first hand the time required for SQL Server to do the "compile" - creating the execution plan. If I run the SP a second time with the same db and table name the time to execute drops sharply. BTW, these lists become the source for "orders" of names. Each of these orders also are stored in its own database, and I have to execute these same (or similar) SPs against each of these orders. Over the last 4 years I have perhaps a hundred of these order databases. This is what I do for this client, create these databases, and apply processes against these databases. The processes are exactly the same across all of the databases, thus having a stored procedure that performs some part of that process but can be applied to any of these databases makes sense (to me). I have spent the last five years performing these processes entirely manually, then one by one creating a stored procedure to automate one of the steps, then the next step, and the next. By now I have an entire master library with (let me go check) 42 different stored procedures that, taken together, automate my work for the client. THAT is the point of the C# side of things. Automating the automation so to speak. Taking these 42 stored procedures and stringing sets of them together, 7 which perform the output of data to an external program for processing, 6 more that get the processed data back in, a half dozen more that perform some other processing, another set that do order processing, etc. This is not a bank, or a company or a call center or a manufacturer, or any of the other "typical" SQL Server databases. It is name / address list processing and creating orders from these lists. Really pretty simple but extremely painstaking. And like anything else we do, I can't be making mistakes, it must be done in a specific manner, a specific sequence, EVERY time. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 11:27:33 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 18:27:33 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John et al Don't forget LINQPad. Why LINQ beats SQL: http://www.linqpad.net/WhyLINQBeatsSQL.aspx /gustav >>> Gustav at cactus.dk 02-12-2009 08:19 >>> Hi John As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. /gustav >>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 2 12:34:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 13:34:54 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> Message-ID: <4B16B34E.8050702@colbyconsulting.com> Shamil, I receive lists of names in CSV or fixed width files. I import those into SQL Server, creating a PKID in the process. I then have to export the PKID plus the name / address monthly for address validation. Once validated, I have to import the data back in. This is the monthly process. Approximately 1% of all the people on any given list move each month. So I have to go back in to the original list and update 1% of the addresses, or simply swap out the new list (table) for the old. There is never any manual processing of individual names inside of these lists, IOW people never look at them, modify them, add new ones, delete address or anything like that. The list is "stable" in that regard. These lists become the source for orders of names. Orders are a whole 'nother process, but also use SPs to do their thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your reply. > > Do you use your different databases for data input, or you also have to > update those different databases' tables? > > -- > Shamil From jwcolby at colbyconsulting.com Wed Dec 2 12:46:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 13:46:09 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B16B5F1.4040003@colbyconsulting.com> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav > > >>>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> > As previously mentioned, over the last couple of years I have built up a set of stored procedures > which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is > always dynamic. > > As an example a stored procedure might build a table, with boilerplate field names and data types, > but a passed in database and table name. Inside of the stored procedure I build up the correct SQL > to create the table in the database specified, with the name specified. Another stored procedure > might create in index, with boilerplate field names, but a passed in database and table name. Again > the stored procedure builds up the TSQL statement to create the index in the correct db and table. > > I already have these stored procedures debugged and working and have been using them in sets to > perform "big picture processes" for quite some time, but the whole "execute a stored procedure" > using a command object, parameter objects in a parameter array, interpreting the parameters etc just > seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s > sci-fi movie as a tape reel spins madly in the background. > > Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL > directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL > statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the > "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically > constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I > can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? > > As it stands I am happily flipping switches, tape reels whirring, exporting data for address > validation. This is good, I am happy, but ... > From shamil at smsconsulting.spb.ru Wed Dec 2 13:19:29 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 22:19:29 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B16B34E.8050702@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> Message-ID: <00d501ca7384$600b48b0$2021da10$@spb.ru> John -- Have you tried to use MS SQL database filegroups and partitioned tables & views? http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx With them I suppose only initial import/insert of data have to be parameterized with table name, and the rest can be done without any dynamic T-SQL. Please correct me if I'm wrong. Please note I'm not trying to "force" you to change your current working solution - just wondering is there a legal way to solve your task without dynamic T-SQL... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 9:35 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, I receive lists of names in CSV or fixed width files. I import those into SQL Server, creating a PKID in the process. I then have to export the PKID plus the name / address monthly for address validation. Once validated, I have to import the data back in. This is the monthly process. Approximately 1% of all the people on any given list move each month. So I have to go back in to the original list and update 1% of the addresses, or simply swap out the new list (table) for the old. There is never any manual processing of individual names inside of these lists, IOW people never look at them, modify them, add new ones, delete address or anything like that. The list is "stable" in that regard. These lists become the source for orders of names. Orders are a whole 'nother process, but also use SPs to do their thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your reply. > > Do you use your different databases for data input, or you also have to > update those different databases' tables? > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 2 13:32:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 14:32:10 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <00d501ca7384$600b48b0$2021da10$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> <00d501ca7384$600b48b0$2021da10$@spb.ru> Message-ID: <4B16C0BA.7010601@colbyconsulting.com> Shamil, I have not. All of that is rather esoteric stuff for a non DBA. My job is processing data, and that is only a small part of my job, i.e. this is only one of many clients, and the only one that needs this kind of SQL Server stuff. As I have said many times, if my job was to go into a company every day and play DBA then I would learn many more things SQL Server related. As things stand I learn just enough to make things work, and a LITTLE extra in search of efficiency. It is certainly not that I don't want to, I just don't have the time. In the end I find the method I use comfortable from many angles. I have to do some things that require creating views, other "processing" tables and so forth. It really just works (for me) to do things this way, have separate databases to hold all of the "junk" associated with each list. Kind of the old "encapsulation" thing. Your suggestion would of course end up with all tables inside of a single "database", and as such the need for the Database parameter would go away but I still have to do the same thing to many different tables. Again, could this be done by one of the experts on the SQL Server list. Probably! Will I ever get there? Uhhhh doubtful. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > John -- > > Have you tried to use MS SQL database filegroups and partitioned tables & > views? > > http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx > > With them I suppose only initial import/insert of data have to be > parameterized with table name, and the rest can be done without any dynamic > T-SQL. Please correct me if I'm wrong. > > Please note I'm not trying to "force" you to change your current working > solution - just wondering is there a legal way to solve your task without > dynamic T-SQL... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 02, 2009 9:35 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# - Direct data manipulation > > Shamil, > From dbdoug at gmail.com Wed Dec 2 19:27:15 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 2 Dec 2009 17:27:15 -0800 Subject: [dba-VB] NorthwindNet time summary Message-ID: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> I believe that some time after the NorthwindNet project was finished, someone (Shamil?) posted an email with a summary of the time taken/number of forms/number of reports, etc. But I can't find it in my archives. I'm having a (friendly so far) discussion with a client who has given me an extremely ambitious schedule for converting a big Access project to C# ASP.NET, and I'd like some ammunition for my side of the argument! Thanks, Doug Steele From dwaters at usinternet.com Wed Dec 2 19:34:28 2009 From: dwaters at usinternet.com (Dan Waters) Date: Wed, 2 Dec 2009 19:34:28 -0600 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> Message-ID: Hi Doug, I used this site as well in making a quote to convert an Access System to a VB System. http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 Good Luck! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, December 02, 2009 7:27 PM To: dba-vb Subject: [dba-VB] NorthwindNet time summary I believe that some time after the NorthwindNet project was finished, someone (Shamil?) posted an email with a summary of the time taken/number of forms/number of reports, etc. But I can't find it in my archives. I'm having a (friendly so far) discussion with a client who has given me an extremely ambitious schedule for converting a big Access project to C# ASP.NET, and I'd like some ammunition for my side of the argument! Thanks, Doug Steele _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dbdoug at gmail.com Wed Dec 2 20:57:03 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 2 Dec 2009 18:57:03 -0800 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> Message-ID: <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> Perfect! Thanks, Dan. Doug On Wed, Dec 2, 2009 at 5:34 PM, Dan Waters wrote: > Hi Doug, > > I used this site as well in making a quote to convert an Access System to a > VB System. > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > Good Luck! > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, December 02, 2009 7:27 PM > To: dba-vb > Subject: [dba-VB] NorthwindNet time summary > > I believe that some time after the NorthwindNet project was finished, > someone (Shamil?) posted an email with a summary of the time taken/number > of > forms/number of reports, etc. But I can't find it in my archives. > > I'm having a (friendly so far) discussion with a client who has given me an > extremely ambitious schedule for converting a big Access project to C# > ASP.NET, and I'd like some ammunition for my side of the argument! > > Thanks, > > Doug Steele > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Thu Dec 3 05:29:49 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 14:29:49 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B16C0BA.7010601@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> <00d501ca7384$600b48b0$2021da10$@spb.ru> <4B16C0BA.7010601@colbyconsulting.com> Message-ID: <00f601ca740b$ee013800$ca03a800$@spb.ru> Hi John -- OK. Don't break it with implementation of other approaches if it works... Just for the future projects - I suppose (I might be missing something as I do not have that experience but I plan to try, maybe within our Northwind.NET project) this partitioning stuff is just practical for the tasks as you do (similar stuff was available for non-relational DBMSs in the end of 70-es/beginning of 80ies, and for Oracle it's available for years now AFAIHH), and this stuff doesn't take that much time to learn (one day?) and use (a few short reusable T-SQL scripts?) that it would take to program and to test and to support dynamic T-SQ: for many SPs and UDFs... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 10:32 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, I have not. All of that is rather esoteric stuff for a non DBA. My job is processing data, and that is only a small part of my job, i.e. this is only one of many clients, and the only one that needs this kind of SQL Server stuff. As I have said many times, if my job was to go into a company every day and play DBA then I would learn many more things SQL Server related. As things stand I learn just enough to make things work, and a LITTLE extra in search of efficiency. It is certainly not that I don't want to, I just don't have the time. In the end I find the method I use comfortable from many angles. I have to do some things that require creating views, other "processing" tables and so forth. It really just works (for me) to do things this way, have separate databases to hold all of the "junk" associated with each list. Kind of the old "encapsulation" thing. Your suggestion would of course end up with all tables inside of a single "database", and as such the need for the Database parameter would go away but I still have to do the same thing to many different tables. Again, could this be done by one of the experts on the SQL Server list. Probably! Will I ever get there? Uhhhh doubtful. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4656 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Thu Dec 3 05:29:49 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 14:29:49 +0300 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> Message-ID: <00f701ca740b$ef56b5e0$ce0421a0$@spb.ru> Hi Dan and Doug, If that stats will help you to quote and to plan your projects, please write a short note to be posted there (myself or Gustav can post it) http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 This project is currently in suspended state, and good feedback might help to plan and to implement some useful follow-ups. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Thursday, December 03, 2009 5:57 AM To: dwaters; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] NorthwindNet time summary Perfect! Thanks, Dan. Doug On Wed, Dec 2, 2009 at 5:34 PM, Dan Waters wrote: > Hi Doug, > > I used this site as well in making a quote to convert an Access System to a > VB System. > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > Good Luck! > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, December 02, 2009 7:27 PM > To: dba-vb > Subject: [dba-VB] NorthwindNet time summary > > I believe that some time after the NorthwindNet project was finished, > someone (Shamil?) posted an email with a summary of the time taken/number > of > forms/number of reports, etc. But I can't find it in my archives. > > I'm having a (friendly so far) discussion with a client who has given me an > extremely ambitious schedule for converting a big Access project to C# > ASP.NET, and I'd like some ammunition for my side of the argument! > > Thanks, > > Doug Steele __________ Information from ESET NOD32 Antivirus, version of virus signature database 4656 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Thu Dec 3 06:08:57 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 15:08:57 +0300 Subject: [dba-VB] C# 4.0: ExpandoObject, dynamic ... Message-ID: <00fa01ca7411$65b61be0$312253a0$@spb.ru> Hi All, Here is information on C# 4.0: ExpandoObject, dynamic etc. - you can see here why all that stuff is more powerful and useful than VB6/VBA late binding... http://blogs.msdn.com/csharpfaq/archive/2009/10/01/dynamic-in-c-4-0-introduc ing-the-expandoobject.aspx http://blogs.msdn.com/csharpfaq/archive/2009/10/19/dynamic-in-c-4-0-creating -wrappers-with-dynamicobject.aspx Thank you. -- Shamil From marklbreen at gmail.com Thu Dec 3 08:34:16 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 3 Dec 2009 14:34:16 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Message-ID: Hello Shamil, In VS2008, when I create a folder in app_Code, and then create a new Linq to SQL Class is it assigned the extention of dbml, default name is DataClasses.dbml It is these classes that are sooo slooow to do anything with. I timed the time it takes to just click create, drop a table onto the design surface, and then click save. It is taking 4 minutes to do that, so when I needed 20 - 25 objects or so, I have to sit like a donkey and click for almost two hours. It still takes four minutes to open and edit one. A PITA for sure. If I open the class as a standalone file, I can operate with instant performance, but it does not play well with the project/ solution. I have to say, I wish I knew more about these data classes and how they really should be used in real world applications. Thanks Mark 2009/12/2 Shamil Salakhetdinov > Hi Mark, > > <<< > *Slow Data Contexts* > >>> > What do you mean by that? - editing and saving your DNN Data Context > Objects > source code in \AppCode subfolder? > What do you mean by "Dbml"? > > <<< > but have created about 20 module so far > like this. > >>> > OK, I have also made 30+ DNN5.x custom modules properly packed etc. - all > very similar to each other but to get the first one was a time-consuming > issue. "Tired" from that. Need a break. Then I maybe will make some more... > > Thank you. > > -- > Shamil > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Wednesday, December 02, 2009 4:39 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello Shamil, > > Thank you for your detailed response. > > *Browsers* > Some comments, I am actually using Chrome to View my work, but I am not > doing any debugging, in the traditional sense, I code a few lines, click > save and then view the results in Chrome, when I am not happy, I flick back > to VS, change it and continue again. So, it is true to say, I am not > really > debugging, just viewing. However, I stopped using IE a few years ago, and > since I switched to Chrome, it is the first thing I install on new > machines. > With the exception of the MSDN site, it works perfect for me. > > > *Slow Data Contexts* > So can I assume that this slowness is simply to be accepted, it is either > a) > the way VS2008 usually performs, or b) the way VS2008 performs when data > contexts are involved in a large project such as DNN. I did not notice any > difference when I copied the code from the wwwroot folder, so I hope that > is > not part of the problem. > > *DNN Development* > Probably I am not doing real DNN custom programming, but I am currently > building web user controls, and simply saving them, and then creating a > module for DNN and including the web user control on that module. I know > this is not real DNN programming, but have created about 20 module so far > like this. DNN gives me, as a script kiddie type programmer, they ability > to do a simple web app, but it manages the users and authentication, > something that I could never program. > > IOW, with the exception of a few DNN hooks, I am doing simple programming, > but throwing the results into DNN. > > > *Free Lunch* > I have to say I agree with you, there are limitations everywhere. My > appoach is always to keep it as simple as possible until I absolutely know > that I need to make it more complex. > > > > Thanks, > > Mark > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Thu Dec 3 09:08:28 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 18:08:28 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Message-ID: <012201ca742a$79c0d710$6d428530$@spb.ru> Hello Mark -- OK, I suppose you can create custom DLL(s) working with LINQ to SQL in a solution outside of your custom DNN solution, and then just use your custom DLL within custom DNN solution - your LINQ to SQL objects from DLL should be public and this DLL should also have its own config file... I have done something like that but with POCO-objects (http://en.wikipedia.org/wiki/Plain_Old_CLR_Object), which I used as ObjectDataSources for web forms within DNN custom solutions' custom modules... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Thursday, December 03, 2009 5:34 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow Hello Shamil, In VS2008, when I create a folder in app_Code, and then create a new Linq to SQL Class is it assigned the extention of dbml, default name is DataClasses.dbml It is these classes that are sooo slooow to do anything with. I timed the time it takes to just click create, drop a table onto the design surface, and then click save. It is taking 4 minutes to do that, so when I needed 20 - 25 objects or so, I have to sit like a donkey and click for almost two hours. It still takes four minutes to open and edit one. A PITA for sure. If I open the class as a standalone file, I can operate with instant performance, but it does not play well with the project/ solution. I have to say, I wish I knew more about these data classes and how they really should be used in real world applications. Thanks Mark <<< snip>>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4658 (20091203) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From marklbreen at gmail.com Thu Dec 3 16:01:58 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 3 Dec 2009 22:01:58 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <012201ca742a$79c0d710$6d428530$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> <012201ca742a$79c0d710$6d428530$@spb.ru> Message-ID: Hello Shamil, I guess this is an option for me, but to be honest, it will probably more easier for me to take the delay of waiting that attempt to manage the additional layer of complexity. As with all things in life, I suppose if I take the time to review this, it will save me time, but I am afraid to spend a day on it only to save myself a few minutes a few times a day. Thanks any way for the suggestion, Mark 2009/12/3 Shamil Salakhetdinov > Hello Mark -- > > OK, I suppose you can create custom DLL(s) working with LINQ to SQL in a > solution outside of your custom DNN solution, and then just use your custom > DLL within custom DNN solution - your LINQ to SQL objects from DLL should > be > public and this DLL should also have its own config file... > > I have done something like that but with POCO-objects > (http://en.wikipedia.org/wiki/Plain_Old_CLR_Object), which I used as > ObjectDataSources for web forms within DNN custom solutions' custom > modules... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, December 03, 2009 5:34 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello Shamil, > > In VS2008, when I create a folder in app_Code, and then create a new Linq > to > SQL Class is it assigned the extention of dbml, default name is > DataClasses.dbml > > It is these classes that are sooo slooow to do anything with. I timed the > time it takes to just click create, drop a table onto the design surface, > and then click save. It is taking 4 minutes to do that, so when I needed > 20 > - 25 objects or so, I have to sit like a donkey and click for almost two > hours. > > It still takes four minutes to open and edit one. > > A PITA for sure. > > If I open the class as a standalone file, I can operate with > instant performance, but it does not play well with the project/ solution. > > I have to say, I wish I knew more about these data classes and how they > really should be used in real world applications. > > Thanks > > Mark > > > <<< snip>>> > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4658 (20091203) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Dec 3 17:38:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 03 Dec 2009 18:38:39 -0500 Subject: [dba-VB] Application settings Message-ID: <4B184BFF.6040203@colbyconsulting.com> I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Thu Dec 3 18:07:23 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 4 Dec 2009 11:07:23 +1100 Subject: [dba-VB] Application settings References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> Hi John, Is this what your after? global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting = "New Value"; global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); cheers Michael M I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From cfoust at infostatsystems.com Thu Dec 3 18:26:56 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 3 Dec 2009 18:26:56 -0600 Subject: [dba-VB] Application settings In-Reply-To: <4B184BFF.6040203@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: - - 0 Microsoft.Jet.OLEDB.4.0 C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb RIMUser false - 1 sqloledb infoserver RIMDrillDataSQL true We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. Shared ds As DataSet Shared _connectionString As String Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath Private Shared Sub ReadSettingsFile() If IO.File.Exists(_xmlPath) Then Call CreateSchema() ds.ReadXml(_xmlPath) Call DecryptPassword() _connectionString = GetConnectionString() Else If ds.Tables(0).Rows.Count = 0 Then 'placeholder for jet settings Dim row As DataRow = ds.Tables(0).NewRow row("dbtype") = 0 row("provider") = "Microsoft.Jet.OLEDB.4.0" ds.Tables(0).Rows.Add(row) 'placeholder for sql settings row = ds.Tables(0).NewRow row("dbtype") = 1 row("provider") = "sqloledb" ds.Tables(0).Rows.Add(row) End If End If End Sub Private Shared Sub CreateSchema() ds = New DataSet Dim table As New DataTable("connection") table.Columns.Add("dbtype", GetType(Integer)) table.Columns.Add("provider", GetType(String)) table.Columns.Add("datasource", GetType(String)) table.Columns.Add("userid", GetType(String)) table.Columns.Add("password", GetType(String)) table.Columns.Add("initialcatalog", GetType(String)) table.Columns.Add("trusted", GetType(Boolean)) table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} ds.Tables.Add(table) End Sub Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 03, 2009 3:39 PM To: VBA Subject: [dba-VB] Application settings I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Thu Dec 3 18:43:32 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 4 Dec 2009 11:43:32 +1100 Subject: [dba-VB] Application settings References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827EA@ddi-01.DDI.local> Hi Charlotte, I see this as useful, but, If you need a complex setting structure why not just create a 'MySettings' class and serialise or deserialise it as needed? I think John has already worked with the Serializable attribute. Am I missing something? Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, 4 December 2009 11:27 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: - - 0 Microsoft.Jet.OLEDB.4.0 C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb RIMUser false - 1 sqloledb infoserver RIMDrillDataSQL true We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. Shared ds As DataSet Shared _connectionString As String Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath Private Shared Sub ReadSettingsFile() If IO.File.Exists(_xmlPath) Then Call CreateSchema() ds.ReadXml(_xmlPath) Call DecryptPassword() _connectionString = GetConnectionString() Else If ds.Tables(0).Rows.Count = 0 Then 'placeholder for jet settings Dim row As DataRow = ds.Tables(0).NewRow row("dbtype") = 0 row("provider") = "Microsoft.Jet.OLEDB.4.0" ds.Tables(0).Rows.Add(row) 'placeholder for sql settings row = ds.Tables(0).NewRow row("dbtype") = 1 row("provider") = "sqloledb" ds.Tables(0).Rows.Add(row) End If End If End Sub Private Shared Sub CreateSchema() ds = New DataSet Dim table As New DataTable("connection") table.Columns.Add("dbtype", GetType(Integer)) table.Columns.Add("provider", GetType(String)) table.Columns.Add("datasource", GetType(String)) table.Columns.Add("userid", GetType(String)) table.Columns.Add("password", GetType(String)) table.Columns.Add("initialcatalog", GetType(String)) table.Columns.Add("trusted", GetType(Boolean)) table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} ds.Tables.Add(table) End Sub Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 03, 2009 3:39 PM To: VBA Subject: [dba-VB] Application settings I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From Gustav at cactus.dk Fri Dec 4 02:48:35 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 09:48:35 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John Yes and no. I used an old version for some time but the current version is more powerful. Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. /gustav >>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav From Gustav at cactus.dk Fri Dec 4 04:08:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 11:08:03 +0100 Subject: [dba-VB] LINQ example (was: C# - Direct data manipulation) Message-ID: Hi John et all Further to the notes below on Joseph Albahari's LINQPad, it contains a link to download all the example code from "LINQ in Action". Also, it has a link to this amazing demo of the power of LINQ: http://blogs.msdn.com/lukeh/archive/2007/03/19/using-linq-to-solve-puzzles.aspx It's a true eye-opener and a good example showing that the scope of LINQ is much wider than "normal" database querying. The code is included in LINQPad when downloaded, ready for you to play with at: Tab Samples, C# 3.0 in a Nutshell, Chapter 9 - LINQ Operators, Joining, Extra - Weights Puzzle. It's Friday and soon weekend! /gustav >>> Gustav at cactus.dk 04-12-2009 09:48 >>> Hi John Yes and no. I used an old version for some time but the current version is more powerful. Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. /gustav >>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 05:53:41 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 06:53:41 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B18F845.1090500@colbyconsulting.com> I really meant do you use linq in your C# apps? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes and no. I used an old version for some time but the current version is more powerful. > > Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. > > /gustav > >>>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> > Do you use it? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John et al >> >> Don't forget LINQPad. >> >> Why LINQ beats SQL: >> http://www.linqpad.net/WhyLINQBeatsSQL.aspx >> >> /gustav >> >> >>>>> Gustav at cactus.dk 02-12-2009 08:19 >>> >> Hi John >> >> As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. >> >> ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. >> >> /gustav > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From paul.hartland at googlemail.com Fri Dec 4 05:59:23 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 4 Dec 2009 11:59:23 +0000 Subject: [dba-VB] Test Message-ID: <38c884770912040359r58db94e3w44b86c077590457d@mail.gmail.com> Please delete as test email, sent question about XML problem about two days ago, and haven't seen it appear. -- Paul Hartland paul.hartland at googlemail.com From paul.hartland at googlemail.com Fri Dec 4 06:19:01 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 4 Dec 2009 12:19:01 +0000 Subject: [dba-VB] Read XML File Using xsd Schema File Message-ID: <38c884770912040419xdc61c66y2c315b820cd6fb09@mail.gmail.com> To all, We have been a given what looks to me like a fairly complex XML file, we have also been given a xsd schema file. I tried using the SQLXMLBulkLoad object in VB6 and was getting the error Schema: relationship expected on 'Company'. The company that gave us both the files insist that the xsd is correct (according to my project manager). I downloaded and installed Stylus Studio 2010, with which I loaded the XML, and then generated my own xsd schame file. Tried again and this time get the same error as above, but instead of 'Company' the error was 'Groups' The VB6 code I am using is as follows: Dim objBL Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1" objBL.KeepIdentity = True objBL.errorlogfile = "C:\XML_StylusStudio\Error.log" objBL.checkconstraints = True objBL.xmlfragment = True objBL.schemagen = True objBL.sgdroptables = True objBL.Execute "C:\XML_StylusStudio\newschema.xsd", "C:\XML_StylusStudio\CDFull_Original.xml" Set objBl=Nothing The object of the exercise being that we generate related tables in SQL Server 2005 of the XML data. Would be grateful if anyone could help with this (would be happy to send example XML file and the schema offline), as I haven't got much hair left to pull out. Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From Gustav at cactus.dk Fri Dec 4 06:33:36 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 13:33:36 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John Oh, I misunderstood you. Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 12:53 >>> I really meant do you use linq in your C# apps? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes and no. I used an old version for some time but the current version is more powerful. > > Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. > > /gustav > >>>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> > Do you use it? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John et al >> >> Don't forget LINQPad. >> >> Why LINQ beats SQL: >> http://www.linqpad.net/WhyLINQBeatsSQL.aspx >> >> /gustav >> >> >>>>> Gustav at cactus.dk 02-12-2009 08:19 >>> >> Hi John >> >> As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. >> >> ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. >> >> /gustav From jwcolby at colbyconsulting.com Fri Dec 4 07:54:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 08:54:21 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B19148D.9070607@colbyconsulting.com> >I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) I have to say that as a developer of a higher level language, I can see where avoiding TSQL would be something we would try to do. While I understand that SQL Server can be integrated into and used straight from the VS environment, most of us come at it from the built-in editor which frankly sucks. And I mean REALLY BADLY sucks, no apologies to our admin friends. I guess I have been doing SP development for a couple of years now and I still hate the built-in editor. And yet... that is what I use. IMHO this is an area where MS has fallen down on the job. If this integration thing is so darned simple, then MS should push education, seminars, books, education, education to get us working in VS to run (program) SQL Server. From a development perspective, and that is what SPs and UDF are after all, SQL Server should just be a tool used to manipulate data, NOT a dev environment. Over the last month I have found two APIs that allow C# to do a ton of stuff directly in SQL Server. WAY COOL stuff, but you would think it was porn the way you don't see it in the mainstream. These APIs allow you to manipulate SQL server the same way you can manipulate any other object - create, delete, observe, modify, manipulate anything in SQL Server - straight from VS. But where are the forums, the blogs, the developer excitement? It appears to me that there is a very real "here is your database" aimed at the developers who use SQL Server, and the admins just do things the way they always have for the last 20 years. And they buy tools from the RedGates of the world who undoubtedly do salivate over these new APIs. Just my humble opinion. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I misunderstood you. > Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 07:56:15 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 08:56:15 -0500 Subject: [dba-VB] Application settings In-Reply-To: References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <4B1914FF.1050705@colbyconsulting.com> Charlotte, My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: > > > - > - > 0 > Microsoft.Jet.OLEDB.4.0 > C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb > RIMUser > > > false > > - > 1 > sqloledb > infoserver > > > RIMDrillDataSQL > true > > > > We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. > > Shared ds As DataSet > Shared _connectionString As String > > Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath > > Private Shared Sub ReadSettingsFile() > If IO.File.Exists(_xmlPath) Then > Call CreateSchema() > ds.ReadXml(_xmlPath) > Call DecryptPassword() > _connectionString = GetConnectionString() > Else > If ds.Tables(0).Rows.Count = 0 Then > 'placeholder for jet settings > Dim row As DataRow = ds.Tables(0).NewRow > row("dbtype") = 0 > row("provider") = "Microsoft.Jet.OLEDB.4.0" > ds.Tables(0).Rows.Add(row) > > 'placeholder for sql settings > row = ds.Tables(0).NewRow > row("dbtype") = 1 > row("provider") = "sqloledb" > ds.Tables(0).Rows.Add(row) > End If > End If > End Sub > > Private Shared Sub CreateSchema() > ds = New DataSet > Dim table As New DataTable("connection") > table.Columns.Add("dbtype", GetType(Integer)) > table.Columns.Add("provider", GetType(String)) > table.Columns.Add("datasource", GetType(String)) > table.Columns.Add("userid", GetType(String)) > table.Columns.Add("password", GetType(String)) > table.Columns.Add("initialcatalog", GetType(String)) > table.Columns.Add("trusted", GetType(Boolean)) > table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} > > ds.Tables.Add(table) > End Sub > > Charlotte > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 03, 2009 3:39 PM > To: VBA > Subject: [dba-VB] Application settings > > I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Dec 4 08:17:12 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 15:17:12 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 14:54 >>> >I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) I have to say that as a developer of a higher level language, I can see where avoiding TSQL would be something we would try to do. While I understand that SQL Server can be integrated into and used straight from the VS environment, most of us come at it from the built-in editor which frankly sucks. And I mean REALLY BADLY sucks, no apologies to our admin friends. I guess I have been doing SP development for a couple of years now and I still hate the built-in editor. And yet... that is what I use. IMHO this is an area where MS has fallen down on the job. If this integration thing is so darned simple, then MS should push education, seminars, books, education, education to get us working in VS to run (program) SQL Server. From a development perspective, and that is what SPs and UDF are after all, SQL Server should just be a tool used to manipulate data, NOT a dev environment. Over the last month I have found two APIs that allow C# to do a ton of stuff directly in SQL Server. WAY COOL stuff, but you would think it was porn the way you don't see it in the mainstream. These APIs allow you to manipulate SQL server the same way you can manipulate any other object - create, delete, observe, modify, manipulate anything in SQL Server - straight from VS. But where are the forums, the blogs, the developer excitement? It appears to me that there is a very real "here is your database" aimed at the developers who use SQL Server, and the admins just do things the way they always have for the last 20 years. And they buy tools from the RedGates of the world who undoubtedly do salivate over these new APIs. Just my humble opinion. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I misunderstood you. > Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 08:43:46 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 09:43:46 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B192022.5080005@colbyconsulting.com> >they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. I actually think that is a good thing, developers who just use data shouldn't need to be learning SQL Server to get their data. That is really not the audience I am addressing however. IMHO the built-in editor of SQL Server should either be removed entirely or at least brought into the current century. It is notepad with pretty colors. How many millions of man hours have been wasted trying to track down errors when the only error message presented was "error near (insert some unrelated thing here)". Why bother even throwing up an error like that, and that is 99.9% of the errors I have EVER seen in two years working with SQL Server. Notepad, with pretty colors. For all of the rude comments us Access developers get about Access being "a toy", the code editor in Access is in a complete other galaxy from the code editor in SQL Server. SQL Server editor looks like it was designed in 1986 and never upgraded. Of course with the "real men don't use code editors" mentality of the DBA side of the fence I can see why MS doesn't bother spending time on this. Someday I really am going to have to figure out how to use VS to run / debug my SPs and stuff. To me VS just seems over-the-top complex for the level of stuff I am trying to do. An Access type of code editor would be just the right level of convenience and capability - built right into SSMS. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. > > /gustav From Gustav at cactus.dk Fri Dec 4 09:32:07 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 16:32:07 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John LINQPad does pure SQL too, though not with IntelliSense, and error messages seem to be those from SQL Server. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 15:43 >>> >they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. I actually think that is a good thing, developers who just use data shouldn't need to be learning SQL Server to get their data. That is really not the audience I am addressing however. IMHO the built-in editor of SQL Server should either be removed entirely or at least brought into the current century. It is notepad with pretty colors. How many millions of man hours have been wasted trying to track down errors when the only error message presented was "error near (insert some unrelated thing here)". Why bother even throwing up an error like that, and that is 99.9% of the errors I have EVER seen in two years working with SQL Server. Notepad, with pretty colors. For all of the rude comments us Access developers get about Access being "a toy", the code editor in Access is in a complete other galaxy from the code editor in SQL Server. SQL Server editor looks like it was designed in 1986 and never upgraded. Of course with the "real men don't use code editors" mentality of the DBA side of the fence I can see why MS doesn't bother spending time on this. Someday I really am going to have to figure out how to use VS to run / debug my SPs and stuff. To me VS just seems over-the-top complex for the level of stuff I am trying to do. An Access type of code editor would be just the right level of convenience and capability - built right into SSMS. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. > > /gustav From cfoust at infostatsystems.com Fri Dec 4 10:10:23 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 4 Dec 2009 10:10:23 -0600 Subject: [dba-VB] Application settings In-Reply-To: <4B1914FF.1050705@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> Message-ID: OK, then I don't understand the question. What do you mean about the settings "area" of the project? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 04, 2009 5:56 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Charlotte, My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: > > > - > - > 0 > Microsoft.Jet.OLEDB.4.0 > C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb > RIMUser > > > false > > - > 1 > sqloledb > infoserver > > > RIMDrillDataSQL > true > > > > We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. > > Shared ds As DataSet > Shared _connectionString As String > > Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath > > Private Shared Sub ReadSettingsFile() > If IO.File.Exists(_xmlPath) Then > Call CreateSchema() > ds.ReadXml(_xmlPath) > Call DecryptPassword() > _connectionString = GetConnectionString() > Else > If ds.Tables(0).Rows.Count = 0 Then > 'placeholder for jet settings > Dim row As DataRow = ds.Tables(0).NewRow > row("dbtype") = 0 > row("provider") = "Microsoft.Jet.OLEDB.4.0" > ds.Tables(0).Rows.Add(row) > > 'placeholder for sql settings > row = ds.Tables(0).NewRow > row("dbtype") = 1 > row("provider") = "sqloledb" > ds.Tables(0).Rows.Add(row) > End If > End If > End Sub > > Private Shared Sub CreateSchema() > ds = New DataSet > Dim table As New DataTable("connection") > table.Columns.Add("dbtype", GetType(Integer)) > table.Columns.Add("provider", GetType(String)) > table.Columns.Add("datasource", GetType(String)) > table.Columns.Add("userid", GetType(String)) > table.Columns.Add("password", GetType(String)) > table.Columns.Add("initialcatalog", GetType(String)) > table.Columns.Add("trusted", GetType(Boolean)) > table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} > > ds.Tables.Add(table) > End Sub > > Charlotte > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 03, 2009 3:39 PM > To: VBA > Subject: [dba-VB] Application settings > > I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ From jwcolby at colbyconsulting.com Fri Dec 4 10:33:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 11:33:52 -0500 Subject: [dba-VB] Application settings In-Reply-To: References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> Message-ID: <4B1939F0.7020905@colbyconsulting.com> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > OK, then I don't understand the question. What do you mean about the settings "area" of the project? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 04, 2009 5:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Application settings > > Charlotte, > > My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. > > John W. Colby > www.ColbyConsulting.com > From shamil at smsconsulting.spb.ru Fri Dec 4 10:46:41 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 4 Dec 2009 19:46:41 +0300 Subject: [dba-VB] Application settings In-Reply-To: <4B1939F0.7020905@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> <4B1939F0.7020905@colbyconsulting.com> Message-ID: <01b001ca7501$5c9e3650$15daa2f0$@spb.ru> Hi John, You can access those properties using: Properties.Settings.Default.{{PropertyName}} Or {{Root Namespace}}.Properties.Settings.Default.{{PropertyName}} -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 04, 2009 7:34 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 11:24:46 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 18:24:46 +0100 Subject: [dba-VB] Application settings Message-ID: Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6-66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > OK, then I don't understand the question. What do you mean about the settings "area" of the project? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 04, 2009 5:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Application settings > > Charlotte, > > My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. > > John W. Colby > www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 4 12:30:32 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 13:30:32 -0500 Subject: [dba-VB] Code Search Message-ID: <4B195548.4030300@colbyconsulting.com> Has anyone noticed this on Google? http://www.google.com/codesearch?hl=en Anyone using it? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 4 14:33:00 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 4 Dec 2009 23:33:00 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 15:39:43 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 22:39:43 +0100 Subject: [dba-VB] Application settings Message-ID: Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 21:33 >>> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 4 16:06:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 01:06:11 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01be01ca752d$ff4dfe40$fde9fac0$@spb.ru> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 21:33 >>> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 16:18:39 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 23:18:39 +0100 Subject: [dba-VB] Application settings Message-ID: Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 23:06 >>> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav From cfoust at infostatsystems.com Fri Dec 4 19:24:01 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 4 Dec 2009 19:24:01 -0600 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: That was my understanding as well, Gustav. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 2:19 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 23:06 >>> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Dec 5 07:03:33 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 16:03:33 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <01d001ca75ab$5adb7670$10926350$@spb.ru> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Sat Dec 5 07:03:33 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 16:03:33 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01d101ca75ab$5c18d870$144a8950$@spb.ru> Hi Gustav and all, JC original request was "to access/modify" application settings AFAIU: <<< I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. >>> -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 1:19 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Sat Dec 5 12:57:15 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sat, 05 Dec 2009 19:57:15 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Sat Dec 5 16:54:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 6 Dec 2009 01:54:50 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <01e001ca75fd$f4891280$dd9b3780$@spb.ru> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Sun Dec 6 09:04:00 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 06 Dec 2009 16:04:00 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From michael at ddisolutions.com.au Sun Dec 6 16:00:52 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 7 Dec 2009 09:00:52 +1100 Subject: [dba-VB] Code Search References: <4B195548.4030300@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827F2@ddi-01.DDI.local> Hi John, No and not yet! Cheers Michael M Has anyone noticed this on Google? http://www.google.com/codesearch?hl=en Anyone using it? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From michael at ddisolutions.com.au Sun Dec 6 16:03:36 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 7 Dec 2009 09:03:36 +1100 Subject: [dba-VB] Application settings - Test References: <4B184BFF.6040203@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Test reply, Am I getting through??? Or am I being ignored??? :-) Cheers Michael M Hi John, Is this what your after? global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting = "New Value"; global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); cheers Michael M I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 _______________________________________________ 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 - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From jwcolby at colbyconsulting.com Sun Dec 6 16:45:30 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 06 Dec 2009 17:45:30 -0500 Subject: [dba-VB] Application settings - Test In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> References: <4B184BFF.6040203@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Message-ID: <4B1C340A.7090004@colbyconsulting.com> LOL. We'd never ignore you! John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Test reply, > Am I getting through??? > Or am I being ignored??? :-) > > Cheers > > Michael M > > > Hi John, > > Is this what your after? > > > global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting > = "New Value"; > > global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); > > cheers > > Michael M > > I want to create application settings for things like the server > instance that the program will bang > on, the name of my database that I save my custom UDFs and SPs in etc. > It is trivial to get there > in the interface but Google is not my friend tonight in discovering how > to access / modify them > through code. > > Anybody? > From wdhindman at dejpolsystems.com Sun Dec 6 16:29:05 2009 From: wdhindman at dejpolsystems.com (William Hindman) Date: Sun, 6 Dec 2009 17:29:05 -0500 Subject: [dba-VB] Application settings - Test In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> References: <4B184BFF.6040203@colbyconsulting.com><59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Message-ID: <59B0F0614709418884DE2B4E1551B143@jislaptopdev> ...yes, but we're ignoring you ...its Sunday here, eh :) William -------------------------------------------------- From: "Michael Maddison" Sent: Sunday, December 06, 2009 5:03 PM To: "Discussion concerning Visual Basic and related programming issues." Subject: Re: [dba-VB] Application settings - Test > Test reply, > Am I getting through??? > Or am I being ignored??? :-) > > Cheers > > Michael M > > > Hi John, > > Is this what your after? > > > global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting > = "New Value"; > > global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); > > cheers > > Michael M > > I want to create application settings for things like the server > instance that the program will bang > on, the name of my database that I save my custom UDFs and SPs in etc. > It is trivial to get there > in the interface but Google is not my friend tonight in discovering how > to access / modify them > through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: > 12/04/09 06:36:00 > > _______________________________________________ > 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 - www.avg.com > Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: > 12/04/09 06:36:00 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Mon Dec 7 01:47:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 7 Dec 2009 10:47:50 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <021101ca7711$949ff220$bddfd660$@spb.ru> Hi Gustav -- Thank you. OK, March 22 - official release - so January 2010 MSDN might have it... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, December 06, 2009 6:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732- A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Mon Dec 7 01:53:42 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 07 Dec 2009 08:53:42 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil I cannot tell - and I don't have an MSDN subscription ... /gustav >>> shamil at smsconsulting.spb.ru 07-12-2009 08:47 >>> Hi Gustav -- Thank you. OK, March 22 - official release - so January 2010 MSDN might have it... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, December 06, 2009 6:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil From jwcolby at colbyconsulting.com Mon Dec 7 07:46:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 08:46:22 -0500 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <4B1D072E.6060008@colbyconsulting.com> I have to say... "Scott Guthrie" ... with a name like that he should have been a musician. John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 7 07:56:31 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 08:56:31 -0500 Subject: [dba-VB] Application settings In-Reply-To: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> References: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> Message-ID: <4B1D098F.30807@colbyconsulting.com> OK, I am trying to reference Properties.Settings.Default["ServerName"].ToString() and get the error 'System.Windows.Forms.PropertyStore' does not contain a definition for 'Settings' and no extension method 'Settings' accepting a first argument of type 'System.Windows.Forms.PropertyStore' could be found (are you missing a using directive or an assembly reference?) John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Gustav, > > You can set > > Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; > > and save settings having "User" scope: > > Properties.Settings.Default.Save(); > > And they are saved not in {{ApplicationExecutableFileName}}.config, which > you deliver with you app's executable but anywhere else on your system - > probably somewhere in user's Application Settings - standard windows folder. > I have never had time to find out where settings are saved. Anybody? > > Recap: > > - settings are loaded from {{ApplicationExecutableFileName}}.config when you > deliver you application, and it runs first time; > - as soon as you save "User" scope settings they are saved in and loaded > from {{UnknownPlace}}; > - if you move your application files into another folder on the same system > the settings are again loaded on first run from > {{ApplicationExecutableFileName}}; > - ... > > That looks confusing a bit but it's how it works... > > You can click "Learn more about application settings..." on top right of > VS2008 application settings window available by Solution Explorer -> Project > name -> Right-Click -> Settings... > > But if you wanted to have rather complicated structure of your application > settings file then better use your own custom XML files, which can be loaded > from/saved to files many ways without almost any coding... > > Thank you. > > -- > Shamil > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, December 04, 2009 8:25 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Application settings > > Hi John > > Shamil is right, but that method is for reading only. > Please note that the Properties' collection object is read-only, thus it > takes quite a few steps to add a property: > > http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- > 66be-44ce-8a65-ab548f6f4f04 > > I have not used this as I haven't had any need to add properties on the fly. > Reading and writing was fine for me, and new properties I added manually. > > You may find it much easier and perhaps more convenient to just have a > dataset which you read and write from/to an XML-file. I've posted code for > this before. > > /gustav > > >>>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> > Under the project is a properties object. Double click that and an entire > multi-tabbed dialog opens. > > Click the settings tab. There you will see a form where you can enter name, > type, scope, value. > > As far as I can tell this is a place where I (the developer) can create > settings that my program > will use and manipulate, settings (for example) to tell my program the name > of the SQL Server > instance to use in a connection string, the name of my control database > where I store my stored > procedures and UDFs. Stuff like that. Stuff that I am currently hard > coding, but which really > should be in a settings tab so that I don't have to remember where that > constant is in code, I can > just go to the settings tab to change. > > My expectation is that there is an object somewhere in the .net namespace > that allows you to do > something like "Something.Somethingelse.Settings["MyServerName"]...." to > access these things. > > I expect to be able to create new ones, edit existing ones, delete them etc > from a .Net object. I > am looking for that .Net syntax that allows me to do this from code. > > John W. Colby > www.ColbyConsulting.com > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4661 (20091204) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-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 Dec 7 08:03:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 09:03:10 -0500 Subject: [dba-VB] Application settings In-Reply-To: <01d101ca75ab$5c18d870$144a8950$@spb.ru> References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> Message-ID: <4B1D0B1E.1090109@colbyconsulting.com> OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Gustav and all, > > JC original request was "to access/modify" application settings AFAIU: > <<< > I want to create application settings for things like the server instance > that the program will bang on, the name of my database that I save my custom > UDFs and SPs in etc. It is trivial to get there in the interface but Google > is not my friend tonight in discovering how to access / modify them through > code. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Saturday, December 05, 2009 1:19 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Application settings > > Hi Shamil > > I guess I'm too busy today. I read it as JC wanted to create these on the > fly ... > > /gustav > > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4661 (20091204) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > 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 Dec 7 09:00:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 07 Dec 2009 16:00:02 +0100 Subject: [dba-VB] Application settings Message-ID: Hi John The file containing the settings is app.config. To hold "global" settings you could create a small project with just this file and reference it from any other project. /gustav >>> jwcolby at colbyconsulting.com 07-12-2009 15:03 >>> OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com From mmattys at rochester.rr.com Mon Dec 7 10:57:22 2009 From: mmattys at rochester.rr.com (Mike Mattys) Date: Mon, 7 Dec 2009 11:57:22 -0500 Subject: [dba-VB] Application settings References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> <4B1D0B1E.1090109@colbyconsulting.com> Message-ID: My understanding of Properties.Settings is that settings must be by User in order to be saved and the xml file will reside in the Local Setting/Applications directory under the user's My Documents folder. In that case, all projects under a solution could read a single xml file. We decided to use cryptographic services for the i/o of the xml by using an internal static class that reads/writes to a string collection using methods we created like bof, eof, movefirst, addnew, etc. - Michael R Mattys MapPoint and Database Dev www.mattysconsulting.com - ----- Original Message ----- From: "jwcolby" To: "Discussion concerning Visual Basic and related programming issues." Sent: Monday, December 07, 2009 9:03 AM Subject: Re: [dba-VB] Application settings > OK, it appears that each project has its own set of properties. If I set > the same property in the > current project's property set then > > Properties.Settings.Default["ServerName"].ToString() > > works just fine. > > But that is not the behavior I want. I need a SOLUTION property set, > which appears to not exist? > Which perhaps would explain why those who have done this before roll their > own? > > Does anyone have code to do this so I don't have to roll my own (a.k.a. > reinvent the wheel) too? > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: >> Hi Gustav and all, >> >> JC original request was "to access/modify" application settings AFAIU: >> <<< >> I want to create application settings for things like the server instance >> that the program will bang on, the name of my database that I save my >> custom >> UDFs and SPs in etc. It is trivial to get there in the interface but >> Google >> is not my friend tonight in discovering how to access / modify them >> through >> code. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Saturday, December 05, 2009 1:19 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] Application settings >> >> Hi Shamil >> >> I guess I'm too busy today. I read it as JC wanted to create these on the >> fly ... >> >> /gustav >> >> >> <<< snip >>> >> >> >> __________ Information from ESET NOD32 Antivirus, version of virus >> signature >> database 4661 (20091204) __________ >> >> The message was checked by ESET NOD32 Antivirus. >> >> http://www.esetnod32.ru >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From pharold at proftesting.com Mon Dec 7 11:18:37 2009 From: pharold at proftesting.com (Perry L Harold) Date: Mon, 7 Dec 2009 12:18:37 -0500 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: <4B1D072E.6060008@colbyconsulting.com> References: <4B1D072E.6060008@colbyconsulting.com> Message-ID: Maybe Arlo's brother? Perry -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 07, 2009 8:46 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Scott Guthrie in town I have to say... "Scott Guthrie" ... with a name like that he should have been a musician. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Dec 7 13:54:55 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 7 Dec 2009 22:54:55 +0300 Subject: [dba-VB] Application settings In-Reply-To: <4B1D0B1E.1090109@colbyconsulting.com> References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> <4B1D0B1E.1090109@colbyconsulting.com> Message-ID: <001b01ca7777$2741d5c0$75c58140$@spb.ru> Hi John -- For solution you can select one of the projects to be used to handle settings. That project is usually a core(utility/generic/settings) class library. Then if you wish you can additionally wrap Properties.Settings.Default... for every/most of the settings into your custom global (Solution scope) properties' wrappers. Such wrapping makes your referencing projects independent on actual implementation of handling of application settings. When that done and works OK you can go and "reinvent the wheel" if needed without any changes in referencing projects... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 07, 2009 5:03 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4668 (20091207) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Dec 8 01:55:00 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 8 Dec 2009 07:55:00 -0000 Subject: [dba-VB] OT: Thin SQL Client for Linux In-Reply-To: References: Message-ID: <4b1e0661.0f67f10a.205a.ffffd8ee@mx.google.com> OT: Thin SQL Client for Linux Can anybody find me a good THIN sql client for Linux I need to find one in the next day, I am stuck on an escalation and we really need this. So any help appreciated. Thanks Max From Gustav at cactus.dk Tue Dec 8 10:11:52 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 08 Dec 2009 17:11:52 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil et al He has posted links to the PP slides and demo code here: http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe-december-2009.aspx for: ASP.NET 4 and VS 2010 Web Development: Slides + Demos + Blog Posts ASP.NET MVC 2.0: Slides + Walkthrough Silverlight 4: Slides (warning: large download) /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Tue Dec 8 11:52:14 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 8 Dec 2009 20:52:14 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <006c01ca782f$2e61ae30$8b250a90$@spb.ru> Hi Gustav, Thank you for the links. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, December 08, 2009 7:12 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil et al He has posted links to the PP slides and demo code here: http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe -december-2009.aspx for: ASP.NET 4 and VS 2010 Web Development: Slides + Demos + Blog Posts ASP.NET MVC 2.0: Slides + Walkthrough Silverlight 4: Slides (warning: large download) /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4670 (20091208) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 9 08:04:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 09:04:21 -0500 Subject: [dba-VB] c# Browse folder dialog Message-ID: <4B1FAE65.2070700@colbyconsulting.com> When I set the BrowseFolder.SelectedPath property, it displays the directory tree with the selected directory NOT expanded. I would like to cause the selected directory to already be expanded. Does anyone know if this is possible? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Dec 9 08:43:38 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 09 Dec 2009 15:43:38 +0100 Subject: [dba-VB] c# Browse folder dialog Message-ID: Hi John I think not. This old project uses the Shell dialogue and has a SetExpanded method. Maybe you can get some ideas: http://www.codeproject.com/KB/selection/folderbrowser.aspx /gustav >>> jwcolby at colbyconsulting.com 09-12-2009 15:04:21 >>> When I set the BrowseFolder.SelectedPath property, it displays the directory tree with the selected directory NOT expanded. I would like to cause the selected directory to already be expanded. Does anyone know if this is possible? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 09:49:25 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 10:49:25 -0500 Subject: [dba-VB] C# - Thoughts on my methods Message-ID: <4B1FC705.9010902@colbyconsulting.com> As a consultant in a home office I work in total isolation except for this email group. So I need your input, to keep me sane and to keep me on the right path. I would like your thoughts on what I am doing and what I am intending to do. As you know, I have "the database from hell", for which I am developing an application to allow me to manipulate the various pieces from an application interface rather than directly from stored procedures and the SSMS or from Access, which is what I have done to this point. With C# I am able to do more than I was able from Access, including getting back output parameters from stored procedures. So... my process so far. First off, I am developing the overall application as a set of child projects inside of the application. The main application opens a form with a menu, and that menu takes me to forms in the child projects to perform pieces of the application. For example I have a database backup project where I can backup and restore specific databases or groups of databases. I have an Accuzip project where I can export CSV files to and import resulting CSV files from the external Accuzip program. I have an Orders project where I can create and manipulate the orders I create for the client. Each child project is physically located underneath the main application directory. In order to reference (open) the forms in the child projects, I have to set a reference to that project and I have to set a using statement in the form. I still do not understand what these two pieces do. Why do I have to set a reference and a using? I assume you cannot set a using statement unless the project references the library (or project)? I also don't understand why some objects in a referenced project class can be seen but others cannot. IOW I can use one class in a namespace as a type to dimension an object, but another class in the same namespace is not visible, cannot be so used. I don't understand a whole ton of things of this nature and I have to say that the whole "break into projects" idea is turning out to be more work than it might be worth. Any comments on this email will be much appreciated. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 11:42:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 12:42:12 -0500 Subject: [dba-VB] C# - zip / unzip Message-ID: <4B1FE174.90207@colbyconsulting.com> Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 13:14:16 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 14:14:16 -0500 Subject: [dba-VB] threading Message-ID: <4B1FF708.1040700@colbyconsulting.com> As mentioned in previous emails, I am developing an application to manage all of the tasks for the DBFH. This includes Backing up databases, creating orders, transferring data between an external app etc. I am trying to determine how to thread this app such that if I start a process exporting data to Accuzip, I could have another process importing data from Accuzip, and also be working on an order. As things currently stand, each of these tasks is a project and each project has its own forms and classes, and anything else necessary for that task. I really do want to be able to do multiple things like this at the same time. Exporting data to Accuzip can take overnight, and actually consists of an export and a matching import process. It makes perfect sense (to me) to have threads doing this kind of thing, and allow me to go back to the main application and do something else. But at what level would I use a thread? Would I use a thread to open the form that performs the AZ process? This would allow me to get that started and immediately go back to the main app and open another form (using a new thread?) to start processing an order. Or would the form open and the button on the form start a thread that executes the process? If a form starts a thread, that allows the user (me) to do other things in that form potentially changing to a new directory or selecting a different database. Do you disable all controls on a form when a thread starts? I never had to think about this in VBA and it is all rather confusing. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] threading In-Reply-To: <4B1FF708.1040700@colbyconsulting.com> References: <4B1FF708.1040700@colbyconsulting.com> Message-ID: <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> Hi John -- Why not have several (FE) applications if they are so independent? - all developed within one VS solution but as separate (WinForms) projects sharing the same (set of) class library(-ies)? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 10:14 PM To: VBA Subject: [dba-VB] threading As mentioned in previous emails, I am developing an application to manage all of the tasks for the DBFH. This includes Backing up databases, creating orders, transferring data between an external app etc. I am trying to determine how to thread this app such that if I start a process exporting data to Accuzip, I could have another process importing data from Accuzip, and also be working on an order. As things currently stand, each of these tasks is a project and each project has its own forms and classes, and anything else necessary for that task. I really do want to be able to do multiple things like this at the same time. Exporting data to Accuzip can take overnight, and actually consists of an export and a matching import process. It makes perfect sense (to me) to have threads doing this kind of thing, and allow me to go back to the main application and do something else. But at what level would I use a thread? Would I use a thread to open the form that performs the AZ process? This would allow me to get that started and immediately go back to the main app and open another form (using a new thread?) to start processing an order. Or would the form open and the button on the form start a thread that executes the process? If a form starts a thread, that allows the user (me) to do other things in that form potentially changing to a new directory or selecting a different database. Do you disable all controls on a form when a thread starts? I never had to think about this in VBA and it is all rather confusing. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B1FE174.90207@colbyconsulting.com> References: <4B1FE174.90207@colbyconsulting.com> Message-ID: <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> Hi John, Have a look for DotNetNuke sources - they have free sources for zipping/unzipping. Those sources are used in core DNN functionality (modules setup) - IOW they tested well, they are stable and thry work very well. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 8:42 PM To: VBA Subject: [dba-VB] C# - zip / unzip Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: <4B1FC705.9010902@colbyconsulting.com> References: <4B1FC705.9010902@colbyconsulting.com> Message-ID: <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 6:49 PM To: VBA Subject: [dba-VB] C# - Thoughts on my methods As a consultant in a home office I work in total isolation except for this email group. So I need your input, to keep me sane and to keep me on the right path. I would like your thoughts on what I am doing and what I am intending to do. As you know, I have "the database from hell", for which I am developing an application to allow me to manipulate the various pieces from an application interface rather than directly from stored procedures and the SSMS or from Access, which is what I have done to this point. With C# I am able to do more than I was able from Access, including getting back output parameters from stored procedures. So... my process so far. First off, I am developing the overall application as a set of child projects inside of the application. The main application opens a form with a menu, and that menu takes me to forms in the child projects to perform pieces of the application. For example I have a database backup project where I can backup and restore specific databases or groups of databases. I have an Accuzip project where I can export CSV files to and import resulting CSV files from the external Accuzip program. I have an Orders project where I can create and manipulate the orders I create for the client. Each child project is physically located underneath the main application directory. In order to reference (open) the forms in the child projects, I have to set a reference to that project and I have to set a using statement in the form. I still do not understand what these two pieces do. Why do I have to set a reference and a using? I assume you cannot set a using statement unless the project references the library (or project)? I also don't understand why some objects in a referenced project class can be seen but others cannot. IOW I can use one class in a namespace as a type to dimension an object, but another class in the same namespace is not visible, cannot be so used. I don't understand a whole ton of things of this nature and I have to say that the whole "break into projects" idea is turning out to be more work than it might be worth. Any comments on this email will be much appreciated. -- John W. Colby www.ColbyConsulting.com _______________________________________________ __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From cfoust at infostatsystems.com Wed Dec 9 15:11:49 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 9 Dec 2009 15:11:49 -0600 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> References: <4B1FC705.9010902@colbyconsulting.com> <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Message-ID: I have to point out that it is exceptionally easy to create circular references when the projects are set up like this. That's why in our apps we keep all the forms in a project, all the reports in a project, etc. Of course, if we were using libraries rather than projects under the solution, it would be different. But this way, it can get messy fast. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, December 09, 2009 12:59 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - Thoughts on my methods Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil From cfoust at infostatsystems.com Wed Dec 9 15:17:15 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 9 Dec 2009 15:17:15 -0600 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B1FE174.90207@colbyconsulting.com> References: <4B1FE174.90207@colbyconsulting.com> Message-ID: You can roll your own using J# from within VS. Idid that originally and it only takes minor translation to put it into C# or VB. That said, we currently use Xceed. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 9:42 AM To: VBA Subject: [dba-VB] C# - zip / unzip Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From phpons at free.fr Wed Dec 9 15:24:33 2009 From: phpons at free.fr (Philippe) Date: Wed, 9 Dec 2009 22:24:33 +0100 Subject: [dba-VB] Ajax application problem Message-ID: <3262DDC894CA427DB254732FCE5E70AF@VOSTRO> Hi all, I have problems putting an ajax application on a production server. The application consists of an aspx page that keeps the javascript code. This code talks with C# page methods to access Web services and interact with the database. For example the first thing the user has to do is fill in login and password fields and click on the btnLogin. Then the code execute the following command: PageMethods.GetUser(user, onGetUserSuccess, onGetUserError); with user being an array containing username and password. The C# GetUser webmethod returns its response to the onGetUserSuccess callback function. The application runs ok on my dev pc. I installed it on the production server, copying the aspx file, web.config file and the binary files. When I run it, I get an error message, something like error during the handling of your request.(freely translated from french!!) This error is displayed into a textbox by the onGetUserError callback function. I put an error trapping withing the webmethod, but its error message is not returned, leading me to think that this webmethod is not "entered". Therefore the javascript code is running ok, but the call to the webmethod is failing. I guess I missed to copy something like a javascript file from the framework, or something else. Do you have any kind of experience in this regard? NB: I also checked that the asp framework is of version 2.0 on the server, it's ok. TIA, Philippe Pons From shamil at smsconsulting.spb.ru Wed Dec 9 15:41:54 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 10 Dec 2009 00:41:54 +0300 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: References: <4B1FC705.9010902@colbyconsulting.com> <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Message-ID: <00d201ca7918$6e663b10$4b32b130$@spb.ru> Hi Charlotte -- Yes, it's easy to create cross-refs, and it's (usually) easy to solve cross-refs under Visual Studio - please provide an example where cross-refs resolving is a really tough task - this sample shouldn't be the case where one decides to resolve cross-refs in a legacy "spaghetti" set of projects IOW we assume we're talking about experienced developers who prevent having "cross-refs" spaghetti by doing code clean-up/refactoring/de-cross-referencing once in a while within a project's sources life-time... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, December 10, 2009 12:12 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Thoughts on my methods I have to point out that it is exceptionally easy to create circular references when the projects are set up like this. That's why in our apps we keep all the forms in a project, all the reports in a project, etc. Of course, if we were using libraries rather than projects under the solution, it would be different. But this way, it can get messy fast. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, December 09, 2009 12:59 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - Thoughts on my methods Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 9 16:44:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 17:44:08 -0500 Subject: [dba-VB] threading In-Reply-To: <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> References: <4B1FF708.1040700@colbyconsulting.com> <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> Message-ID: <4B202838.1080404@colbyconsulting.com> > Why not have several (FE) applications if they are so independent? - all developed within one VS solution but as separate (WinForms) projects sharing the same (set of) class library(-ies)? It seems like that may be what I am doing? I have a single solution. Inside of that solution's physical directory I have multiple projects, each in its own directory. As I expand the solution I do an add / new project from the main solution / project. Doing that takes care of creating a directory structure for each new project, but causes it to be created under the main solution directory. Each project does not depend in any way on any other project, though I do have some shared libraries. Each child project is referenced by the main project, but the child projects do not reference other child projects. Now whether each of these independent projects ends up as individual applications I don't have a clue. I was just tying them together with a single form / menu so that I have one central application to go to to find everything. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Why not have several (FE) applications if they are so independent? - all > developed within one VS solution but as separate (WinForms) projects sharing > the same (set of) class library(-ies)? > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 10:14 PM > To: VBA > Subject: [dba-VB] threading > > As mentioned in previous emails, I am developing an application to manage > all of the tasks for the > DBFH. This includes Backing up databases, creating orders, transferring > data between an external > app etc. I am trying to determine how to thread this app such that if I > start a process exporting > data to Accuzip, I could have another process importing data from Accuzip, > and also be working on an > order. > > As things currently stand, each of these tasks is a project and each project > has its own forms and > classes, and anything else necessary for that task. I really do want to be > able to do multiple > things like this at the same time. Exporting data to Accuzip can take > overnight, and actually > consists of an export and a matching import process. It makes perfect sense > (to me) to have threads > doing this kind of thing, and allow me to go back to the main application > and do something else. > > But at what level would I use a thread? Would I use a thread to open the > form that performs the AZ > process? This would allow me to get that started and immediately go back to > the main app and open > another form (using a new thread?) to start processing an order. > > Or would the form open and the button on the form start a thread that > executes the process? If a > form starts a thread, that allows the user (me) to do other things in that > form potentially changing > to a new directory or selecting a different database. Do you disable all > controls on a form when a > thread starts? I never had to think about this in VBA and it is all rather > confusing. > From jwcolby at colbyconsulting.com Wed Dec 9 16:48:36 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 17:48:36 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> References: <4B1FE174.90207@colbyconsulting.com> <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> Message-ID: <4B202944.8000306@colbyconsulting.com> > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? > From michael at ddisolutions.com.au Wed Dec 9 17:11:11 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 10 Dec 2009 10:11:11 +1100 Subject: [dba-VB] C# - zip / unzip References: <4B1FE174.90207@colbyconsulting.com><00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> <4B202944.8000306@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0158281F@ddi-01.DDI.local> I've never used it but there are builtin libraries for zipping/unzipping. Look in System.IO.Compression The help file looks, well, helpfull for a change :-) using System; using System.IO; using System.IO.Compression; public class GZipTest { private const int buffer_size = 100; public static int ReadAllBytesFromStream(Stream stream, byte[] buffer) { // Use this method is used to read all bytes from a stream. int offset = 0; int totalCount = 0; while (true) { int bytesRead = stream.Read(buffer, offset, buffer_size); if (bytesRead == 0) { break; } offset += bytesRead; totalCount += bytesRead; } return totalCount; } public static bool CompareData(byte[] buf1, int len1, byte[] buf2, int len2) { // Use this method to compare data from two different buffers. if (len1 != len2) { Console.WriteLine("Number of bytes in two buffer are different {0}:{1}", len1, len2); return false; } for (int i = 0; i < len1; i++) { if (buf1[i] != buf2[i]) { Console.WriteLine("byte {0} is different {1}|{2}", i, buf1[i], buf2[i]); return false; } } Console.WriteLine("All bytes compare."); return true; } public static void GZipCompressDecompress(string filename) { Console.WriteLine("Test compression and decompression on file {0}", filename); FileStream infile; try { // Open the file as a FileStream object. infile = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[infile.Length]; // Read the file to ensure it is readable. int count = infile.Read(buffer, 0, buffer.Length); if (count != buffer.Length) { infile.Close(); Console.WriteLine("Test Failed: Unable to read data from file"); return; } infile.Close(); MemoryStream ms = new MemoryStream(); // Use the newly created memory stream for the compressed data. GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true); Console.WriteLine("Compression"); compressedzipStream.Write(buffer, 0, buffer.Length); // Close the stream. compressedzipStream.Close(); Console.WriteLine("Original size: {0}, Compressed size: {1}", buffer.Length, ms.Length); // Reset the memory stream position to begin decompression. ms.Position = 0; GZipStream zipStream = new GZipStream(ms, CompressionMode.Decompress); Console.WriteLine("Decompression"); byte[] decompressedBuffer = new byte[buffer.Length + buffer_size]; // Use the ReadAllBytesFromStream to read the stream. int totalCount = GZipTest.ReadAllBytesFromStream(zipStream, decompressedBuffer); Console.WriteLine("Decompressed {0} bytes", totalCount); if (!GZipTest.CompareData(buffer, buffer.Length, decompressedBuffer, totalCount)) { Console.WriteLine("Error. The two buffers did not compare."); } zipStream.Close(); } // end try catch (InvalidDataException) { Console.WriteLine("Error: The file being read contains invalid data."); } catch (FileNotFoundException) { Console.WriteLine("Error:The file specified was not found."); } catch (ArgumentException) { Console.WriteLine("Error: path is a zero-length string, contains only white space, or contains one or more invalid characters"); } catch (PathTooLongException) { Console.WriteLine("Error: The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The specified path is invalid, such as being on an unmapped drive."); } catch (IOException) { Console.WriteLine("Error: An I/O error occurred while opening the file."); } catch (UnauthorizedAccessException) { Console.WriteLine("Error: path specified a file that is read-only, the path is a directory, or caller does not have the required permissions."); } catch (IndexOutOfRangeException) { Console.WriteLine("Error: You must provide parameters for MyGZIP."); } } public static void Main(string[] args) { string usageText = "Usage: MYGZIP "; //If no file name is specified, write usage text. if (args.Length == 0) { Console.WriteLine(usageText); } else { if (File.Exists(args[0])) GZipCompressDecompress(args[0]); } } } Cheers Michael M > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? > _______________________________________________ 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 - www.avg.com Version: 9.0.709 / Virus Database: 270.14.99/2553 - Release Date: 12/09/09 06:54:00 From Gustav at cactus.dk Thu Dec 10 04:22:54 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 10 Dec 2009 11:22:54 +0100 Subject: [dba-VB] C# - zip / unzip Message-ID: Hi Michael Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. A bit strange that this widely used function is missing from the framework. /gustav >>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> I've never used it but there are builtin libraries for zipping/unzipping. Look in System.IO.Compression The help file looks, well, helpfull for a change :-) using System; using System.IO; using System.IO.Compression; public class GZipTest { private const int buffer_size = 100; public static int ReadAllBytesFromStream(Stream stream, byte[] buffer) { // Use this method is used to read all bytes from a stream. int offset = 0; int totalCount = 0; while (true) { int bytesRead = stream.Read(buffer, offset, buffer_size); if (bytesRead == 0) { break; } offset += bytesRead; totalCount += bytesRead; } return totalCount; } public static bool CompareData(byte[] buf1, int len1, byte[] buf2, int len2) { // Use this method to compare data from two different buffers. if (len1 != len2) { Console.WriteLine("Number of bytes in two buffer are different {0}:{1}", len1, len2); return false; } for (int i = 0; i < len1; i++) { if (buf1[i] != buf2[i]) { Console.WriteLine("byte {0} is different {1}|{2}", i, buf1[i], buf2[i]); return false; } } Console.WriteLine("All bytes compare."); return true; } public static void GZipCompressDecompress(string filename) { Console.WriteLine("Test compression and decompression on file {0}", filename); FileStream infile; try { // Open the file as a FileStream object. infile = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[infile.Length]; // Read the file to ensure it is readable. int count = infile.Read(buffer, 0, buffer.Length); if (count != buffer.Length) { infile.Close(); Console.WriteLine("Test Failed: Unable to read data from file"); return; } infile.Close(); MemoryStream ms = new MemoryStream(); // Use the newly created memory stream for the compressed data. GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true); Console.WriteLine("Compression"); compressedzipStream.Write(buffer, 0, buffer.Length); // Close the stream. compressedzipStream.Close(); Console.WriteLine("Original size: {0}, Compressed size: {1}", buffer.Length, ms.Length); // Reset the memory stream position to begin decompression. ms.Position = 0; GZipStream zipStream = new GZipStream(ms, CompressionMode.Decompress); Console.WriteLine("Decompression"); byte[] decompressedBuffer = new byte[buffer.Length + buffer_size]; // Use the ReadAllBytesFromStream to read the stream. int totalCount = GZipTest.ReadAllBytesFromStream(zipStream, decompressedBuffer); Console.WriteLine("Decompressed {0} bytes", totalCount); if (!GZipTest.CompareData(buffer, buffer.Length, decompressedBuffer, totalCount)) { Console.WriteLine("Error. The two buffers did not compare."); } zipStream.Close(); } // end try catch (InvalidDataException) { Console.WriteLine("Error: The file being read contains invalid data."); } catch (FileNotFoundException) { Console.WriteLine("Error:The file specified was not found."); } catch (ArgumentException) { Console.WriteLine("Error: path is a zero-length string, contains only white space, or contains one or more invalid characters"); } catch (PathTooLongException) { Console.WriteLine("Error: The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The specified path is invalid, such as being on an unmapped drive."); } catch (IOException) { Console.WriteLine("Error: An I/O error occurred while opening the file."); } catch (UnauthorizedAccessException) { Console.WriteLine("Error: path specified a file that is read-only, the path is a directory, or caller does not have the required permissions."); } catch (IndexOutOfRangeException) { Console.WriteLine("Error: You must provide parameters for MyGZIP."); } } public static void Main(string[] args) { string usageText = "Usage: MYGZIP "; //If no file name is specified, write usage text. if (args.Length == 0) { Console.WriteLine(usageText); } else { if (File.Exists(args[0])) GZipCompressDecompress(args[0]); } } } Cheers Michael M > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? From jwcolby at colbyconsulting.com Thu Dec 10 07:12:44 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 10 Dec 2009 08:12:44 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: References: Message-ID: <4B20F3CC.4090604@colbyconsulting.com> Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple source. Several DLLs out there. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi Michael > > Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. > > A bit strange that this widely used function is missing from the framework. > > /gustav > > >>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> > I've never used it but there are builtin libraries for > zipping/unzipping. > Look in System.IO.Compression From dbdoug at gmail.com Thu Dec 10 08:20:06 2009 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 10 Dec 2009 06:20:06 -0800 Subject: [dba-VB] Slightly O/T - web development stuff Message-ID: <4dd71a0c0912100620w6ef71523w11fba8e1ab39a454@mail.gmail.com> www.sitepoint.com is putting one or more of their books/videos on sale every day this month. A couple of days ago I got seven 20 minute videos on Ajax and css for $15; yesterday I got 3 full books on Javascript/Ajax in pdf form for the same $15. Doug Steele From jwcolby at colbyconsulting.com Sun Dec 13 21:45:18 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 13 Dec 2009 22:45:18 -0500 Subject: [dba-VB] Do you wanna learn c#? Message-ID: <4B25B4CE.9010105@colbyconsulting.com> Have I got the book for you. http://www.amazon.com/Microsoft%C2%AE-XNA%C2%AE-Game-Studio-3-0/dp/0735626588/ref=sr_1_2?ie=UTF8&s=books&qid=1260761698&sr=1-2 I bought this book because I found the XNA studio and wanted to learn all about how it works. But this book is about teaching programming, and from that C#. For anyone who knows vba or VB.net it will start off easy, but for anyone who doesn't program at all it also starts off easy. This might be the best book for learning to program (in general) I have run into. Plus it is fun. You need Visual Studio (express is fine) and you need the XNA studio (it is also free). An XBox 360 game controller will be required pretty quickly. I bought the cheapest controller for $15 from Wally world. Then start reading (and writing). I am on chapter 5 now (in about three days) and working on through it. I swear you will learn C#, have fun while you are at it, AND learn how the XNA game studio framework works which is also an awesome tool. Really folks, this is the real deal, if you have always said "I should..." do this one. Or get your teenager involved in it. I bought the book new from Amazon for about $20, plus the controller. Everything else is free. That is a great deal folks! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 14 08:47:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Dec 2009 09:47:22 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B20F3CC.4090604@colbyconsulting.com> References: <4B20F3CC.4090604@colbyconsulting.com> Message-ID: <4B264FFA.5020603@colbyconsulting.com> I am working on creating a single field index on every field of a table. I promptly ran into so many problems making it generic that I punted and went back to hard coding the database / table name. I did find this: select Name as FldName from psm11203.sys.columns WHERE object_id = OBJECT_ID('PSM11203.dbo.tblOrderData') Which does give me a table of field names. Using this in a cursor I am then able to create an index on each field, so I am off and running. This is really a one off process that I need to run on my tblHSID - the table from hell from the database from hell. I have to tell you I am a bit hesitant to pull the trigger in this for the table from hell. It is going to take many minutes to build each index and there are well over 500 fields to index. I could end up locking up my database for the next month. ;) I did create a copy, created a clustered index and will be creating all of these indexes on that copy, but even then it pretty much uses all of the resources of the server. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple > source. Several DLLs out there. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi Michael >> >> Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. >> >> A bit strange that this widely used function is missing from the framework. >> >> /gustav >> >> >>>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> >> I've never used it but there are builtin libraries for >> zipping/unzipping. >> Look in System.IO.Compression > > _______________________________________________ > dba-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 Dec 14 09:02:42 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Dec 2009 10:02:42 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B264FFA.5020603@colbyconsulting.com> References: <4B20F3CC.4090604@colbyconsulting.com> <4B264FFA.5020603@colbyconsulting.com> Message-ID: <4B265392.3010107@colbyconsulting.com> Boy did I reply to the wrong email or what??? John W. Colby www.ColbyConsulting.com jwcolby wrote: > I am working on creating a single field index on every field of a table. I promptly ran into so > many problems making it generic that I punted and went back to hard coding the database / table > name. I did find this: > > select Name as FldName from psm11203.sys.columns > WHERE object_id = OBJECT_ID('PSM11203.dbo.tblOrderData') > > Which does give me a table of field names. Using this in a cursor I am then able to create an index > on each field, so I am off and running. > > This is really a one off process that I need to run on my tblHSID - the table from hell from the > database from hell. > > I have to tell you I am a bit hesitant to pull the trigger in this for the table from hell. It is > going to take many minutes to build each index and there are well over 500 fields to index. I could > end up locking up my database for the next month. ;) > > I did create a copy, created a clustered index and will be creating all of these indexes on that > copy, but even then it pretty much uses all of the resources of the server. > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: >> Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple >> source. Several DLLs out there. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Gustav Brock wrote: >>> Hi Michael >>> >>> Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. >>> >>> A bit strange that this widely used function is missing from the framework. >>> >>> /gustav >>> >>> >>>>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> >>> I've never used it but there are builtin libraries for >>> zipping/unzipping. >>> Look in System.IO.Compression >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Johncliviger at aol.com Tue Dec 15 04:10:47 2009 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 15 Dec 2009 05:10:47 EST Subject: [dba-VB] A Parameters syntax question Message-ID: Hi All I'm connecting a vb2005 DataGridView to an Access db via vb code to return a subset of records from a table. Using the GUID dataType it works fine but when I change the datatype I get all the records. I'm using the Imports system.Data.OleDb class. From there I have OleDb connection, Command, DataAdapter and a Dataset. EG. With Command .CommandText = "QueryName" .CommandType = CommandType.StoredProcedure .Connection = OleDbConnection .Parameters.Add("@REFNOC", OleDbType.Guid,16).Value = New Guid(REFNOC) end With Every thing works as it should. That is until I change the the datatype in the Parameter line and try to use a string or Integer. I can't get the syntax right for the .Parameters line. If for example I change the .Parameter to say .Parameters.Add("@REFNOC", OleDbType.Single).Value = REFNOC I get all records Can anyone cast a little light here? From Johncliviger at aol.com Tue Dec 15 04:39:12 2009 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 15 Dec 2009 05:39:12 EST Subject: [dba-VB] Parameters problem solved Message-ID: Now then who's a silly boy! When using parameters in vb.net connection one does need to specify the parameter in the back-end query!! Then it works a treat johncliviger From jwcolby at colbyconsulting.com Wed Dec 16 16:20:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 16 Dec 2009 17:20:08 -0500 Subject: [dba-VB] windows 7 media center Message-ID: <4B295D18.7070000@colbyconsulting.com> Well my Vista Windows Media Center (WMC) finally bit the dust. Something happened (a SP install I suspect) and the codec got trashed (I think) and suddenly WMC no workee - no tv of any kind, already recorded or off of the tv card. As a college student I qualify to buy a copy of Windows 7 for $29 which sounded too good to pass up. And that version supposedly had a much improved MCE. So I did. Bought it, and installed it ON A 30 gb FLASH DRIVE last night. Finished about 3:30 am. She workee again. In the meantime I also went from a low power dual core to a medium powered quad core, but twice the ghz rating. Needless to say the Home theater PC flies. Now if it will just work for a long time with no maintenance. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 17 20:37:41 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 17 Dec 2009 21:37:41 -0500 Subject: [dba-VB] SQL Server 2008 install broke my application Message-ID: <4B2AEAF5.3080201@colbyconsulting.com> A perfectly functioning application has all kinds of compile errors after the SQL Server install. A bunch of Microsoft.SQLServer.XXX references had to be deleted and rereferenced. The sole remaining issue that I still haven't gotten around is the Transfer object, supposedly part of the SMO object is suddenly gone missing. And I was using that to copy a database and all of its internal objects. Sigh. -- John W. Colby www.ColbyConsulting.com From bheid at sc.rr.com Sun Dec 20 00:29:55 2009 From: bheid at sc.rr.com (Bobby Heid) Date: Sun, 20 Dec 2009 01:29:55 -0500 Subject: [dba-VB] SQL Server 2008 install broke my application In-Reply-To: <4B2AEAF5.3080201@colbyconsulting.com> References: <4B2AEAF5.3080201@colbyconsulting.com> Message-ID: <000301ca813d$d82a7610$887f6230$@rr.com> Hey John, Did you install the SQL Client Tools? I was just reading something about this today. I think the SMO stuff is installed with the client tools. I am not positive though. If this does not solve your issue, I'll see if I can find that reference tomorrow. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 17, 2009 9:38 PM To: VBA Subject: [dba-VB] SQL Server 2008 install broke my application A perfectly functioning application has all kinds of compile errors after the SQL Server install. A bunch of Microsoft.SQLServer.XXX references had to be deleted and rereferenced. The sole remaining issue that I still haven't gotten around is the Transfer object, supposedly part of the SMO object is suddenly gone missing. And I was using that to copy a database and all of its internal objects. Sigh. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Dec 20 09:29:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 20 Dec 2009 10:29:39 -0500 Subject: [dba-VB] SPAM-LOW: Re: SQL Server 2008 install broke my application In-Reply-To: <000301ca813d$d82a7610$887f6230$@rr.com> References: <4B2AEAF5.3080201@colbyconsulting.com> <000301ca813d$d82a7610$887f6230$@rr.com> Message-ID: <4B2E42E3.4090208@colbyconsulting.com> I checked every box on the install. John W. Colby www.ColbyConsulting.com Bobby Heid wrote: > Hey John, > > Did you install the SQL Client Tools? I was just reading something about > this today. I think the SMO stuff is installed with the client tools. I am > not positive though. If this does not solve your issue, I'll see if I can > find that reference tomorrow. > > Bobby > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 17, 2009 9:38 PM > To: VBA > Subject: [dba-VB] SQL Server 2008 install broke my application > > A perfectly functioning application has all kinds of compile errors after > the SQL Server install. A > bunch of Microsoft.SQLServer.XXX references had to be deleted and > rereferenced. The sole remaining > issue that I still haven't gotten around is the Transfer object, supposedly > part of the SMO object > is suddenly gone missing. And I was using that to copy a database and all > of its internal objects. > > Sigh. > From jwcolby at colbyconsulting.com Tue Dec 22 10:18:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 22 Dec 2009 11:18:12 -0500 Subject: [dba-VB] Multimonitor toolbar Message-ID: <4B30F144.6090504@colbyconsulting.com> I just found this, WAY COOL! It puts a toolbar at the bottom of the second monitor that displays the icons for the programs being displayed on the second monitor. How come no one told me about this? http://www.mediachance.com/free/multimon.htm -- John W. Colby www.ColbyConsulting.com From paul.hartland at googlemail.com Thu Dec 24 06:09:00 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 24 Dec 2009 12:09:00 +0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False Message-ID: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com From andy at minstersystems.co.uk Thu Dec 24 06:59:11 2009 From: andy at minstersystems.co.uk (Andy Lacey) Date: Thu, 24 Dec 2009 12:59:11 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> Message-ID: <153B93F23C804502875134D824C863BA@MINSTER> Hi Paul Well I'll wait to be corrected but I reckon they're simply two syntactically different ways of saying the same thing. They'd surely compile into the same code. So it just comes down to preference of style and readability, i.e. totally subjective Andy -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: 24 December 2009 12:09 To: VisualBasicList Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Thu Dec 24 07:07:18 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 24 Dec 2009 13:07:18 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <153B93F23C804502875134D824C863BA@MINSTER> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> <153B93F23C804502875134D824C863BA@MINSTER> Message-ID: <4b33679b.0e67f10a.2282.ffffa79b@mx.google.com> Or you could do this (which I prefer) If not rst.eof then Do my stuff Else Msgbox "who nicked my records" Endif Ps. Who is the programmer? You, or the Project Manager? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Andy Lacey Sent: 24 December 2009 12:59 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False Hi Paul Well I'll wait to be corrected but I reckon they're simply two syntactically different ways of saying the same thing. They'd surely compile into the same code. So it just comes down to preference of style and readability, i.e. totally subjective Andy -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: 24 December 2009 12:09 To: VisualBasicList Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 24 10:14:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 24 Dec 2009 11:14:22 -0500 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> Message-ID: <4B33935E.5000607@colbyconsulting.com> Paul, Perhaps better would be: if MyRecordset.BOF and MyRecordset.EOF then msgbox "Empty" else do stuff here endif It is easier to read the true than the nots, especially when there is more than one. Either one works. If this is in a tight loop and speed matters, then the NOT might cause a very slight slowdown as it is two extra boolean operators. OTOH the compiler might just pick it up and rewrite it to my syntax anyway. John W. Colby www.ColbyConsulting.com Paul Hartland wrote: > To all, > > I use a lot of recordsets, and to detect they actually contain something I > have always used the following: > > If myrecordset.bof=false and myrecordset.eof=false then > do my stuff here > Else > msgbox "empty" > End If > > However my project manager prefers: > If not myrecordset.bof and not myrecordset.eof then > do my stuff here > Else > msgbox "empty" > End If > > Is there actually a prefered way, or is one quicker than the other, or is > there an even better way to do this ? > > Thanks in advance for any comments, and a very merry christmas & happy new > year to everyone. > From max.wanadoo at gmail.com Thu Dec 24 12:13:13 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 24 Dec 2009 18:13:13 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <4B33935E.5000607@colbyconsulting.com> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> <4B33935E.5000607@colbyconsulting.com> Message-ID: <4b33af5b.1067f10a.3ae6.ffffb846@mx.google.com> John, I don't think that will work...something from Getz etc sticks in my mind...might be old age though. maxx -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 24 December 2009 16:14 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False Paul, Perhaps better would be: if MyRecordset.BOF and MyRecordset.EOF then msgbox "Empty" else do stuff here endif It is easier to read the true than the nots, especially when there is more than one. Either one works. If this is in a tight loop and speed matters, then the NOT might cause a very slight slowdown as it is two extra boolean operators. OTOH the compiler might just pick it up and rewrite it to my syntax anyway. John W. Colby www.ColbyConsulting.com Paul Hartland wrote: > To all, > > I use a lot of recordsets, and to detect they actually contain something I > have always used the following: > > If myrecordset.bof=false and myrecordset.eof=false then > do my stuff here > Else > msgbox "empty" > End If > > However my project manager prefers: > If not myrecordset.bof and not myrecordset.eof then > do my stuff here > Else > msgbox "empty" > End If > > Is there actually a prefered way, or is one quicker than the other, or is > there an even better way to do this ? > > Thanks in advance for any comments, and a very merry christmas & happy new > year to everyone. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 31 16:29:43 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 31 Dec 2009 17:29:43 -0500 Subject: [dba-VB] Happy new year Message-ID: <4B3D25D7.2030404@colbyconsulting.com> I will likely be asleep when it actually happens locally, so I wish each and every one of you a MUCH better year in 2010. HAPPY NEW YEAR! -- John W. Colby www.ColbyConsulting.com From garykjos at gmail.com Thu Dec 31 16:35:55 2009 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 31 Dec 2009 16:35:55 -0600 Subject: [dba-VB] [AccessD] Happy new year In-Reply-To: <4B3D25D7.2030404@colbyconsulting.com> References: <4B3D25D7.2030404@colbyconsulting.com> Message-ID: Likewise for me too John. Early to bed, early to rise is my program for the most part. I echo your sentiments. Happy New Year! GK On Thu, Dec 31, 2009 at 4:29 PM, jwcolby wrote: > I will likely be asleep when it actually happens locally, so I wish each and every one of you a MUCH > better year in 2010. > > HAPPY NEW YEAR! > > -- > John W. Colby > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.com From marklbreen at gmail.com Tue Dec 1 09:12:22 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 1 Dec 2009 15:12:22 +0000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B14231F.3020905@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com> Message-ID: Hello John, I have struggled with this value, and mixed it up with the connectionTimeout also. As a result, when I think there will be a delay, I also set it to zero, and then I sleep easy. I did that two years ago with out troublesome app, and now it works and works and works. Whats the downside of infinite timeout. If it takes three weeks, you will find out anyway, but why kill it after ten mins when it would have finished successfully in 19.45 minutes. Mark 2009/11/30 jwcolby > Any words of wisdom on setting the command.Timeout property? I have stored > procedures that execute > instantly, and others that can take an hour or more (large appends). > > How can I discover how long a stored procedure takes to run so that I can > set this property > dynamically? As an example I have cases where I am appending 65 million > rows into a table of 6 > fields. This can take a long time (at the very least perhaps 20 minutes) > but if I could get a > "RecordsAffected" count for such queries as well as the time it took to > execute, then I could start > to discover that it takes "X seconds / million" records, and set the > timeout to a reasonable value > based on the records to be appended. > > This doesn't have to be any exact time value. I assume a simple pair of > time variables, then "stop > time - start time"? > > Or should I just discover worst case and set it to that? > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 09:24:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 10:24:10 -0500 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: References: <4B14231F.3020905@colbyconsulting.com> Message-ID: <4B15351A.40500@colbyconsulting.com> Mark, Thanks for the response. >If it takes three weeks, you will find out anyway, but why kill it after ten mins when it would have finished successfully in 19.45 minutes. I hear you! BTW how do you kill an executing stored procedure? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > I have struggled with this value, and mixed it up with the connectionTimeout > also. As a result, when I think there will be a delay, I also set it to > zero, and then I sleep easy. I did that two years ago with > out troublesome app, and now it works and works and works. Whats the > downside of infinite timeout. If it takes three weeks, you will find out > anyway, but why kill it after ten mins when it would have finished > successfully in 19.45 minutes. > > > Mark > > > > > 2009/11/30 jwcolby > >> Any words of wisdom on setting the command.Timeout property? I have stored >> procedures that execute >> instantly, and others that can take an hour or more (large appends). >> >> How can I discover how long a stored procedure takes to run so that I can >> set this property >> dynamically? As an example I have cases where I am appending 65 million >> rows into a table of 6 >> fields. This can take a long time (at the very least perhaps 20 minutes) >> but if I could get a >> "RecordsAffected" count for such queries as well as the time it took to >> execute, then I could start >> to discover that it takes "X seconds / million" records, and set the >> timeout to a reasonable value >> based on the records to be appended. >> >> This doesn't have to be any exact time value. I assume a simple pair of >> time variables, then "stop >> time - start time"? >> >> Or should I just discover worst case and set it to that? >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Tue Dec 1 09:49:01 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 1 Dec 2009 15:49:01 +0000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B15351A.40500@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com> <4B15351A.40500@colbyconsulting.com> Message-ID: Hello John, Not sure, but stopping the server is one way. My main problems were sprocs stopping when I did not want them to stop, for me, if it is still running after 24 hours, it is probably never going to stop. For you, you might increase that to 48 hours, but in general, they either finish promptly, or else will never finish, either way, timing out after 10, 20, 50, or even 600 minutes is almost never a good option, if there is a possibility that it will finish in 601 minutes. There is probably a way to stop a process, Francisco or some of the other experts may know how, but I would either stop the db server / service, or else in worst case, do a quick reboot. For the rest of the year, I would never worry about it, happy in the knowledge they the server must work till the death :) Thanks Mark 2009/12/1 jwcolby > Mark, > > Thanks for the response. > > >If it takes three weeks, you will find out anyway, but why kill it after > ten mins when it would > have finished successfully in 19.45 minutes. > > I hear you! > > BTW how do you kill an executing stored procedure? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: > > Hello John, > > > > I have struggled with this value, and mixed it up with the > connectionTimeout > > also. As a result, when I think there will be a delay, I also set it to > > zero, and then I sleep easy. I did that two years ago with > > out troublesome app, and now it works and works and works. Whats the > > downside of infinite timeout. If it takes three weeks, you will find out > > anyway, but why kill it after ten mins when it would have finished > > successfully in 19.45 minutes. > > > > > > Mark > > > > > > > > > > 2009/11/30 jwcolby > > > >> Any words of wisdom on setting the command.Timeout property? I have > stored > >> procedures that execute > >> instantly, and others that can take an hour or more (large appends). > >> > >> How can I discover how long a stored procedure takes to run so that I > can > >> set this property > >> dynamically? As an example I have cases where I am appending 65 million > >> rows into a table of 6 > >> fields. This can take a long time (at the very least perhaps 20 > minutes) > >> but if I could get a > >> "RecordsAffected" count for such queries as well as the time it took to > >> execute, then I could start > >> to discover that it takes "X seconds / million" records, and set the > >> timeout to a reasonable value > >> based on the records to be appended. > >> > >> This doesn't have to be any exact time value. I assume a simple pair of > >> time variables, then "stop > >> time - start time"? > >> > >> Or should I just discover worst case and set it to that? > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 09:58:36 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 10:58:36 -0500 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: References: <4B14231F.3020905@colbyconsulting.com> <4B15351A.40500@colbyconsulting.com> Message-ID: <4B153D2C.90100@colbyconsulting.com> Mark, >but I would either stop the db server / service, or else in worst case, do a quick reboot. I have done both. I have corrupted the database doing the reboot. Stopping the service seems to work, however I have also seen the database pick up where it left off when the service restarted. I am sure there is some way to "officially" stop a running process, I just don't know how. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > > Not sure, but stopping the server is one way. My main problems were sprocs > stopping when I did not want them to stop, for me, if it is still running > after 24 hours, it is probably never going to stop. For you, you might > increase that to 48 hours, but in general, they either finish promptly, or > else will never finish, either way, timing out after 10, 20, 50, or even 600 > minutes is almost never a good option, if there is a possibility that it > will finish in 601 minutes. > > There is probably a way to stop a process, Francisco or some of the other > experts may know how, but I would either stop the db server / service, or > else in worst case, do a quick reboot. For the rest of the year, I would > never worry about it, happy in the knowledge they the server must work till > the death :) > > Thanks > > Mark > > > > > > > 2009/12/1 jwcolby > >> Mark, >> >> Thanks for the response. >> >> >If it takes three weeks, you will find out anyway, but why kill it after >> ten mins when it would >> have finished successfully in 19.45 minutes. >> >> I hear you! >> >> BTW how do you kill an executing stored procedure? >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Mark Breen wrote: >>> Hello John, >>> >>> I have struggled with this value, and mixed it up with the >> connectionTimeout >>> also. As a result, when I think there will be a delay, I also set it to >>> zero, and then I sleep easy. I did that two years ago with >>> out troublesome app, and now it works and works and works. Whats the >>> downside of infinite timeout. If it takes three weeks, you will find out >>> anyway, but why kill it after ten mins when it would have finished >>> successfully in 19.45 minutes. >>> >>> >>> Mark >>> >>> >>> >>> >>> 2009/11/30 jwcolby >>> >>>> Any words of wisdom on setting the command.Timeout property? I have >> stored >>>> procedures that execute >>>> instantly, and others that can take an hour or more (large appends). >>>> >>>> How can I discover how long a stored procedure takes to run so that I >> can >>>> set this property >>>> dynamically? As an example I have cases where I am appending 65 million >>>> rows into a table of 6 >>>> fields. This can take a long time (at the very least perhaps 20 >> minutes) >>>> but if I could get a >>>> "RecordsAffected" count for such queries as well as the time it took to >>>> execute, then I could start >>>> to discover that it takes "X seconds / million" records, and set the >>>> timeout to a reasonable value >>>> based on the records to be appended. >>>> >>>> This doesn't have to be any exact time value. I assume a simple pair of >>>> time variables, then "stop >>>> time - start time"? >>>> >>>> Or should I just discover worst case and set it to that? >>>> -- >>>> John W. Colby >>>> www.ColbyConsulting.com >>>> _______________________________________________ >>>> dba-VB mailing list >>>> dba-VB at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>>> http://www.databaseadvisors.com >>>> >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Dec 1 10:07:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 11:07:22 -0500 Subject: [dba-VB] C# - Records Affected Message-ID: <4B153F3A.8010102@colbyconsulting.com> I am trying to get a count of records appended, updated etc in my SPs and returning that to my C# supervisor. I am finding references to @@Rowcount however this is returning 1 instead of the actual number. Is this @@RowCount the real deal? The SP definition: ALTER PROCEDURE [dbo].[sp_AZOut_AZExportToOrderedChunk] -- Add the parameters for the stored procedure here @DBName varchar(50), @ErrorDesc varchar(4000) output, @ErrorNo int output, @RecsAffected int output AS BEGIN Setting the returned value EXEC (@SQL) select @RecsAffected = @@RowCount My c# code: intRecsAffected = sCmd.Parameters["@RecsAffected"].Value The code triggers the try block if there is no such parameter (I just ignore it) or returns 1 if the parameter exists. This is a functioning tested SP which typically appends millions of records, though the exact number depends on the database. Is there something I need to know here? -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Tue Dec 1 10:49:57 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 02 Dec 2009 02:49:57 +1000 Subject: [dba-VB] C# SQLCommand.Timeout In-Reply-To: <4B153D2C.90100@colbyconsulting.com> References: <4B14231F.3020905@colbyconsulting.com>, , <4B153D2C.90100@colbyconsulting.com> Message-ID: <4B154935.15271.1331E01@stuart.lexacorp.com.pg> http://windowsitpro.com/article/articleid/14148/how-can-i-stop-a-sql-server-process.html Do a select * from sysprocesses and identify the spid in question. Then do a "KILL " This will mark the spid as "dead". Note that it may take a while for the process to end as it has to rollback all the updates that it has been doing. Also kill only marks the process as dead - the process itself needs to check for this, and if it is stuck in a loop as the result of a bug or whateverthen it won't terminate. Also certain processes like dump and dbcc commands have significant code paths where the kill command is not checked for and so these can take some time to terminate. Also, if the process is in an extended-stored procedure, or is waiting on network traffic/remote stored-procedure it will not check whether it has been terminated until these actions have been completed. See Q171224 for more info - including details on the waittype that can tell you what a process is waiting on. If the process won't die for one of the above reasons then your only choice is to stop the sqlservr.exe process itself and re-start. See also http://msdn.microsoft.com/en-us/library/aa933230%28SQL.80%29.aspx for info on KILL x WITH STATUSONLY for tracking the rollback once you kill a process. -- Stuart On 1 Dec 2009 at 10:58, jwcolby wrote: > I am sure there is some way to "officially" stop a running process, I just don't know how. > From jwcolby at colbyconsulting.com Tue Dec 1 10:50:57 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 11:50:57 -0500 Subject: [dba-VB] C# - Records Affected In-Reply-To: <4B153F3A.8010102@colbyconsulting.com> References: <4B153F3A.8010102@colbyconsulting.com> Message-ID: <4B154971.4000207@colbyconsulting.com> Sorry for the ring, I found the problem. The SP that I took this code from actually worked but the code I was testing did not and came before this code. The problem was simply that in the SP I did not place the line that captured @@RowCount immediately after the EXEC (@SQL) statement. All of the examples clearly warned me that this was a requirement but you understand "senior moments". Anyway, this is now working. Piece by piece this thing is coming together. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I am trying to get a count of records appended, updated etc in my SPs and returning that to my C# > supervisor. I am finding references to @@Rowcount however this is returning 1 instead of the actual > number. > > Is this @@RowCount the real deal? > > The SP definition: > > ALTER PROCEDURE [dbo].[sp_AZOut_AZExportToOrderedChunk] > -- Add the parameters for the stored procedure here > @DBName varchar(50), > @ErrorDesc varchar(4000) output, > @ErrorNo int output, > @RecsAffected int output > > AS > BEGIN > > > Setting the returned value > > EXEC (@SQL) > select @RecsAffected = @@RowCount > > My c# code: > > intRecsAffected = sCmd.Parameters["@RecsAffected"].Value > > The code triggers the try block if there is no such parameter (I just ignore it) or returns 1 if the > parameter exists. > > This is a functioning tested SP which typically appends millions of records, though the exact number > depends on the database. > > Is there something I need to know here? From jwcolby at colbyconsulting.com Tue Dec 1 16:53:55 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 01 Dec 2009 17:53:55 -0500 Subject: [dba-VB] C# - Direct data manipulation Message-ID: <4B159E83.4000006@colbyconsulting.com> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 2 00:54:07 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 09:54:07 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B159E83.4000006@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> Message-ID: <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> Hi John -- I must say I have never done that "dynamic" t-SQL via C# - I guess it should be doable: using SMO or even SqlCommand's .ExecuteNonQuery(?) it should be possible to create SPs and UDFs, and then execute them as usual... BTW, UDFs, which return tables are very often a good substitute for all kinds of temp tables and dynamic SQL... I wonder what for all that "dynamism" there? Do you have constantly changing database structure? Do you have constantly changing customer requests, which do not allow you to create a set of stable parameterized SPs and UDFs, and for small(?) changing part of queries use LINQ for SQL or ADO.NET EF? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 1:54 AM To: VBA Subject: [dba-VB] C# - Direct data manipulation As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4653 (20091201) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 01:19:20 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 08:19:20 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. /gustav >>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Dec 2 01:31:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 08:31:02 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next-week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Wed Dec 2 02:05:18 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 11:05:18 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <00aa01ca7326$31634020$9429c060$@spb.ru> Hi Gustav -- Congrats! <<< A full day just sitting, listening, and learning! >>> Not easy. I usually very quick fall semi-asleep during such presentations as they look so slow - hope Scott Guthrie will make this one you'll attend tomorrow a very dynamic experience... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4653 (20091201) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 02:17:19 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 09:17:19 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil Oh, I know that feeling, indeed if the presenter has a voice like a priest and your knowledge about the topic is a little too high. But I'm confident that Scott Guthrie will keep me awake! /gustav >>> shamil at smsconsulting.spb.ru 02-12-2009 09:05 >>> Hi Gustav -- Congrats! <<< A full day just sitting, listening, and learning! >>> Not easy. I usually very quick fall semi-asleep during such presentations as they look so slow - hope Scott Guthrie will make this one you'll attend tomorrow a very dynamic experience... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From marklbreen at gmail.com Wed Dec 2 04:23:09 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 2 Dec 2009 10:23:09 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow Message-ID: Hello All, I am running VS 2008 on a powerful machine with loads of resources. My project is a DNN project sitting in the wwwroot folder which allows me to change a few lines of code and then immediately see the results in the web app. However, when I manipulate the Data Context Objects in the AppCode Folder, the response times are dreadfully, slow. It takes three to four minutes to open, edit, save and close one of these objects. I have tried it on a second machine and the results are similar. I can edit the Dbml files outside of the solution, but I am not sure whether that is safe to do so, when I edit them outside the solution (copying and pasting to another folder and then opening the dbml file from there), they open instantly. When I say "safe to do so", does the project file or the sln file need to be updated with the changes that have been made. I do get some warning message about "cannot find web.config, so using the file from the dbml file instead" which I accepted. I recall Shamil mentioned that manually editing these within the individual files is not a good idea, so i guess that he may have been suffering the same problems as I am, IE so sloooow to open and close. TIA for an help, if I have not expressed the problem clearly enough, let me know, Mark From shamil at smsconsulting.spb.ru Wed Dec 2 07:20:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 16:20:11 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: Message-ID: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Hello Mark -- First of all try to switch to FireFox - forget IE while debugging large ASP.NET apps from within VS.... I can only note that debugging large ASP.NET applications is a real PITA - this is why I'm always trying to get out as much as possible BL and DAL code into separate projects and develop, debug/test them without UI (ASP.NET or WinForms or WCF)... And DNN is a "huge ASP.NET" app with a lot of classlibs, which are so tightly coupled together that there is no way to debug part of them outside of running DNN instance - with all the consequences - bad luck... I suppose you can edit DNN's Data Context Objects source code from AppCode outside of VS (e.g. within notepad) - when the edits are saved then DNN will restart, that could take a while, quite a while.... A temp solution could be to keep *all* the source code of DNN module's control within that control's code behind .aspx.cs (.aspx.vb) during development - when you edit your code there then ASP.NET app will not restart it will just recompile .aspx and .aspx.cs - so it should work considerably quicker... All in all I think DNN custom modules development is a RPITA - one can never know how much it will finally take for a given project if they will not try to find a way to debug/ test as much as possible code outside of running DNN: something like develop a separate ASP.NET application, make it working and then port it to DNN environmnet... Be prepared for "crazy debug sessions" (if I'm not missing something and there are some "miracle" tools, which simplify DNN custom development debugging)... Philosophic note: DNN seems to be a good example that there "are no miracles in this world" - DNN is a great prototyping tool and CMS, when one has ready to use DNN modules and skins, and DNN is becoming RPITA when one have to develop a(n) (advanced) custom module. Rhetoric Question: Why in this world there couldn't be a "silver-bullet" tool able to support both standard and custom development with the same ease as DNN does support CMS development? I guess "Ruby on Rails" could be "what doctor ordered"?... Or ASP.NET MVC2 Framework? DNN did grow from a "junky" MS ASP.NET sample code base, and even advanced developers as DNN Core Development Team members are can't still "convert" that original "junk" to pearls... Hopefully they will do that in DNN v.7? - they "just" need to clean-up DNN huge code base and to implement what is called "Inversion of Control" (http://martinfowler.com/articles/injection.html) to "untight" DNN Core classlibs as much as possible... Please correct me if I'm wrong - in fact I'd be really happy to be wrong here as I have had to suspend one of the DNN projects, which didn't go smoothly because of PITA DNN custom modules development experience... Sorry, Mark, I have no a definitive answer for you here - just some "soap" and "bubbles" and PITA of my own DNN custom modules development experience, which I need to find a way to workaround, or quit the idea of DNN custom development completely as it's too expensive to be true. Still hope I missed some approaches to simplify this development - I mean ready to use approaches and tools without long learning curve... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Wednesday, December 02, 2009 1:23 PM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Why are my data Context Objects soooo sloooow Hello All, I am running VS 2008 on a powerful machine with loads of resources. My project is a DNN project sitting in the wwwroot folder which allows me to change a few lines of code and then immediately see the results in the web app. However, when I manipulate the Data Context Objects in the AppCode Folder, the response times are dreadfully, slow. It takes three to four minutes to open, edit, save and close one of these objects. I have tried it on a second machine and the results are similar. I can edit the Dbml files outside of the solution, but I am not sure whether that is safe to do so, when I edit them outside the solution (copying and pasting to another folder and then opening the dbml file from there), they open instantly. When I say "safe to do so", does the project file or the sln file need to be updated with the changes that have been made. I do get some warning message about "cannot find web.config, so using the file from the dbml file instead" which I accepted. I recall Shamil mentioned that manually editing these within the individual files is not a good idea, so i guess that he may have been suffering the same problems as I am, IE so sloooow to open and close. TIA for an help, if I have not expressed the problem clearly enough, let me know, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From marklbreen at gmail.com Wed Dec 2 07:39:14 2009 From: marklbreen at gmail.com (Mark Breen) Date: Wed, 2 Dec 2009 13:39:14 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Message-ID: Hello Shamil, Thank you for your detailed response. *Browsers* Some comments, I am actually using Chrome to View my work, but I am not doing any debugging, in the traditional sense, I code a few lines, click save and then view the results in Chrome, when I am not happy, I flick back to VS, change it and continue again. So, it is true to say, I am not really debugging, just viewing. However, I stopped using IE a few years ago, and since I switched to Chrome, it is the first thing I install on new machines. With the exception of the MSDN site, it works perfect for me. *Slow Data Contexts* So can I assume that this slowness is simply to be accepted, it is either a) the way VS2008 usually performs, or b) the way VS2008 performs when data contexts are involved in a large project such as DNN. I did not notice any difference when I copied the code from the wwwroot folder, so I hope that is not part of the problem. *DNN Development* Probably I am not doing real DNN custom programming, but I am currently building web user controls, and simply saving them, and then creating a module for DNN and including the web user control on that module. I know this is not real DNN programming, but have created about 20 module so far like this. DNN gives me, as a script kiddie type programmer, they ability to do a simple web app, but it manages the users and authentication, something that I could never program. IOW, with the exception of a few DNN hooks, I am doing simple programming, but throwing the results into DNN. *Free Lunch* I have to say I agree with you, there are limitations everywhere. My appoach is always to keep it as simple as possible until I absolutely know that I need to make it more complex. Thanks, Mark 2009/12/2 Shamil Salakhetdinov > Hello Mark -- > > First of all try to switch to FireFox - forget IE while debugging large > ASP.NET apps from within VS.... > > I can only note that debugging large ASP.NET applications is a real PITA > - > this is why I'm always trying to get out as much as possible BL and DAL > code > into separate projects and develop, debug/test them without UI (ASP.NET or > WinForms or WCF)... > > And DNN is a "huge ASP.NET" app with a lot of classlibs, which are so > tightly coupled together that there is no way to debug part of them outside > of running DNN instance - with all the consequences - bad luck... > > I suppose you can edit DNN's Data Context Objects source code from AppCode > outside of VS (e.g. within notepad) - when the edits are saved then DNN > will > restart, that could take a while, quite a while.... > > A temp solution could be to keep *all* the source code of DNN module's > control within that control's code behind .aspx.cs (.aspx.vb) during > development - when you edit your code there then ASP.NET app will not > restart it will just recompile .aspx and .aspx.cs - so it should work > considerably quicker... > > All in all I think DNN custom modules development is a RPITA - one can > never > know how much it will finally take for a given project if they will not try > to find a way to debug/ test as much as possible code outside of running > DNN: something like develop a separate ASP.NET application, make it > working > and then port it to DNN environmnet... > > Be prepared for "crazy debug sessions" (if I'm not missing something and > there are some "miracle" tools, which simplify DNN custom development > debugging)... > > Philosophic note: DNN seems to be a good example that there "are no > miracles > in this world" - DNN is a great prototyping tool and CMS, when one has > ready > to use DNN modules and skins, and DNN is becoming RPITA when one have to > develop a(n) (advanced) custom module. Rhetoric Question: Why in this world > there couldn't be a "silver-bullet" tool able to support both standard and > custom development with the same ease as DNN does support CMS development? > > I guess "Ruby on Rails" could be "what doctor ordered"?... > > Or ASP.NET MVC2 Framework? > > DNN did grow from a "junky" MS ASP.NET sample code base, and even advanced > developers as DNN Core Development Team members are can't still "convert" > that original "junk" to pearls... > > Hopefully they will do that in DNN v.7? - they "just" need to clean-up DNN > huge code base and to implement what is called "Inversion of Control" > (http://martinfowler.com/articles/injection.html) to "untight" DNN Core > classlibs as much as possible... > > Please correct me if I'm wrong - in fact I'd be really happy to be wrong > here as I have had to suspend one of the DNN projects, which didn't go > smoothly because of PITA DNN custom modules development experience... > > Sorry, Mark, I have no a definitive answer for you here - just some "soap" > and "bubbles" and PITA of my own DNN custom modules development experience, > which I need to find a way to workaround, or quit the idea of DNN custom > development completely as it's too expensive to be true. Still hope I > missed > some approaches to simplify this development - I mean ready to use > approaches and tools without long learning curve... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Wednesday, December 02, 2009 1:23 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello All, > > I am running VS 2008 on a powerful machine with loads of resources. My > project is a DNN project sitting in the wwwroot folder which allows me to > change a few lines of code and then immediately see the results in the web > app. > > However, when I manipulate the Data Context Objects in the AppCode Folder, > the response times are dreadfully, slow. It takes three to four minutes to > open, edit, save and close one of these objects. > > I have tried it on a second machine and the results are similar. > > I can edit the Dbml files outside of the solution, but I am not sure > whether > that is safe to do so, when I edit them outside the solution (copying and > pasting to another folder and then opening the dbml file from there), they > open instantly. When I say "safe to do so", does the project file or the > sln file need to be updated with the changes that have been made. I do get > some warning message about "cannot find web.config, so using the file from > the dbml file instead" which I accepted. > > I recall Shamil mentioned that manually editing these within the individual > files is not a good idea, so i guess that he may have been suffering the > same problems as I am, IE so sloooow to open and close. > > TIA for an help, if I have not expressed the problem clearly enough, let me > know, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Wed Dec 2 08:28:45 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 17:28:45 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> Message-ID: <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Hi Mark, <<< *Slow Data Contexts* >>> What do you mean by that? - editing and saving your DNN Data Context Objects source code in \AppCode subfolder? What do you mean by "Dbml"? <<< but have created about 20 module so far like this. >>> OK, I have also made 30+ DNN5.x custom modules properly packed etc. - all very similar to each other but to get the first one was a time-consuming issue. "Tired" from that. Need a break. Then I maybe will make some more... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Wednesday, December 02, 2009 4:39 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow Hello Shamil, Thank you for your detailed response. *Browsers* Some comments, I am actually using Chrome to View my work, but I am not doing any debugging, in the traditional sense, I code a few lines, click save and then view the results in Chrome, when I am not happy, I flick back to VS, change it and continue again. So, it is true to say, I am not really debugging, just viewing. However, I stopped using IE a few years ago, and since I switched to Chrome, it is the first thing I install on new machines. With the exception of the MSDN site, it works perfect for me. *Slow Data Contexts* So can I assume that this slowness is simply to be accepted, it is either a) the way VS2008 usually performs, or b) the way VS2008 performs when data contexts are involved in a large project such as DNN. I did not notice any difference when I copied the code from the wwwroot folder, so I hope that is not part of the problem. *DNN Development* Probably I am not doing real DNN custom programming, but I am currently building web user controls, and simply saving them, and then creating a module for DNN and including the web user control on that module. I know this is not real DNN programming, but have created about 20 module so far like this. DNN gives me, as a script kiddie type programmer, they ability to do a simple web app, but it manages the users and authentication, something that I could never program. IOW, with the exception of a few DNN hooks, I am doing simple programming, but throwing the results into DNN. *Free Lunch* I have to say I agree with you, there are limitations everywhere. My appoach is always to keep it as simple as possible until I absolutely know that I need to make it more complex. Thanks, Mark <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4654 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 2 09:51:31 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 10:51:31 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> Message-ID: <4B168D03.3010706@colbyconsulting.com> Shamil, As I have discussed in the past, the business is doing the exact same process to many different tables. Because of the size of these tables and the processing involved I find it useful to store each table in it's own database. These are just lists of names, each list comes from a different source and is called something by the client, something that makes sense to him. These lists (a table) will always be millions of names / addresses, and often are 50 million or more. When you have 50 million names, the database, with just this one single table will be 10 or 20 gigabytes. Once you start processing it can mushroom to 50 gigabytes. Thus storing a dozen of these tables in a single database just doesn't make sense (to me). Thus I have a dozen different databases. I have to apply all of these stored procedures to each one of these databases once a month. Thus write the stored procedure such that I can pass in a database name and a table name. Voila, the SP works for all of my databases. But that means dynamic SQL. I really don't have an issue with dynamic SQL, although I have witnessed first hand the time required for SQL Server to do the "compile" - creating the execution plan. If I run the SP a second time with the same db and table name the time to execute drops sharply. BTW, these lists become the source for "orders" of names. Each of these orders also are stored in its own database, and I have to execute these same (or similar) SPs against each of these orders. Over the last 4 years I have perhaps a hundred of these order databases. This is what I do for this client, create these databases, and apply processes against these databases. The processes are exactly the same across all of the databases, thus having a stored procedure that performs some part of that process but can be applied to any of these databases makes sense (to me). I have spent the last five years performing these processes entirely manually, then one by one creating a stored procedure to automate one of the steps, then the next step, and the next. By now I have an entire master library with (let me go check) 42 different stored procedures that, taken together, automate my work for the client. THAT is the point of the C# side of things. Automating the automation so to speak. Taking these 42 stored procedures and stringing sets of them together, 7 which perform the output of data to an external program for processing, 6 more that get the processed data back in, a half dozen more that perform some other processing, another set that do order processing, etc. This is not a bank, or a company or a call center or a manufacturer, or any of the other "typical" SQL Server databases. It is name / address list processing and creating orders from these lists. Really pretty simple but extremely painstaking. And like anything else we do, I can't be making mistakes, it must be done in a specific manner, a specific sequence, EVERY time. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > I must say I have never done that "dynamic" t-SQL via C# - I guess it should > be doable: using SMO or even SqlCommand's .ExecuteNonQuery(?) it should be > possible to create SPs and UDFs, and then execute them as usual... > > BTW, UDFs, which return tables are very often a good substitute for all > kinds of temp tables and dynamic SQL... > > I wonder what for all that "dynamism" there? > Do you have constantly changing database structure? > Do you have constantly changing customer requests, which do not allow you to > create a set of stable parameterized SPs and UDFs, and for small(?) changing > part of queries use LINQ for SQL or ADO.NET EF? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 02, 2009 1:54 AM > To: VBA > Subject: [dba-VB] C# - Direct data manipulation > > As previously mentioned, over the last couple of years I have built up a set > of stored procedures > which perform TSQL. I then run sets of these stored procedures to perform > processes. The TSQL is > always dynamic. > > As an example a stored procedure might build a table, with boilerplate field > names and data types, > but a passed in database and table name. Inside of the stored procedure I > build up the correct SQL > to create the table in the database specified, with the name specified. > Another stored procedure > might create in index, with boilerplate field names, but a passed in > database and table name. Again > the stored procedure builds up the TSQL statement to create the index in the > correct db and table. > > I already have these stored procedures debugged and working and have been > using them in sets to > perform "big picture processes" for quite some time, but the whole "execute > a stored procedure" > using a command object, parameter objects in a parameter array, interpreting > the parameters etc just > seems so... 1950s. I feel like I am flipping switches on the front panel of > a computer in a 50s > sci-fi movie as a tape reel spins madly in the background. > > Now that I am moving to C# I am wondering if this is required any more. Can > C# execute TSQL > directly somehow? Can I assemble this boiler plate plus database / table > kind of thing into a TSQL > statement directly in C# and then somehow tell SQL Server to execute that > TSQL? I understand the > "SQL optimization" thing but it seems like (not sure here) that because the > TSQL is dynamically > constructed in the stored procedure, the whole "optimization" thing goes > right out the window. If I > can execute TSQL directly from C#, what can I get back? Rows affected? > Error codes? And how? > > As it stands I am happily flipping switches, tape reels whirring, exporting > data for address > validation. This is good, I am happy, but ... > From paul.hartland at googlemail.com Wed Dec 2 10:05:20 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Wed, 2 Dec 2009 16:05:20 +0000 Subject: [dba-VB] Read XML File Using xsd Schema File Message-ID: <38c884770912020805s570c99e1ia753bf4f81b4d0f7@mail.gmail.com> To all, We have been a given what looks to me like a fairly complex XML file, we have also been given a xsd schema file. I tried using the SQLXMLBulkLoad object in VB6 and was getting the error Schema: relationship expected on 'Company'. The company that gave us both the files insist that the xsd is correct (according to my project manager). I downloaded and installed Stylus Studio 2010, with which I loaded the XML, and then generated my own xsd schame file. Tried again and this time get the same error as above, but instead of 'Company' the error was 'Groups' The VB6 code I am using is as follows: Dim objBL Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1" objBL.KeepIdentity = True objBL.errorlogfile = "C:\XML_StylusStudio\Error.log" objBL.checkconstraints = True objBL.xmlfragment = True objBL.schemagen = True objBL.sgdroptables = True objBL.Execute "C:\XML_StylusStudio\newschema.xsd", "C:\XML_StylusStudio\CDFull_Original.xml" Set objBl=Nothing The object of the exercise being that we generate related tables in SQL Server 2005 of the XML data. Would be grateful if anyone could help with this (would be happy to send example XML file and the schema offline), as I haven't got much hair left to pull out. Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From shamil at smsconsulting.spb.ru Wed Dec 2 11:23:04 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 20:23:04 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B168D03.3010706@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> Message-ID: <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> Hi John -- Thank you for your reply. Do you use your different databases for data input, or you also have to update those different databases' tables? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 6:52 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, As I have discussed in the past, the business is doing the exact same process to many different tables. Because of the size of these tables and the processing involved I find it useful to store each table in it's own database. These are just lists of names, each list comes from a different source and is called something by the client, something that makes sense to him. These lists (a table) will always be millions of names / addresses, and often are 50 million or more. When you have 50 million names, the database, with just this one single table will be 10 or 20 gigabytes. Once you start processing it can mushroom to 50 gigabytes. Thus storing a dozen of these tables in a single database just doesn't make sense (to me). Thus I have a dozen different databases. I have to apply all of these stored procedures to each one of these databases once a month. Thus write the stored procedure such that I can pass in a database name and a table name. Voila, the SP works for all of my databases. But that means dynamic SQL. I really don't have an issue with dynamic SQL, although I have witnessed first hand the time required for SQL Server to do the "compile" - creating the execution plan. If I run the SP a second time with the same db and table name the time to execute drops sharply. BTW, these lists become the source for "orders" of names. Each of these orders also are stored in its own database, and I have to execute these same (or similar) SPs against each of these orders. Over the last 4 years I have perhaps a hundred of these order databases. This is what I do for this client, create these databases, and apply processes against these databases. The processes are exactly the same across all of the databases, thus having a stored procedure that performs some part of that process but can be applied to any of these databases makes sense (to me). I have spent the last five years performing these processes entirely manually, then one by one creating a stored procedure to automate one of the steps, then the next step, and the next. By now I have an entire master library with (let me go check) 42 different stored procedures that, taken together, automate my work for the client. THAT is the point of the C# side of things. Automating the automation so to speak. Taking these 42 stored procedures and stringing sets of them together, 7 which perform the output of data to an external program for processing, 6 more that get the processed data back in, a half dozen more that perform some other processing, another set that do order processing, etc. This is not a bank, or a company or a call center or a manufacturer, or any of the other "typical" SQL Server databases. It is name / address list processing and creating orders from these lists. Really pretty simple but extremely painstaking. And like anything else we do, I can't be making mistakes, it must be done in a specific manner, a specific sequence, EVERY time. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Dec 2 11:27:33 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 02 Dec 2009 18:27:33 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John et al Don't forget LINQPad. Why LINQ beats SQL: http://www.linqpad.net/WhyLINQBeatsSQL.aspx /gustav >>> Gustav at cactus.dk 02-12-2009 08:19 >>> Hi John As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. /gustav >>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> As previously mentioned, over the last couple of years I have built up a set of stored procedures which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is always dynamic. As an example a stored procedure might build a table, with boilerplate field names and data types, but a passed in database and table name. Inside of the stored procedure I build up the correct SQL to create the table in the database specified, with the name specified. Another stored procedure might create in index, with boilerplate field names, but a passed in database and table name. Again the stored procedure builds up the TSQL statement to create the index in the correct db and table. I already have these stored procedures debugged and working and have been using them in sets to perform "big picture processes" for quite some time, but the whole "execute a stored procedure" using a command object, parameter objects in a parameter array, interpreting the parameters etc just seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s sci-fi movie as a tape reel spins madly in the background. Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? As it stands I am happily flipping switches, tape reels whirring, exporting data for address validation. This is good, I am happy, but ... -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 2 12:34:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 13:34:54 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> Message-ID: <4B16B34E.8050702@colbyconsulting.com> Shamil, I receive lists of names in CSV or fixed width files. I import those into SQL Server, creating a PKID in the process. I then have to export the PKID plus the name / address monthly for address validation. Once validated, I have to import the data back in. This is the monthly process. Approximately 1% of all the people on any given list move each month. So I have to go back in to the original list and update 1% of the addresses, or simply swap out the new list (table) for the old. There is never any manual processing of individual names inside of these lists, IOW people never look at them, modify them, add new ones, delete address or anything like that. The list is "stable" in that regard. These lists become the source for orders of names. Orders are a whole 'nother process, but also use SPs to do their thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your reply. > > Do you use your different databases for data input, or you also have to > update those different databases' tables? > > -- > Shamil From jwcolby at colbyconsulting.com Wed Dec 2 12:46:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 13:46:09 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B16B5F1.4040003@colbyconsulting.com> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav > > >>>> jwcolby at colbyconsulting.com 01-12-2009 23:53 >>> > As previously mentioned, over the last couple of years I have built up a set of stored procedures > which perform TSQL. I then run sets of these stored procedures to perform processes. The TSQL is > always dynamic. > > As an example a stored procedure might build a table, with boilerplate field names and data types, > but a passed in database and table name. Inside of the stored procedure I build up the correct SQL > to create the table in the database specified, with the name specified. Another stored procedure > might create in index, with boilerplate field names, but a passed in database and table name. Again > the stored procedure builds up the TSQL statement to create the index in the correct db and table. > > I already have these stored procedures debugged and working and have been using them in sets to > perform "big picture processes" for quite some time, but the whole "execute a stored procedure" > using a command object, parameter objects in a parameter array, interpreting the parameters etc just > seems so... 1950s. I feel like I am flipping switches on the front panel of a computer in a 50s > sci-fi movie as a tape reel spins madly in the background. > > Now that I am moving to C# I am wondering if this is required any more. Can C# execute TSQL > directly somehow? Can I assemble this boiler plate plus database / table kind of thing into a TSQL > statement directly in C# and then somehow tell SQL Server to execute that TSQL? I understand the > "SQL optimization" thing but it seems like (not sure here) that because the TSQL is dynamically > constructed in the stored procedure, the whole "optimization" thing goes right out the window. If I > can execute TSQL directly from C#, what can I get back? Rows affected? Error codes? And how? > > As it stands I am happily flipping switches, tape reels whirring, exporting data for address > validation. This is good, I am happy, but ... > From shamil at smsconsulting.spb.ru Wed Dec 2 13:19:29 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 2 Dec 2009 22:19:29 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B16B34E.8050702@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> Message-ID: <00d501ca7384$600b48b0$2021da10$@spb.ru> John -- Have you tried to use MS SQL database filegroups and partitioned tables & views? http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx With them I suppose only initial import/insert of data have to be parameterized with table name, and the rest can be done without any dynamic T-SQL. Please correct me if I'm wrong. Please note I'm not trying to "force" you to change your current working solution - just wondering is there a legal way to solve your task without dynamic T-SQL... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 9:35 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, I receive lists of names in CSV or fixed width files. I import those into SQL Server, creating a PKID in the process. I then have to export the PKID plus the name / address monthly for address validation. Once validated, I have to import the data back in. This is the monthly process. Approximately 1% of all the people on any given list move each month. So I have to go back in to the original list and update 1% of the addresses, or simply swap out the new list (table) for the old. There is never any manual processing of individual names inside of these lists, IOW people never look at them, modify them, add new ones, delete address or anything like that. The list is "stable" in that regard. These lists become the source for orders of names. Orders are a whole 'nother process, but also use SPs to do their thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Thank you for your reply. > > Do you use your different databases for data input, or you also have to > update those different databases' tables? > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4655 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 2 13:32:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 02 Dec 2009 14:32:10 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <00d501ca7384$600b48b0$2021da10$@spb.ru> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> <00d501ca7384$600b48b0$2021da10$@spb.ru> Message-ID: <4B16C0BA.7010601@colbyconsulting.com> Shamil, I have not. All of that is rather esoteric stuff for a non DBA. My job is processing data, and that is only a small part of my job, i.e. this is only one of many clients, and the only one that needs this kind of SQL Server stuff. As I have said many times, if my job was to go into a company every day and play DBA then I would learn many more things SQL Server related. As things stand I learn just enough to make things work, and a LITTLE extra in search of efficiency. It is certainly not that I don't want to, I just don't have the time. In the end I find the method I use comfortable from many angles. I have to do some things that require creating views, other "processing" tables and so forth. It really just works (for me) to do things this way, have separate databases to hold all of the "junk" associated with each list. Kind of the old "encapsulation" thing. Your suggestion would of course end up with all tables inside of a single "database", and as such the need for the Database parameter would go away but I still have to do the same thing to many different tables. Again, could this be done by one of the experts on the SQL Server list. Probably! Will I ever get there? Uhhhh doubtful. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > John -- > > Have you tried to use MS SQL database filegroups and partitioned tables & > views? > > http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx > > With them I suppose only initial import/insert of data have to be > parameterized with table name, and the rest can be done without any dynamic > T-SQL. Please correct me if I'm wrong. > > Please note I'm not trying to "force" you to change your current working > solution - just wondering is there a legal way to solve your task without > dynamic T-SQL... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 02, 2009 9:35 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# - Direct data manipulation > > Shamil, > From dbdoug at gmail.com Wed Dec 2 19:27:15 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 2 Dec 2009 17:27:15 -0800 Subject: [dba-VB] NorthwindNet time summary Message-ID: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> I believe that some time after the NorthwindNet project was finished, someone (Shamil?) posted an email with a summary of the time taken/number of forms/number of reports, etc. But I can't find it in my archives. I'm having a (friendly so far) discussion with a client who has given me an extremely ambitious schedule for converting a big Access project to C# ASP.NET, and I'd like some ammunition for my side of the argument! Thanks, Doug Steele From dwaters at usinternet.com Wed Dec 2 19:34:28 2009 From: dwaters at usinternet.com (Dan Waters) Date: Wed, 2 Dec 2009 19:34:28 -0600 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> Message-ID: Hi Doug, I used this site as well in making a quote to convert an Access System to a VB System. http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 Good Luck! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, December 02, 2009 7:27 PM To: dba-vb Subject: [dba-VB] NorthwindNet time summary I believe that some time after the NorthwindNet project was finished, someone (Shamil?) posted an email with a summary of the time taken/number of forms/number of reports, etc. But I can't find it in my archives. I'm having a (friendly so far) discussion with a client who has given me an extremely ambitious schedule for converting a big Access project to C# ASP.NET, and I'd like some ammunition for my side of the argument! Thanks, Doug Steele _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dbdoug at gmail.com Wed Dec 2 20:57:03 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 2 Dec 2009 18:57:03 -0800 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> Message-ID: <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> Perfect! Thanks, Dan. Doug On Wed, Dec 2, 2009 at 5:34 PM, Dan Waters wrote: > Hi Doug, > > I used this site as well in making a quote to convert an Access System to a > VB System. > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > Good Luck! > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, December 02, 2009 7:27 PM > To: dba-vb > Subject: [dba-VB] NorthwindNet time summary > > I believe that some time after the NorthwindNet project was finished, > someone (Shamil?) posted an email with a summary of the time taken/number > of > forms/number of reports, etc. But I can't find it in my archives. > > I'm having a (friendly so far) discussion with a client who has given me an > extremely ambitious schedule for converting a big Access project to C# > ASP.NET, and I'd like some ammunition for my side of the argument! > > Thanks, > > Doug Steele > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Thu Dec 3 05:29:49 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 14:29:49 +0300 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: <4B16C0BA.7010601@colbyconsulting.com> References: <4B159E83.4000006@colbyconsulting.com> <009e01ca731c$4b3f5240$e1bdf6c0$@spb.ru> <4B168D03.3010706@colbyconsulting.com> <00ce01ca7374$1ce4aeb0$56ae0c10$@spb.ru> <4B16B34E.8050702@colbyconsulting.com> <00d501ca7384$600b48b0$2021da10$@spb.ru> <4B16C0BA.7010601@colbyconsulting.com> Message-ID: <00f601ca740b$ee013800$ca03a800$@spb.ru> Hi John -- OK. Don't break it with implementation of other approaches if it works... Just for the future projects - I suppose (I might be missing something as I do not have that experience but I plan to try, maybe within our Northwind.NET project) this partitioning stuff is just practical for the tasks as you do (similar stuff was available for non-relational DBMSs in the end of 70-es/beginning of 80ies, and for Oracle it's available for years now AFAIHH), and this stuff doesn't take that much time to learn (one day?) and use (a few short reusable T-SQL scripts?) that it would take to program and to test and to support dynamic T-SQ: for many SPs and UDFs... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 02, 2009 10:32 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Direct data manipulation Shamil, I have not. All of that is rather esoteric stuff for a non DBA. My job is processing data, and that is only a small part of my job, i.e. this is only one of many clients, and the only one that needs this kind of SQL Server stuff. As I have said many times, if my job was to go into a company every day and play DBA then I would learn many more things SQL Server related. As things stand I learn just enough to make things work, and a LITTLE extra in search of efficiency. It is certainly not that I don't want to, I just don't have the time. In the end I find the method I use comfortable from many angles. I have to do some things that require creating views, other "processing" tables and so forth. It really just works (for me) to do things this way, have separate databases to hold all of the "junk" associated with each list. Kind of the old "encapsulation" thing. Your suggestion would of course end up with all tables inside of a single "database", and as such the need for the Database parameter would go away but I still have to do the same thing to many different tables. Again, could this be done by one of the experts on the SQL Server list. Probably! Will I ever get there? Uhhhh doubtful. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4656 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Thu Dec 3 05:29:49 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 14:29:49 +0300 Subject: [dba-VB] NorthwindNet time summary In-Reply-To: <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> References: <4dd71a0c0912021727u35f75862s7c0f61d8ee1bed93@mail.gmail.com> <4dd71a0c0912021857s7918a4e6gaa0d58d309d57f2b@mail.gmail.com> Message-ID: <00f701ca740b$ef56b5e0$ce0421a0$@spb.ru> Hi Dan and Doug, If that stats will help you to quote and to plan your projects, please write a short note to be posted there (myself or Gustav can post it) http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 This project is currently in suspended state, and good feedback might help to plan and to implement some useful follow-ups. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Thursday, December 03, 2009 5:57 AM To: dwaters; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] NorthwindNet time summary Perfect! Thanks, Dan. Doug On Wed, Dec 2, 2009 at 5:34 PM, Dan Waters wrote: > Hi Doug, > > I used this site as well in making a quote to convert an Access System to a > VB System. > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > Good Luck! > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, December 02, 2009 7:27 PM > To: dba-vb > Subject: [dba-VB] NorthwindNet time summary > > I believe that some time after the NorthwindNet project was finished, > someone (Shamil?) posted an email with a summary of the time taken/number > of > forms/number of reports, etc. But I can't find it in my archives. > > I'm having a (friendly so far) discussion with a client who has given me an > extremely ambitious schedule for converting a big Access project to C# > ASP.NET, and I'd like some ammunition for my side of the argument! > > Thanks, > > Doug Steele __________ Information from ESET NOD32 Antivirus, version of virus signature database 4656 (20091202) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Thu Dec 3 06:08:57 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 15:08:57 +0300 Subject: [dba-VB] C# 4.0: ExpandoObject, dynamic ... Message-ID: <00fa01ca7411$65b61be0$312253a0$@spb.ru> Hi All, Here is information on C# 4.0: ExpandoObject, dynamic etc. - you can see here why all that stuff is more powerful and useful than VB6/VBA late binding... http://blogs.msdn.com/csharpfaq/archive/2009/10/01/dynamic-in-c-4-0-introduc ing-the-expandoobject.aspx http://blogs.msdn.com/csharpfaq/archive/2009/10/19/dynamic-in-c-4-0-creating -wrappers-with-dynamicobject.aspx Thank you. -- Shamil From marklbreen at gmail.com Thu Dec 3 08:34:16 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 3 Dec 2009 14:34:16 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Message-ID: Hello Shamil, In VS2008, when I create a folder in app_Code, and then create a new Linq to SQL Class is it assigned the extention of dbml, default name is DataClasses.dbml It is these classes that are sooo slooow to do anything with. I timed the time it takes to just click create, drop a table onto the design surface, and then click save. It is taking 4 minutes to do that, so when I needed 20 - 25 objects or so, I have to sit like a donkey and click for almost two hours. It still takes four minutes to open and edit one. A PITA for sure. If I open the class as a standalone file, I can operate with instant performance, but it does not play well with the project/ solution. I have to say, I wish I knew more about these data classes and how they really should be used in real world applications. Thanks Mark 2009/12/2 Shamil Salakhetdinov > Hi Mark, > > <<< > *Slow Data Contexts* > >>> > What do you mean by that? - editing and saving your DNN Data Context > Objects > source code in \AppCode subfolder? > What do you mean by "Dbml"? > > <<< > but have created about 20 module so far > like this. > >>> > OK, I have also made 30+ DNN5.x custom modules properly packed etc. - all > very similar to each other but to get the first one was a time-consuming > issue. "Tired" from that. Need a break. Then I maybe will make some more... > > Thank you. > > -- > Shamil > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Wednesday, December 02, 2009 4:39 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello Shamil, > > Thank you for your detailed response. > > *Browsers* > Some comments, I am actually using Chrome to View my work, but I am not > doing any debugging, in the traditional sense, I code a few lines, click > save and then view the results in Chrome, when I am not happy, I flick back > to VS, change it and continue again. So, it is true to say, I am not > really > debugging, just viewing. However, I stopped using IE a few years ago, and > since I switched to Chrome, it is the first thing I install on new > machines. > With the exception of the MSDN site, it works perfect for me. > > > *Slow Data Contexts* > So can I assume that this slowness is simply to be accepted, it is either > a) > the way VS2008 usually performs, or b) the way VS2008 performs when data > contexts are involved in a large project such as DNN. I did not notice any > difference when I copied the code from the wwwroot folder, so I hope that > is > not part of the problem. > > *DNN Development* > Probably I am not doing real DNN custom programming, but I am currently > building web user controls, and simply saving them, and then creating a > module for DNN and including the web user control on that module. I know > this is not real DNN programming, but have created about 20 module so far > like this. DNN gives me, as a script kiddie type programmer, they ability > to do a simple web app, but it manages the users and authentication, > something that I could never program. > > IOW, with the exception of a few DNN hooks, I am doing simple programming, > but throwing the results into DNN. > > > *Free Lunch* > I have to say I agree with you, there are limitations everywhere. My > appoach is always to keep it as simple as possible until I absolutely know > that I need to make it more complex. > > > > Thanks, > > Mark > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4654 (20091202) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Thu Dec 3 09:08:28 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 3 Dec 2009 18:08:28 +0300 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> Message-ID: <012201ca742a$79c0d710$6d428530$@spb.ru> Hello Mark -- OK, I suppose you can create custom DLL(s) working with LINQ to SQL in a solution outside of your custom DNN solution, and then just use your custom DLL within custom DNN solution - your LINQ to SQL objects from DLL should be public and this DLL should also have its own config file... I have done something like that but with POCO-objects (http://en.wikipedia.org/wiki/Plain_Old_CLR_Object), which I used as ObjectDataSources for web forms within DNN custom solutions' custom modules... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Thursday, December 03, 2009 5:34 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow Hello Shamil, In VS2008, when I create a folder in app_Code, and then create a new Linq to SQL Class is it assigned the extention of dbml, default name is DataClasses.dbml It is these classes that are sooo slooow to do anything with. I timed the time it takes to just click create, drop a table onto the design surface, and then click save. It is taking 4 minutes to do that, so when I needed 20 - 25 objects or so, I have to sit like a donkey and click for almost two hours. It still takes four minutes to open and edit one. A PITA for sure. If I open the class as a standalone file, I can operate with instant performance, but it does not play well with the project/ solution. I have to say, I wish I knew more about these data classes and how they really should be used in real world applications. Thanks Mark <<< snip>>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4658 (20091203) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From marklbreen at gmail.com Thu Dec 3 16:01:58 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 3 Dec 2009 22:01:58 +0000 Subject: [dba-VB] Why are my data Context Objects soooo sloooow In-Reply-To: <012201ca742a$79c0d710$6d428530$@spb.ru> References: <00ae01ca7352$2eaf8dd0$8c0ea970$@spb.ru> <00bb01ca735b$c5c1a1a0$5144e4e0$@spb.ru> <012201ca742a$79c0d710$6d428530$@spb.ru> Message-ID: Hello Shamil, I guess this is an option for me, but to be honest, it will probably more easier for me to take the delay of waiting that attempt to manage the additional layer of complexity. As with all things in life, I suppose if I take the time to review this, it will save me time, but I am afraid to spend a day on it only to save myself a few minutes a few times a day. Thanks any way for the suggestion, Mark 2009/12/3 Shamil Salakhetdinov > Hello Mark -- > > OK, I suppose you can create custom DLL(s) working with LINQ to SQL in a > solution outside of your custom DNN solution, and then just use your custom > DLL within custom DNN solution - your LINQ to SQL objects from DLL should > be > public and this DLL should also have its own config file... > > I have done something like that but with POCO-objects > (http://en.wikipedia.org/wiki/Plain_Old_CLR_Object), which I used as > ObjectDataSources for web forms within DNN custom solutions' custom > modules... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, December 03, 2009 5:34 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Why are my data Context Objects soooo sloooow > > Hello Shamil, > > In VS2008, when I create a folder in app_Code, and then create a new Linq > to > SQL Class is it assigned the extention of dbml, default name is > DataClasses.dbml > > It is these classes that are sooo slooow to do anything with. I timed the > time it takes to just click create, drop a table onto the design surface, > and then click save. It is taking 4 minutes to do that, so when I needed > 20 > - 25 objects or so, I have to sit like a donkey and click for almost two > hours. > > It still takes four minutes to open and edit one. > > A PITA for sure. > > If I open the class as a standalone file, I can operate with > instant performance, but it does not play well with the project/ solution. > > I have to say, I wish I knew more about these data classes and how they > really should be used in real world applications. > > Thanks > > Mark > > > <<< snip>>> > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4658 (20091203) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Dec 3 17:38:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 03 Dec 2009 18:38:39 -0500 Subject: [dba-VB] Application settings Message-ID: <4B184BFF.6040203@colbyconsulting.com> I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Thu Dec 3 18:07:23 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 4 Dec 2009 11:07:23 +1100 Subject: [dba-VB] Application settings References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> Hi John, Is this what your after? global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting = "New Value"; global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); cheers Michael M I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From cfoust at infostatsystems.com Thu Dec 3 18:26:56 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 3 Dec 2009 18:26:56 -0600 Subject: [dba-VB] Application settings In-Reply-To: <4B184BFF.6040203@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: - - 0 Microsoft.Jet.OLEDB.4.0 C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb RIMUser false - 1 sqloledb infoserver RIMDrillDataSQL true We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. Shared ds As DataSet Shared _connectionString As String Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath Private Shared Sub ReadSettingsFile() If IO.File.Exists(_xmlPath) Then Call CreateSchema() ds.ReadXml(_xmlPath) Call DecryptPassword() _connectionString = GetConnectionString() Else If ds.Tables(0).Rows.Count = 0 Then 'placeholder for jet settings Dim row As DataRow = ds.Tables(0).NewRow row("dbtype") = 0 row("provider") = "Microsoft.Jet.OLEDB.4.0" ds.Tables(0).Rows.Add(row) 'placeholder for sql settings row = ds.Tables(0).NewRow row("dbtype") = 1 row("provider") = "sqloledb" ds.Tables(0).Rows.Add(row) End If End If End Sub Private Shared Sub CreateSchema() ds = New DataSet Dim table As New DataTable("connection") table.Columns.Add("dbtype", GetType(Integer)) table.Columns.Add("provider", GetType(String)) table.Columns.Add("datasource", GetType(String)) table.Columns.Add("userid", GetType(String)) table.Columns.Add("password", GetType(String)) table.Columns.Add("initialcatalog", GetType(String)) table.Columns.Add("trusted", GetType(Boolean)) table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} ds.Tables.Add(table) End Sub Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 03, 2009 3:39 PM To: VBA Subject: [dba-VB] Application settings I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Thu Dec 3 18:43:32 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Fri, 4 Dec 2009 11:43:32 +1100 Subject: [dba-VB] Application settings References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827EA@ddi-01.DDI.local> Hi Charlotte, I see this as useful, but, If you need a complex setting structure why not just create a 'MySettings' class and serialise or deserialise it as needed? I think John has already worked with the Serializable attribute. Am I missing something? Cheers Michael M -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, 4 December 2009 11:27 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: - - 0 Microsoft.Jet.OLEDB.4.0 C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb RIMUser false - 1 sqloledb infoserver RIMDrillDataSQL true We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. Shared ds As DataSet Shared _connectionString As String Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath Private Shared Sub ReadSettingsFile() If IO.File.Exists(_xmlPath) Then Call CreateSchema() ds.ReadXml(_xmlPath) Call DecryptPassword() _connectionString = GetConnectionString() Else If ds.Tables(0).Rows.Count = 0 Then 'placeholder for jet settings Dim row As DataRow = ds.Tables(0).NewRow row("dbtype") = 0 row("provider") = "Microsoft.Jet.OLEDB.4.0" ds.Tables(0).Rows.Add(row) 'placeholder for sql settings row = ds.Tables(0).NewRow row("dbtype") = 1 row("provider") = "sqloledb" ds.Tables(0).Rows.Add(row) End If End If End Sub Private Shared Sub CreateSchema() ds = New DataSet Dim table As New DataTable("connection") table.Columns.Add("dbtype", GetType(Integer)) table.Columns.Add("provider", GetType(String)) table.Columns.Add("datasource", GetType(String)) table.Columns.Add("userid", GetType(String)) table.Columns.Add("password", GetType(String)) table.Columns.Add("initialcatalog", GetType(String)) table.Columns.Add("trusted", GetType(Boolean)) table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} ds.Tables.Add(table) End Sub Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 03, 2009 3:39 PM To: VBA Subject: [dba-VB] Application settings I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From Gustav at cactus.dk Fri Dec 4 02:48:35 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 09:48:35 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John Yes and no. I used an old version for some time but the current version is more powerful. Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. /gustav >>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav From Gustav at cactus.dk Fri Dec 4 04:08:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 11:08:03 +0100 Subject: [dba-VB] LINQ example (was: C# - Direct data manipulation) Message-ID: Hi John et all Further to the notes below on Joseph Albahari's LINQPad, it contains a link to download all the example code from "LINQ in Action". Also, it has a link to this amazing demo of the power of LINQ: http://blogs.msdn.com/lukeh/archive/2007/03/19/using-linq-to-solve-puzzles.aspx It's a true eye-opener and a good example showing that the scope of LINQ is much wider than "normal" database querying. The code is included in LINQPad when downloaded, ready for you to play with at: Tab Samples, C# 3.0 in a Nutshell, Chapter 9 - LINQ Operators, Joining, Extra - Weights Puzzle. It's Friday and soon weekend! /gustav >>> Gustav at cactus.dk 04-12-2009 09:48 >>> Hi John Yes and no. I used an old version for some time but the current version is more powerful. Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. /gustav >>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> Do you use it? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John et al > > Don't forget LINQPad. > > Why LINQ beats SQL: > http://www.linqpad.net/WhyLINQBeatsSQL.aspx > > /gustav > > >>>> Gustav at cactus.dk 02-12-2009 08:19 >>> > Hi John > > As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. > > ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 05:53:41 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 06:53:41 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B18F845.1090500@colbyconsulting.com> I really meant do you use linq in your C# apps? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes and no. I used an old version for some time but the current version is more powerful. > > Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. > > /gustav > >>>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> > Do you use it? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John et al >> >> Don't forget LINQPad. >> >> Why LINQ beats SQL: >> http://www.linqpad.net/WhyLINQBeatsSQL.aspx >> >> /gustav >> >> >>>>> Gustav at cactus.dk 02-12-2009 08:19 >>> >> Hi John >> >> As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. >> >> ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. >> >> /gustav > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From paul.hartland at googlemail.com Fri Dec 4 05:59:23 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 4 Dec 2009 11:59:23 +0000 Subject: [dba-VB] Test Message-ID: <38c884770912040359r58db94e3w44b86c077590457d@mail.gmail.com> Please delete as test email, sent question about XML problem about two days ago, and haven't seen it appear. -- Paul Hartland paul.hartland at googlemail.com From paul.hartland at googlemail.com Fri Dec 4 06:19:01 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 4 Dec 2009 12:19:01 +0000 Subject: [dba-VB] Read XML File Using xsd Schema File Message-ID: <38c884770912040419xdc61c66y2c315b820cd6fb09@mail.gmail.com> To all, We have been a given what looks to me like a fairly complex XML file, we have also been given a xsd schema file. I tried using the SQLXMLBulkLoad object in VB6 and was getting the error Schema: relationship expected on 'Company'. The company that gave us both the files insist that the xsd is correct (according to my project manager). I downloaded and installed Stylus Studio 2010, with which I loaded the XML, and then generated my own xsd schame file. Tried again and this time get the same error as above, but instead of 'Company' the error was 'Groups' The VB6 code I am using is as follows: Dim objBL Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1" objBL.KeepIdentity = True objBL.errorlogfile = "C:\XML_StylusStudio\Error.log" objBL.checkconstraints = True objBL.xmlfragment = True objBL.schemagen = True objBL.sgdroptables = True objBL.Execute "C:\XML_StylusStudio\newschema.xsd", "C:\XML_StylusStudio\CDFull_Original.xml" Set objBl=Nothing The object of the exercise being that we generate related tables in SQL Server 2005 of the XML data. Would be grateful if anyone could help with this (would be happy to send example XML file and the schema offline), as I haven't got much hair left to pull out. Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From Gustav at cactus.dk Fri Dec 4 06:33:36 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 13:33:36 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John Oh, I misunderstood you. Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 12:53 >>> I really meant do you use linq in your C# apps? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes and no. I used an old version for some time but the current version is more powerful. > > Please note that it comes with all the examples from his book, and even without the book this is a great why to get your hands on LINQ as the code is "live" - no need to copy and paste, it is right there for you try out at once. > > /gustav > >>>> jwcolby at colbyconsulting.com 02-12-2009 19:46 >>> > Do you use it? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John et al >> >> Don't forget LINQPad. >> >> Why LINQ beats SQL: >> http://www.linqpad.net/WhyLINQBeatsSQL.aspx >> >> /gustav >> >> >>>>> Gustav at cactus.dk 02-12-2009 08:19 >>> >> Hi John >> >> As I see it, that would be LINQ and ADO.NET EF (Entity Framework). Not that I have used these in a scenario even "remotely close" to yours, but the fine thing is that is performs all the plumbing behind the scene - generates the SQL for you. Critics tell that this SQL could be long-winded (= not optimized) but what do I care? If it flips 17 or 87 switches does nothing to me as long as the result is fast and precise. >> >> ADO.NET EF is an amazing piece of work. It is not mature but if MS continues to evolve it with the same speed as Silverlight I'm sure it will catch up. >> >> /gustav From jwcolby at colbyconsulting.com Fri Dec 4 07:54:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 08:54:21 -0500 Subject: [dba-VB] SPAM-LOW: Re: C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B19148D.9070607@colbyconsulting.com> >I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) I have to say that as a developer of a higher level language, I can see where avoiding TSQL would be something we would try to do. While I understand that SQL Server can be integrated into and used straight from the VS environment, most of us come at it from the built-in editor which frankly sucks. And I mean REALLY BADLY sucks, no apologies to our admin friends. I guess I have been doing SP development for a couple of years now and I still hate the built-in editor. And yet... that is what I use. IMHO this is an area where MS has fallen down on the job. If this integration thing is so darned simple, then MS should push education, seminars, books, education, education to get us working in VS to run (program) SQL Server. From a development perspective, and that is what SPs and UDF are after all, SQL Server should just be a tool used to manipulate data, NOT a dev environment. Over the last month I have found two APIs that allow C# to do a ton of stuff directly in SQL Server. WAY COOL stuff, but you would think it was porn the way you don't see it in the mainstream. These APIs allow you to manipulate SQL server the same way you can manipulate any other object - create, delete, observe, modify, manipulate anything in SQL Server - straight from VS. But where are the forums, the blogs, the developer excitement? It appears to me that there is a very real "here is your database" aimed at the developers who use SQL Server, and the admins just do things the way they always have for the last 20 years. And they buy tools from the RedGates of the world who undoubtedly do salivate over these new APIs. Just my humble opinion. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I misunderstood you. > Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 07:56:15 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 08:56:15 -0500 Subject: [dba-VB] Application settings In-Reply-To: References: <4B184BFF.6040203@colbyconsulting.com> Message-ID: <4B1914FF.1050705@colbyconsulting.com> Charlotte, My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: > > > - > - > 0 > Microsoft.Jet.OLEDB.4.0 > C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb > RIMUser > > > false > > - > 1 > sqloledb > infoserver > > > RIMDrillDataSQL > true > > > > We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. > > Shared ds As DataSet > Shared _connectionString As String > > Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath > > Private Shared Sub ReadSettingsFile() > If IO.File.Exists(_xmlPath) Then > Call CreateSchema() > ds.ReadXml(_xmlPath) > Call DecryptPassword() > _connectionString = GetConnectionString() > Else > If ds.Tables(0).Rows.Count = 0 Then > 'placeholder for jet settings > Dim row As DataRow = ds.Tables(0).NewRow > row("dbtype") = 0 > row("provider") = "Microsoft.Jet.OLEDB.4.0" > ds.Tables(0).Rows.Add(row) > > 'placeholder for sql settings > row = ds.Tables(0).NewRow > row("dbtype") = 1 > row("provider") = "sqloledb" > ds.Tables(0).Rows.Add(row) > End If > End If > End Sub > > Private Shared Sub CreateSchema() > ds = New DataSet > Dim table As New DataTable("connection") > table.Columns.Add("dbtype", GetType(Integer)) > table.Columns.Add("provider", GetType(String)) > table.Columns.Add("datasource", GetType(String)) > table.Columns.Add("userid", GetType(String)) > table.Columns.Add("password", GetType(String)) > table.Columns.Add("initialcatalog", GetType(String)) > table.Columns.Add("trusted", GetType(Boolean)) > table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} > > ds.Tables.Add(table) > End Sub > > Charlotte > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 03, 2009 3:39 PM > To: VBA > Subject: [dba-VB] Application settings > > I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Dec 4 08:17:12 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 15:17:12 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 14:54 >>> >I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) I have to say that as a developer of a higher level language, I can see where avoiding TSQL would be something we would try to do. While I understand that SQL Server can be integrated into and used straight from the VS environment, most of us come at it from the built-in editor which frankly sucks. And I mean REALLY BADLY sucks, no apologies to our admin friends. I guess I have been doing SP development for a couple of years now and I still hate the built-in editor. And yet... that is what I use. IMHO this is an area where MS has fallen down on the job. If this integration thing is so darned simple, then MS should push education, seminars, books, education, education to get us working in VS to run (program) SQL Server. From a development perspective, and that is what SPs and UDF are after all, SQL Server should just be a tool used to manipulate data, NOT a dev environment. Over the last month I have found two APIs that allow C# to do a ton of stuff directly in SQL Server. WAY COOL stuff, but you would think it was porn the way you don't see it in the mainstream. These APIs allow you to manipulate SQL server the same way you can manipulate any other object - create, delete, observe, modify, manipulate anything in SQL Server - straight from VS. But where are the forums, the blogs, the developer excitement? It appears to me that there is a very real "here is your database" aimed at the developers who use SQL Server, and the admins just do things the way they always have for the last 20 years. And they buy tools from the RedGates of the world who undoubtedly do salivate over these new APIs. Just my humble opinion. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I misunderstood you. > Not until recently. Skipping the SQLCommand low-level stuff completely, I've used datatables with in-line SQL queries (to avoid designing T-SQL and special views - Shamil mobbed me for that choice!) and I have been busy learning just these - so one step further, no thanks. Also, I had a hard time grasping the lambda expressions and syntax and still feel I have a lot to learn. Yes, you can use LINQ without lambda, but that seems like LINQ without an arm and a leg. But - for anything else than some special cases like perhaps your cases - I'm confident LINQ is the route to follow. > > /gustav From jwcolby at colbyconsulting.com Fri Dec 4 08:43:46 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 09:43:46 -0500 Subject: [dba-VB] C# - Direct data manipulation In-Reply-To: References: Message-ID: <4B192022.5080005@colbyconsulting.com> >they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. I actually think that is a good thing, developers who just use data shouldn't need to be learning SQL Server to get their data. That is really not the audience I am addressing however. IMHO the built-in editor of SQL Server should either be removed entirely or at least brought into the current century. It is notepad with pretty colors. How many millions of man hours have been wasted trying to track down errors when the only error message presented was "error near (insert some unrelated thing here)". Why bother even throwing up an error like that, and that is 99.9% of the errors I have EVER seen in two years working with SQL Server. Notepad, with pretty colors. For all of the rude comments us Access developers get about Access being "a toy", the code editor in Access is in a complete other galaxy from the code editor in SQL Server. SQL Server editor looks like it was designed in 1986 and never upgraded. Of course with the "real men don't use code editors" mentality of the DBA side of the fence I can see why MS doesn't bother spending time on this. Someday I really am going to have to figure out how to use VS to run / debug my SPs and stuff. To me VS just seems over-the-top complex for the level of stuff I am trying to do. An Access type of code editor would be just the right level of convenience and capability - built right into SSMS. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. > > /gustav From Gustav at cactus.dk Fri Dec 4 09:32:07 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 16:32:07 +0100 Subject: [dba-VB] C# - Direct data manipulation Message-ID: Hi John LINQPad does pure SQL too, though not with IntelliSense, and error messages seem to be those from SQL Server. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 15:43 >>> >they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. I actually think that is a good thing, developers who just use data shouldn't need to be learning SQL Server to get their data. That is really not the audience I am addressing however. IMHO the built-in editor of SQL Server should either be removed entirely or at least brought into the current century. It is notepad with pretty colors. How many millions of man hours have been wasted trying to track down errors when the only error message presented was "error near (insert some unrelated thing here)". Why bother even throwing up an error like that, and that is 99.9% of the errors I have EVER seen in two years working with SQL Server. Notepad, with pretty colors. For all of the rude comments us Access developers get about Access being "a toy", the code editor in Access is in a complete other galaxy from the code editor in SQL Server. SQL Server editor looks like it was designed in 1986 and never upgraded. Of course with the "real men don't use code editors" mentality of the DBA side of the fence I can see why MS doesn't bother spending time on this. Someday I really am going to have to figure out how to use VS to run / debug my SPs and stuff. To me VS just seems over-the-top complex for the level of stuff I am trying to do. An Access type of code editor would be just the right level of convenience and capability - built right into SSMS. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > One reason could be that many web developers know little about database design, thus they are being forced to leave that to a DBA. A chief developer once told at a tech meeting I attended, that they operated with the concept "scared of the database" meaning that the web developers should just be presented with ready-made views because SQL to these was like black magic. > > /gustav From cfoust at infostatsystems.com Fri Dec 4 10:10:23 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 4 Dec 2009 10:10:23 -0600 Subject: [dba-VB] Application settings In-Reply-To: <4B1914FF.1050705@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> Message-ID: OK, then I don't understand the question. What do you mean about the settings "area" of the project? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 04, 2009 5:56 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Charlotte, My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Create an xml file called UserSettings (or whatever) and store each value in a node in that. Then all you have to do is read them back when you need them. We use several of these, one called OLEDBSettings.xml that looks like this: > > > - > - > 0 > Microsoft.Jet.OLEDB.4.0 > C:\Documents and Settings\All Users\Application Data\Infostat\RIMDrill\5\RIMDrillData.mdb > RIMUser > > > false > > - > 1 > sqloledb > infoserver > > > RIMDrillDataSQL > true > > > > We actually have a file like this for each application and it lives in the application folder. This is just to give you an idea, not a how to. We have a class that wraps this in our apps and uses this kind of routine to read it. I leave it up to you to translate to C#. > > Shared ds As DataSet > Shared _connectionString As String > > Shared _xmlPath As String = "OLEDBSettings.xml" 'default to xml file in apppath > > Private Shared Sub ReadSettingsFile() > If IO.File.Exists(_xmlPath) Then > Call CreateSchema() > ds.ReadXml(_xmlPath) > Call DecryptPassword() > _connectionString = GetConnectionString() > Else > If ds.Tables(0).Rows.Count = 0 Then > 'placeholder for jet settings > Dim row As DataRow = ds.Tables(0).NewRow > row("dbtype") = 0 > row("provider") = "Microsoft.Jet.OLEDB.4.0" > ds.Tables(0).Rows.Add(row) > > 'placeholder for sql settings > row = ds.Tables(0).NewRow > row("dbtype") = 1 > row("provider") = "sqloledb" > ds.Tables(0).Rows.Add(row) > End If > End If > End Sub > > Private Shared Sub CreateSchema() > ds = New DataSet > Dim table As New DataTable("connection") > table.Columns.Add("dbtype", GetType(Integer)) > table.Columns.Add("provider", GetType(String)) > table.Columns.Add("datasource", GetType(String)) > table.Columns.Add("userid", GetType(String)) > table.Columns.Add("password", GetType(String)) > table.Columns.Add("initialcatalog", GetType(String)) > table.Columns.Add("trusted", GetType(Boolean)) > table.PrimaryKey = New DataColumn() {table.Columns("dbtype")} > > ds.Tables.Add(table) > End Sub > > Charlotte > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 03, 2009 3:39 PM > To: VBA > Subject: [dba-VB] Application settings > > I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ From jwcolby at colbyconsulting.com Fri Dec 4 10:33:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 11:33:52 -0500 Subject: [dba-VB] Application settings In-Reply-To: References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> Message-ID: <4B1939F0.7020905@colbyconsulting.com> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > OK, then I don't understand the question. What do you mean about the settings "area" of the project? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 04, 2009 5:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Application settings > > Charlotte, > > My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. > > John W. Colby > www.ColbyConsulting.com > From shamil at smsconsulting.spb.ru Fri Dec 4 10:46:41 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 4 Dec 2009 19:46:41 +0300 Subject: [dba-VB] Application settings In-Reply-To: <4B1939F0.7020905@colbyconsulting.com> References: <4B184BFF.6040203@colbyconsulting.com> <4B1914FF.1050705@colbyconsulting.com> <4B1939F0.7020905@colbyconsulting.com> Message-ID: <01b001ca7501$5c9e3650$15daa2f0$@spb.ru> Hi John, You can access those properties using: Properties.Settings.Default.{{PropertyName}} Or {{Root Namespace}}.Properties.Settings.Default.{{PropertyName}} -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 04, 2009 7:34 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 11:24:46 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 18:24:46 +0100 Subject: [dba-VB] Application settings Message-ID: Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6-66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > OK, then I don't understand the question. What do you mean about the settings "area" of the project? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 04, 2009 5:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Application settings > > Charlotte, > > My question really is how do I get at the settings area of the project, and why would I not use that instead of this xml thing of yours? At least in this specific case, I am writing code for myself, not distribution. > > John W. Colby > www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 4 12:30:32 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 04 Dec 2009 13:30:32 -0500 Subject: [dba-VB] Code Search Message-ID: <4B195548.4030300@colbyconsulting.com> Has anyone noticed this on Google? http://www.google.com/codesearch?hl=en Anyone using it? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 4 14:33:00 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 4 Dec 2009 23:33:00 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 15:39:43 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 22:39:43 +0100 Subject: [dba-VB] Application settings Message-ID: Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 21:33 >>> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 4 16:06:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 01:06:11 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01be01ca752d$ff4dfe40$fde9fac0$@spb.ru> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 21:33 >>> Hi Gustav, You can set Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; and save settings having "User" scope: Properties.Settings.Default.Save(); And they are saved not in {{ApplicationExecutableFileName}}.config, which you deliver with you app's executable but anywhere else on your system - probably somewhere in user's Application Settings - standard windows folder. I have never had time to find out where settings are saved. Anybody? Recap: - settings are loaded from {{ApplicationExecutableFileName}}.config when you deliver you application, and it runs first time; - as soon as you save "User" scope settings they are saved in and loaded from {{UnknownPlace}}; - if you move your application files into another folder on the same system the settings are again loaded on first run from {{ApplicationExecutableFileName}}; - ... That looks confusing a bit but it's how it works... You can click "Learn more about application settings..." on top right of VS2008 application settings window available by Solution Explorer -> Project name -> Right-Click -> Settings... But if you wanted to have rather complicated structure of your application settings file then better use your own custom XML files, which can be loaded from/saved to files many ways without almost any coding... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 8:25 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi John Shamil is right, but that method is for reading only. Please note that the Properties' collection object is read-only, thus it takes quite a few steps to add a property: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- 66be-44ce-8a65-ab548f6f4f04 I have not used this as I haven't had any need to add properties on the fly. Reading and writing was fine for me, and new properties I added manually. You may find it much easier and perhaps more convenient to just have a dataset which you read and write from/to an XML-file. I've posted code for this before. /gustav >>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> Under the project is a properties object. Double click that and an entire multi-tabbed dialog opens. Click the settings tab. There you will see a form where you can enter name, type, scope, value. As far as I can tell this is a place where I (the developer) can create settings that my program will use and manipulate, settings (for example) to tell my program the name of the SQL Server instance to use in a connection string, the name of my control database where I store my stored procedures and UDFs. Stuff like that. Stuff that I am currently hard coding, but which really should be in a settings tab so that I don't have to remember where that constant is in code, I can just go to the settings tab to change. My expectation is that there is an object somewhere in the .net namespace that allows you to do something like "Something.Somethingelse.Settings["MyServerName"]...." to access these things. I expect to be able to create new ones, edit existing ones, delete them etc from a .Net object. I am looking for that .Net syntax that allows me to do this from code. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Dec 4 16:18:39 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 04 Dec 2009 23:18:39 +0100 Subject: [dba-VB] Application settings Message-ID: Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 23:06 >>> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav From cfoust at infostatsystems.com Fri Dec 4 19:24:01 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 4 Dec 2009 19:24:01 -0600 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: That was my understanding as well, Gustav. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, December 04, 2009 2:19 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav >>> shamil at smsconsulting.spb.ru 04-12-2009 23:06 >>> Hi Gustav -- No, PropertyName can't be appended and saved if it doesn't exist as they are compile-time (early) bound - but JC asked exactly about existing properties defined in VS2008 project settings, and they can be changed and saved if they have "User" scope. Yes, I guess they are saved somewhere in AppData but I do not know where... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 12:40 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil Yes, but is PropertyName appended and saved if it didn't exist? Isn't the data saved under the user profile somewhere in AppData? I haven't look closer at this though. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Dec 5 07:03:33 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 16:03:33 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <01d001ca75ab$5adb7670$10926350$@spb.ru> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Sat Dec 5 07:03:33 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 5 Dec 2009 16:03:33 +0300 Subject: [dba-VB] Application settings In-Reply-To: References: Message-ID: <01d101ca75ab$5c18d870$144a8950$@spb.ru> Hi Gustav and all, JC original request was "to access/modify" application settings AFAIU: <<< I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. >>> -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 1:19 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Application settings Hi Shamil I guess I'm too busy today. I read it as JC wanted to create these on the fly ... /gustav <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4661 (20091204) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Sat Dec 5 12:57:15 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sat, 05 Dec 2009 19:57:15 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Sat Dec 5 16:54:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 6 Dec 2009 01:54:50 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <01e001ca75fd$f4891280$dd9b3780$@spb.ru> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Sun Dec 6 09:04:00 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 06 Dec 2009 16:04:00 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From michael at ddisolutions.com.au Sun Dec 6 16:00:52 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 7 Dec 2009 09:00:52 +1100 Subject: [dba-VB] Code Search References: <4B195548.4030300@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827F2@ddi-01.DDI.local> Hi John, No and not yet! Cheers Michael M Has anyone noticed this on Google? http://www.google.com/codesearch?hl=en Anyone using it? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From michael at ddisolutions.com.au Sun Dec 6 16:03:36 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 7 Dec 2009 09:03:36 +1100 Subject: [dba-VB] Application settings - Test References: <4B184BFF.6040203@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Test reply, Am I getting through??? Or am I being ignored??? :-) Cheers Michael M Hi John, Is this what your after? global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting = "New Value"; global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); cheers Michael M I want to create application settings for things like the server instance that the program will bang on, the name of my database that I save my custom UDFs and SPs in etc. It is trivial to get there in the interface but Google is not my friend tonight in discovering how to access / modify them through code. Anybody? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 _______________________________________________ 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 - www.avg.com Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: 12/04/09 06:36:00 From jwcolby at colbyconsulting.com Sun Dec 6 16:45:30 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 06 Dec 2009 17:45:30 -0500 Subject: [dba-VB] Application settings - Test In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> References: <4B184BFF.6040203@colbyconsulting.com> <59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Message-ID: <4B1C340A.7090004@colbyconsulting.com> LOL. We'd never ignore you! John W. Colby www.ColbyConsulting.com Michael Maddison wrote: > Test reply, > Am I getting through??? > Or am I being ignored??? :-) > > Cheers > > Michael M > > > Hi John, > > Is this what your after? > > > global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting > = "New Value"; > > global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); > > cheers > > Michael M > > I want to create application settings for things like the server > instance that the program will bang > on, the name of my database that I save my custom UDFs and SPs in etc. > It is trivial to get there > in the interface but Google is not my friend tonight in discovering how > to access / modify them > through code. > > Anybody? > From wdhindman at dejpolsystems.com Sun Dec 6 16:29:05 2009 From: wdhindman at dejpolsystems.com (William Hindman) Date: Sun, 6 Dec 2009 17:29:05 -0500 Subject: [dba-VB] Application settings - Test In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> References: <4B184BFF.6040203@colbyconsulting.com><59A61174B1F5B54B97FD4ADDE71E7D015827E9@ddi-01.DDI.local> <59A61174B1F5B54B97FD4ADDE71E7D015827F3@ddi-01.DDI.local> Message-ID: <59B0F0614709418884DE2B4E1551B143@jislaptopdev> ...yes, but we're ignoring you ...its Sunday here, eh :) William -------------------------------------------------- From: "Michael Maddison" Sent: Sunday, December 06, 2009 5:03 PM To: "Discussion concerning Visual Basic and related programming issues." Subject: Re: [dba-VB] Application settings - Test > Test reply, > Am I getting through??? > Or am I being ignored??? :-) > > Cheers > > Michael M > > > Hi John, > > Is this what your after? > > > global::WindowsFormsApplication1.Properties.Settings.Default.TestSetting > = "New Value"; > > global::WindowsFormsApplication1.Properties.Settings.Default.Save ( ); > > cheers > > Michael M > > I want to create application settings for things like the server > instance that the program will bang > on, the name of my database that I save my custom UDFs and SPs in etc. > It is trivial to get there > in the interface but Google is not my friend tonight in discovering how > to access / modify them > through code. > > Anybody? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: > 12/04/09 06:36:00 > > _______________________________________________ > 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 - www.avg.com > Version: 9.0.709 / Virus Database: 270.14.91/2541 - Release Date: > 12/04/09 06:36:00 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Mon Dec 7 01:47:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 7 Dec 2009 10:47:50 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <021101ca7711$949ff220$bddfd660$@spb.ru> Hi Gustav -- Thank you. OK, March 22 - official release - so January 2010 MSDN might have it... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, December 06, 2009 6:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732- A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, December 05, 2009 9:57 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil Well, much less hard-core than I had expected, indeed not a coding session but with a good perspective. However, he came a long way describing and demonstrating many new features of VS2010, MVC and Silverlight. Also LINQ and ADO.NET EF seems to be mainstream. And, of course, much warmly promoting of Windows Azure which works very well together with VS, indeed with the new "local Azure" - a local simulator of Azure you can use during development so no live hosting is needed - much like the local web server that simulates IIS. Very cool is the new GUI designer for Silverlight UI design. VS2010 is brushed up quite a lot with better support for multi-monitor use, improved IntelliSense and editing features in the code editor - everything is aimed at faster development with firm focus on you, the developer, very different from Access. Further, the Team Foundation edition is now useful for single developers too, with unit testing, versioning etc. etc. However, I expect that to be available at a "corporate" charge only (beyond my budget), but let's see. He promised to mail us links to the complete session and much more. I can post these here when they arrive. If you or anyone else have questions to specific topics, Scott Guthrie may have touched, please ask. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4663 (20091205) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Mon Dec 7 01:53:42 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 07 Dec 2009 08:53:42 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil I cannot tell - and I don't have an MSDN subscription ... /gustav >>> shamil at smsconsulting.spb.ru 07-12-2009 08:47 >>> Hi Gustav -- Thank you. OK, March 22 - official release - so January 2010 MSDN might have it... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, December 06, 2009 6:04 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil He actually told that: March 22, 2010. Further, I located this related link: http://vicsoft.info/blog/?p=29 Also note the link to "Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview": http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en I normally stay off betas but I'm seriously considering making a change this time; there is so much exiting stuff in this version. /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 23:54 >>> Hi Gustav -- Thank you for your short but informative enough review. Main question is: When they plan to have VS2010 released? Thank you. -- Shamil From jwcolby at colbyconsulting.com Mon Dec 7 07:46:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 08:46:22 -0500 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <4B1D072E.6060008@colbyconsulting.com> I have to say... "Scott Guthrie" ... with a name like that he should have been a musician. John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 7 07:56:31 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 08:56:31 -0500 Subject: [dba-VB] Application settings In-Reply-To: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> References: <01b201ca7520$fa2ff290$ee8fd7b0$@spb.ru> Message-ID: <4B1D098F.30807@colbyconsulting.com> OK, I am trying to reference Properties.Settings.Default["ServerName"].ToString() and get the error 'System.Windows.Forms.PropertyStore' does not contain a definition for 'Settings' and no extension method 'Settings' accepting a first argument of type 'System.Windows.Forms.PropertyStore' could be found (are you missing a using directive or an assembly reference?) John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Gustav, > > You can set > > Properties.Settings.Default.{{PropertyName}} = {{SomeValue}}; > > and save settings having "User" scope: > > Properties.Settings.Default.Save(); > > And they are saved not in {{ApplicationExecutableFileName}}.config, which > you deliver with you app's executable but anywhere else on your system - > probably somewhere in user's Application Settings - standard windows folder. > I have never had time to find out where settings are saved. Anybody? > > Recap: > > - settings are loaded from {{ApplicationExecutableFileName}}.config when you > deliver you application, and it runs first time; > - as soon as you save "User" scope settings they are saved in and loaded > from {{UnknownPlace}}; > - if you move your application files into another folder on the same system > the settings are again loaded on first run from > {{ApplicationExecutableFileName}}; > - ... > > That looks confusing a bit but it's how it works... > > You can click "Learn more about application settings..." on top right of > VS2008 application settings window available by Solution Explorer -> Project > name -> Right-Click -> Settings... > > But if you wanted to have rather complicated structure of your application > settings file then better use your own custom XML files, which can be loaded > from/saved to files many ways without almost any coding... > > Thank you. > > -- > Shamil > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, December 04, 2009 8:25 PM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Application settings > > Hi John > > Shamil is right, but that method is for reading only. > Please note that the Properties' collection object is read-only, thus it > takes quite a few steps to add a property: > > http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/c52b4fc6- > 66be-44ce-8a65-ab548f6f4f04 > > I have not used this as I haven't had any need to add properties on the fly. > Reading and writing was fine for me, and new properties I added manually. > > You may find it much easier and perhaps more convenient to just have a > dataset which you read and write from/to an XML-file. I've posted code for > this before. > > /gustav > > >>>> jwcolby at colbyconsulting.com 04-12-2009 17:33 >>> > Under the project is a properties object. Double click that and an entire > multi-tabbed dialog opens. > > Click the settings tab. There you will see a form where you can enter name, > type, scope, value. > > As far as I can tell this is a place where I (the developer) can create > settings that my program > will use and manipulate, settings (for example) to tell my program the name > of the SQL Server > instance to use in a connection string, the name of my control database > where I store my stored > procedures and UDFs. Stuff like that. Stuff that I am currently hard > coding, but which really > should be in a settings tab so that I don't have to remember where that > constant is in code, I can > just go to the settings tab to change. > > My expectation is that there is an object somewhere in the .net namespace > that allows you to do > something like "Something.Somethingelse.Settings["MyServerName"]...." to > access these things. > > I expect to be able to create new ones, edit existing ones, delete them etc > from a .Net object. I > am looking for that .Net syntax that allows me to do this from code. > > John W. Colby > www.ColbyConsulting.com > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4661 (20091204) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-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 Dec 7 08:03:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 07 Dec 2009 09:03:10 -0500 Subject: [dba-VB] Application settings In-Reply-To: <01d101ca75ab$5c18d870$144a8950$@spb.ru> References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> Message-ID: <4B1D0B1E.1090109@colbyconsulting.com> OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Gustav and all, > > JC original request was "to access/modify" application settings AFAIU: > <<< > I want to create application settings for things like the server instance > that the program will bang on, the name of my database that I save my custom > UDFs and SPs in etc. It is trivial to get there in the interface but Google > is not my friend tonight in discovering how to access / modify them through > code. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Saturday, December 05, 2009 1:19 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] Application settings > > Hi Shamil > > I guess I'm too busy today. I read it as JC wanted to create these on the > fly ... > > /gustav > > > <<< snip >>> > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4661 (20091204) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > 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 Dec 7 09:00:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 07 Dec 2009 16:00:02 +0100 Subject: [dba-VB] Application settings Message-ID: Hi John The file containing the settings is app.config. To hold "global" settings you could create a small project with just this file and reference it from any other project. /gustav >>> jwcolby at colbyconsulting.com 07-12-2009 15:03 >>> OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com From mmattys at rochester.rr.com Mon Dec 7 10:57:22 2009 From: mmattys at rochester.rr.com (Mike Mattys) Date: Mon, 7 Dec 2009 11:57:22 -0500 Subject: [dba-VB] Application settings References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> <4B1D0B1E.1090109@colbyconsulting.com> Message-ID: My understanding of Properties.Settings is that settings must be by User in order to be saved and the xml file will reside in the Local Setting/Applications directory under the user's My Documents folder. In that case, all projects under a solution could read a single xml file. We decided to use cryptographic services for the i/o of the xml by using an internal static class that reads/writes to a string collection using methods we created like bof, eof, movefirst, addnew, etc. - Michael R Mattys MapPoint and Database Dev www.mattysconsulting.com - ----- Original Message ----- From: "jwcolby" To: "Discussion concerning Visual Basic and related programming issues." Sent: Monday, December 07, 2009 9:03 AM Subject: Re: [dba-VB] Application settings > OK, it appears that each project has its own set of properties. If I set > the same property in the > current project's property set then > > Properties.Settings.Default["ServerName"].ToString() > > works just fine. > > But that is not the behavior I want. I need a SOLUTION property set, > which appears to not exist? > Which perhaps would explain why those who have done this before roll their > own? > > Does anyone have code to do this so I don't have to roll my own (a.k.a. > reinvent the wheel) too? > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: >> Hi Gustav and all, >> >> JC original request was "to access/modify" application settings AFAIU: >> <<< >> I want to create application settings for things like the server instance >> that the program will bang on, the name of my database that I save my >> custom >> UDFs and SPs in etc. It is trivial to get there in the interface but >> Google >> is not my friend tonight in discovering how to access / modify them >> through >> code. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Saturday, December 05, 2009 1:19 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] Application settings >> >> Hi Shamil >> >> I guess I'm too busy today. I read it as JC wanted to create these on the >> fly ... >> >> /gustav >> >> >> <<< snip >>> >> >> >> __________ Information from ESET NOD32 Antivirus, version of virus >> signature >> database 4661 (20091204) __________ >> >> The message was checked by ESET NOD32 Antivirus. >> >> http://www.esetnod32.ru >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From pharold at proftesting.com Mon Dec 7 11:18:37 2009 From: pharold at proftesting.com (Perry L Harold) Date: Mon, 7 Dec 2009 12:18:37 -0500 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: <4B1D072E.6060008@colbyconsulting.com> References: <4B1D072E.6060008@colbyconsulting.com> Message-ID: Maybe Arlo's brother? Perry -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 07, 2009 8:46 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Scott Guthrie in town I have to say... "Scott Guthrie" ... with a name like that he should have been a musician. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Dec 7 13:54:55 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 7 Dec 2009 22:54:55 +0300 Subject: [dba-VB] Application settings In-Reply-To: <4B1D0B1E.1090109@colbyconsulting.com> References: <01d101ca75ab$5c18d870$144a8950$@spb.ru> <4B1D0B1E.1090109@colbyconsulting.com> Message-ID: <001b01ca7777$2741d5c0$75c58140$@spb.ru> Hi John -- For solution you can select one of the projects to be used to handle settings. That project is usually a core(utility/generic/settings) class library. Then if you wish you can additionally wrap Properties.Settings.Default... for every/most of the settings into your custom global (Solution scope) properties' wrappers. Such wrapping makes your referencing projects independent on actual implementation of handling of application settings. When that done and works OK you can go and "reinvent the wheel" if needed without any changes in referencing projects... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 07, 2009 5:03 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Application settings OK, it appears that each project has its own set of properties. If I set the same property in the current project's property set then Properties.Settings.Default["ServerName"].ToString() works just fine. But that is not the behavior I want. I need a SOLUTION property set, which appears to not exist? Which perhaps would explain why those who have done this before roll their own? Does anyone have code to do this so I don't have to roll my own (a.k.a. reinvent the wheel) too? John W. Colby www.ColbyConsulting.com <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4668 (20091207) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Dec 8 01:55:00 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 8 Dec 2009 07:55:00 -0000 Subject: [dba-VB] OT: Thin SQL Client for Linux In-Reply-To: References: Message-ID: <4b1e0661.0f67f10a.205a.ffffd8ee@mx.google.com> OT: Thin SQL Client for Linux Can anybody find me a good THIN sql client for Linux I need to find one in the next day, I am stuck on an escalation and we really need this. So any help appreciated. Thanks Max From Gustav at cactus.dk Tue Dec 8 10:11:52 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 08 Dec 2009 17:11:52 +0100 Subject: [dba-VB] Scott Guthrie in town Message-ID: Hi Shamil et al He has posted links to the PP slides and demo code here: http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe-december-2009.aspx for: ASP.NET 4 and VS 2010 Web Development: Slides + Demos + Blog Posts ASP.NET MVC 2.0: Slides + Walkthrough Silverlight 4: Slides (warning: large download) /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav From shamil at smsconsulting.spb.ru Tue Dec 8 11:52:14 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 8 Dec 2009 20:52:14 +0300 Subject: [dba-VB] Scott Guthrie in town In-Reply-To: References: Message-ID: <006c01ca782f$2e61ae30$8b250a90$@spb.ru> Hi Gustav, Thank you for the links. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, December 08, 2009 7:12 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Scott Guthrie in town Hi Shamil et al He has posted links to the PP slides and demo code here: http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe -december-2009.aspx for: ASP.NET 4 and VS 2010 Web Development: Slides + Demos + Blog Posts ASP.NET MVC 2.0: Slides + Walkthrough Silverlight 4: Slides (warning: large download) /gustav >>> shamil at smsconsulting.spb.ru 05-12-2009 14:03 >>> Hi Gustav -- How it was your attending Scott Guthrie's speaking in your town? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, December 02, 2009 10:31 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Scott Guthrie in town Hi all Tomorrow, Thursday, is my day. Scott Guthrie is in town speaking of ADO.NET and Silverlight: http://weblogs.asp.net/scottgu/archive/2009/11/27/presenting-in-europe-next- week.aspx A full day just sitting, listening, and learning! /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4670 (20091208) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 9 08:04:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 09:04:21 -0500 Subject: [dba-VB] c# Browse folder dialog Message-ID: <4B1FAE65.2070700@colbyconsulting.com> When I set the BrowseFolder.SelectedPath property, it displays the directory tree with the selected directory NOT expanded. I would like to cause the selected directory to already be expanded. Does anyone know if this is possible? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Dec 9 08:43:38 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 09 Dec 2009 15:43:38 +0100 Subject: [dba-VB] c# Browse folder dialog Message-ID: Hi John I think not. This old project uses the Shell dialogue and has a SetExpanded method. Maybe you can get some ideas: http://www.codeproject.com/KB/selection/folderbrowser.aspx /gustav >>> jwcolby at colbyconsulting.com 09-12-2009 15:04:21 >>> When I set the BrowseFolder.SelectedPath property, it displays the directory tree with the selected directory NOT expanded. I would like to cause the selected directory to already be expanded. Does anyone know if this is possible? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 09:49:25 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 10:49:25 -0500 Subject: [dba-VB] C# - Thoughts on my methods Message-ID: <4B1FC705.9010902@colbyconsulting.com> As a consultant in a home office I work in total isolation except for this email group. So I need your input, to keep me sane and to keep me on the right path. I would like your thoughts on what I am doing and what I am intending to do. As you know, I have "the database from hell", for which I am developing an application to allow me to manipulate the various pieces from an application interface rather than directly from stored procedures and the SSMS or from Access, which is what I have done to this point. With C# I am able to do more than I was able from Access, including getting back output parameters from stored procedures. So... my process so far. First off, I am developing the overall application as a set of child projects inside of the application. The main application opens a form with a menu, and that menu takes me to forms in the child projects to perform pieces of the application. For example I have a database backup project where I can backup and restore specific databases or groups of databases. I have an Accuzip project where I can export CSV files to and import resulting CSV files from the external Accuzip program. I have an Orders project where I can create and manipulate the orders I create for the client. Each child project is physically located underneath the main application directory. In order to reference (open) the forms in the child projects, I have to set a reference to that project and I have to set a using statement in the form. I still do not understand what these two pieces do. Why do I have to set a reference and a using? I assume you cannot set a using statement unless the project references the library (or project)? I also don't understand why some objects in a referenced project class can be seen but others cannot. IOW I can use one class in a namespace as a type to dimension an object, but another class in the same namespace is not visible, cannot be so used. I don't understand a whole ton of things of this nature and I have to say that the whole "break into projects" idea is turning out to be more work than it might be worth. Any comments on this email will be much appreciated. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 11:42:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 12:42:12 -0500 Subject: [dba-VB] C# - zip / unzip Message-ID: <4B1FE174.90207@colbyconsulting.com> Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Dec 9 13:14:16 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 14:14:16 -0500 Subject: [dba-VB] threading Message-ID: <4B1FF708.1040700@colbyconsulting.com> As mentioned in previous emails, I am developing an application to manage all of the tasks for the DBFH. This includes Backing up databases, creating orders, transferring data between an external app etc. I am trying to determine how to thread this app such that if I start a process exporting data to Accuzip, I could have another process importing data from Accuzip, and also be working on an order. As things currently stand, each of these tasks is a project and each project has its own forms and classes, and anything else necessary for that task. I really do want to be able to do multiple things like this at the same time. Exporting data to Accuzip can take overnight, and actually consists of an export and a matching import process. It makes perfect sense (to me) to have threads doing this kind of thing, and allow me to go back to the main application and do something else. But at what level would I use a thread? Would I use a thread to open the form that performs the AZ process? This would allow me to get that started and immediately go back to the main app and open another form (using a new thread?) to start processing an order. Or would the form open and the button on the form start a thread that executes the process? If a form starts a thread, that allows the user (me) to do other things in that form potentially changing to a new directory or selecting a different database. Do you disable all controls on a form when a thread starts? I never had to think about this in VBA and it is all rather confusing. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] threading In-Reply-To: <4B1FF708.1040700@colbyconsulting.com> References: <4B1FF708.1040700@colbyconsulting.com> Message-ID: <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> Hi John -- Why not have several (FE) applications if they are so independent? - all developed within one VS solution but as separate (WinForms) projects sharing the same (set of) class library(-ies)? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 10:14 PM To: VBA Subject: [dba-VB] threading As mentioned in previous emails, I am developing an application to manage all of the tasks for the DBFH. This includes Backing up databases, creating orders, transferring data between an external app etc. I am trying to determine how to thread this app such that if I start a process exporting data to Accuzip, I could have another process importing data from Accuzip, and also be working on an order. As things currently stand, each of these tasks is a project and each project has its own forms and classes, and anything else necessary for that task. I really do want to be able to do multiple things like this at the same time. Exporting data to Accuzip can take overnight, and actually consists of an export and a matching import process. It makes perfect sense (to me) to have threads doing this kind of thing, and allow me to go back to the main application and do something else. But at what level would I use a thread? Would I use a thread to open the form that performs the AZ process? This would allow me to get that started and immediately go back to the main app and open another form (using a new thread?) to start processing an order. Or would the form open and the button on the form start a thread that executes the process? If a form starts a thread, that allows the user (me) to do other things in that form potentially changing to a new directory or selecting a different database. Do you disable all controls on a form when a thread starts? I never had to think about this in VBA and it is all rather confusing. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B1FE174.90207@colbyconsulting.com> References: <4B1FE174.90207@colbyconsulting.com> Message-ID: <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> Hi John, Have a look for DotNetNuke sources - they have free sources for zipping/unzipping. Those sources are used in core DNN functionality (modules setup) - IOW they tested well, they are stable and thry work very well. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 8:42 PM To: VBA Subject: [dba-VB] C# - zip / unzip Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Wed Dec 9 14:59:21 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 9 Dec 2009 23:59:21 +0300 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: <4B1FC705.9010902@colbyconsulting.com> References: <4B1FC705.9010902@colbyconsulting.com> Message-ID: <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 6:49 PM To: VBA Subject: [dba-VB] C# - Thoughts on my methods As a consultant in a home office I work in total isolation except for this email group. So I need your input, to keep me sane and to keep me on the right path. I would like your thoughts on what I am doing and what I am intending to do. As you know, I have "the database from hell", for which I am developing an application to allow me to manipulate the various pieces from an application interface rather than directly from stored procedures and the SSMS or from Access, which is what I have done to this point. With C# I am able to do more than I was able from Access, including getting back output parameters from stored procedures. So... my process so far. First off, I am developing the overall application as a set of child projects inside of the application. The main application opens a form with a menu, and that menu takes me to forms in the child projects to perform pieces of the application. For example I have a database backup project where I can backup and restore specific databases or groups of databases. I have an Accuzip project where I can export CSV files to and import resulting CSV files from the external Accuzip program. I have an Orders project where I can create and manipulate the orders I create for the client. Each child project is physically located underneath the main application directory. In order to reference (open) the forms in the child projects, I have to set a reference to that project and I have to set a using statement in the form. I still do not understand what these two pieces do. Why do I have to set a reference and a using? I assume you cannot set a using statement unless the project references the library (or project)? I also don't understand why some objects in a referenced project class can be seen but others cannot. IOW I can use one class in a namespace as a type to dimension an object, but another class in the same namespace is not visible, cannot be so used. I don't understand a whole ton of things of this nature and I have to say that the whole "break into projects" idea is turning out to be more work than it might be worth. Any comments on this email will be much appreciated. -- John W. Colby www.ColbyConsulting.com _______________________________________________ __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From cfoust at infostatsystems.com Wed Dec 9 15:11:49 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 9 Dec 2009 15:11:49 -0600 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> References: <4B1FC705.9010902@colbyconsulting.com> <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Message-ID: I have to point out that it is exceptionally easy to create circular references when the projects are set up like this. That's why in our apps we keep all the forms in a project, all the reports in a project, etc. Of course, if we were using libraries rather than projects under the solution, it would be different. But this way, it can get messy fast. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, December 09, 2009 12:59 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - Thoughts on my methods Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil From cfoust at infostatsystems.com Wed Dec 9 15:17:15 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 9 Dec 2009 15:17:15 -0600 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B1FE174.90207@colbyconsulting.com> References: <4B1FE174.90207@colbyconsulting.com> Message-ID: You can roll your own using J# from within VS. Idid that originally and it only takes minor translation to put it into C# or VB. That said, we currently use Xceed. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 09, 2009 9:42 AM To: VBA Subject: [dba-VB] C# - zip / unzip Any recommendations for a well supported (bugs are fixed) library for zip / unzip for .net? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From phpons at free.fr Wed Dec 9 15:24:33 2009 From: phpons at free.fr (Philippe) Date: Wed, 9 Dec 2009 22:24:33 +0100 Subject: [dba-VB] Ajax application problem Message-ID: <3262DDC894CA427DB254732FCE5E70AF@VOSTRO> Hi all, I have problems putting an ajax application on a production server. The application consists of an aspx page that keeps the javascript code. This code talks with C# page methods to access Web services and interact with the database. For example the first thing the user has to do is fill in login and password fields and click on the btnLogin. Then the code execute the following command: PageMethods.GetUser(user, onGetUserSuccess, onGetUserError); with user being an array containing username and password. The C# GetUser webmethod returns its response to the onGetUserSuccess callback function. The application runs ok on my dev pc. I installed it on the production server, copying the aspx file, web.config file and the binary files. When I run it, I get an error message, something like error during the handling of your request.(freely translated from french!!) This error is displayed into a textbox by the onGetUserError callback function. I put an error trapping withing the webmethod, but its error message is not returned, leading me to think that this webmethod is not "entered". Therefore the javascript code is running ok, but the call to the webmethod is failing. I guess I missed to copy something like a javascript file from the framework, or something else. Do you have any kind of experience in this regard? NB: I also checked that the asp framework is of version 2.0 on the server, it's ok. TIA, Philippe Pons From shamil at smsconsulting.spb.ru Wed Dec 9 15:41:54 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 10 Dec 2009 00:41:54 +0300 Subject: [dba-VB] C# - Thoughts on my methods In-Reply-To: References: <4B1FC705.9010902@colbyconsulting.com> <00d101ca7912$7f7644f0$7e62ced0$@spb.ru> Message-ID: <00d201ca7918$6e663b10$4b32b130$@spb.ru> Hi Charlotte -- Yes, it's easy to create cross-refs, and it's (usually) easy to solve cross-refs under Visual Studio - please provide an example where cross-refs resolving is a really tough task - this sample shouldn't be the case where one decides to resolve cross-refs in a legacy "spaghetti" set of projects IOW we assume we're talking about experienced developers who prevent having "cross-refs" spaghetti by doing code clean-up/refactoring/de-cross-referencing once in a while within a project's sources life-time... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, December 10, 2009 12:12 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# - Thoughts on my methods I have to point out that it is exceptionally easy to create circular references when the projects are set up like this. That's why in our apps we keep all the forms in a project, all the reports in a project, etc. Of course, if we were using libraries rather than projects under the solution, it would be different. But this way, it can get messy fast. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, December 09, 2009 12:59 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# - Thoughts on my methods Hi John -- In fact this is easy (please correct me if I'm wrong): - just reference your child projects from your main project and if you have (sub-)child projects then reference them from child projects; you can also reference child-child-(nephew) projects from parent projects etc... - just avoid having circular references... All that is very similar to MS Access/VBA references but unlike in MS Access/VBA in .NET solutions this referencing always work without any glitches whatever size your solutions are - tens of projects, thousands of customer classes - no problems, no GPFs of Visual Studio (well, for ASP.NET and WPF solutions you can have GPFs but even in that case you'll have all your sources preserved).... <<< I also don't understand why some objects in a referenced project class can be seen but others cannot. >>> That should be your problem/issue: in VS2008 (Prof) you can always try to hint VS asking to "resolve" undefined class name, enum, global var - right click -> Resolve... - if it can't do that - you can always do that manually - but it may be needed to have some custom classes "shuffled" between your projects... <<< the whole "break into projects" idea is turning out to be more work than it might be worth. >>> John, it will pay itself back very quickly - just be patient - I'd guess (based on your software development experience) it will need max one week (in total) of your time to spend mastering that multi-project solutions - and when you're there - only outer space will be your limitation... Just create a very simple sample solution with several projects and try to play with it setting references, moving custom classes from one project to the other, changing namespaces, and using directives... it's really easy - imagine hierarchical catalog where child entries can be referenced/accessed from parent ones, but where sibling entries aren't aware of each other... (if only they do not inherit from the same parent entries...) Thank you. -- Shamil __________ Information from ESET NOD32 Antivirus, version of virus signature database 4674 (20091209) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Wed Dec 9 16:44:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 17:44:08 -0500 Subject: [dba-VB] threading In-Reply-To: <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> References: <4B1FF708.1040700@colbyconsulting.com> <00cf01ca7912$7c9e1eb0$75da5c10$@spb.ru> Message-ID: <4B202838.1080404@colbyconsulting.com> > Why not have several (FE) applications if they are so independent? - all developed within one VS solution but as separate (WinForms) projects sharing the same (set of) class library(-ies)? It seems like that may be what I am doing? I have a single solution. Inside of that solution's physical directory I have multiple projects, each in its own directory. As I expand the solution I do an add / new project from the main solution / project. Doing that takes care of creating a directory structure for each new project, but causes it to be created under the main solution directory. Each project does not depend in any way on any other project, though I do have some shared libraries. Each child project is referenced by the main project, but the child projects do not reference other child projects. Now whether each of these independent projects ends up as individual applications I don't have a clue. I was just tying them together with a single form / menu so that I have one central application to go to to find everything. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John -- > > Why not have several (FE) applications if they are so independent? - all > developed within one VS solution but as separate (WinForms) projects sharing > the same (set of) class library(-ies)? > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 10:14 PM > To: VBA > Subject: [dba-VB] threading > > As mentioned in previous emails, I am developing an application to manage > all of the tasks for the > DBFH. This includes Backing up databases, creating orders, transferring > data between an external > app etc. I am trying to determine how to thread this app such that if I > start a process exporting > data to Accuzip, I could have another process importing data from Accuzip, > and also be working on an > order. > > As things currently stand, each of these tasks is a project and each project > has its own forms and > classes, and anything else necessary for that task. I really do want to be > able to do multiple > things like this at the same time. Exporting data to Accuzip can take > overnight, and actually > consists of an export and a matching import process. It makes perfect sense > (to me) to have threads > doing this kind of thing, and allow me to go back to the main application > and do something else. > > But at what level would I use a thread? Would I use a thread to open the > form that performs the AZ > process? This would allow me to get that started and immediately go back to > the main app and open > another form (using a new thread?) to start processing an order. > > Or would the form open and the button on the form start a thread that > executes the process? If a > form starts a thread, that allows the user (me) to do other things in that > form potentially changing > to a new directory or selecting a different database. Do you disable all > controls on a form when a > thread starts? I never had to think about this in VBA and it is all rather > confusing. > From jwcolby at colbyconsulting.com Wed Dec 9 16:48:36 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 09 Dec 2009 17:48:36 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> References: <4B1FE174.90207@colbyconsulting.com> <00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> Message-ID: <4B202944.8000306@colbyconsulting.com> > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? > From michael at ddisolutions.com.au Wed Dec 9 17:11:11 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 10 Dec 2009 10:11:11 +1100 Subject: [dba-VB] C# - zip / unzip References: <4B1FE174.90207@colbyconsulting.com><00d001ca7912$7e2979a0$7a7c6ce0$@spb.ru> <4B202944.8000306@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0158281F@ddi-01.DDI.local> I've never used it but there are builtin libraries for zipping/unzipping. Look in System.IO.Compression The help file looks, well, helpfull for a change :-) using System; using System.IO; using System.IO.Compression; public class GZipTest { private const int buffer_size = 100; public static int ReadAllBytesFromStream(Stream stream, byte[] buffer) { // Use this method is used to read all bytes from a stream. int offset = 0; int totalCount = 0; while (true) { int bytesRead = stream.Read(buffer, offset, buffer_size); if (bytesRead == 0) { break; } offset += bytesRead; totalCount += bytesRead; } return totalCount; } public static bool CompareData(byte[] buf1, int len1, byte[] buf2, int len2) { // Use this method to compare data from two different buffers. if (len1 != len2) { Console.WriteLine("Number of bytes in two buffer are different {0}:{1}", len1, len2); return false; } for (int i = 0; i < len1; i++) { if (buf1[i] != buf2[i]) { Console.WriteLine("byte {0} is different {1}|{2}", i, buf1[i], buf2[i]); return false; } } Console.WriteLine("All bytes compare."); return true; } public static void GZipCompressDecompress(string filename) { Console.WriteLine("Test compression and decompression on file {0}", filename); FileStream infile; try { // Open the file as a FileStream object. infile = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[infile.Length]; // Read the file to ensure it is readable. int count = infile.Read(buffer, 0, buffer.Length); if (count != buffer.Length) { infile.Close(); Console.WriteLine("Test Failed: Unable to read data from file"); return; } infile.Close(); MemoryStream ms = new MemoryStream(); // Use the newly created memory stream for the compressed data. GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true); Console.WriteLine("Compression"); compressedzipStream.Write(buffer, 0, buffer.Length); // Close the stream. compressedzipStream.Close(); Console.WriteLine("Original size: {0}, Compressed size: {1}", buffer.Length, ms.Length); // Reset the memory stream position to begin decompression. ms.Position = 0; GZipStream zipStream = new GZipStream(ms, CompressionMode.Decompress); Console.WriteLine("Decompression"); byte[] decompressedBuffer = new byte[buffer.Length + buffer_size]; // Use the ReadAllBytesFromStream to read the stream. int totalCount = GZipTest.ReadAllBytesFromStream(zipStream, decompressedBuffer); Console.WriteLine("Decompressed {0} bytes", totalCount); if (!GZipTest.CompareData(buffer, buffer.Length, decompressedBuffer, totalCount)) { Console.WriteLine("Error. The two buffers did not compare."); } zipStream.Close(); } // end try catch (InvalidDataException) { Console.WriteLine("Error: The file being read contains invalid data."); } catch (FileNotFoundException) { Console.WriteLine("Error:The file specified was not found."); } catch (ArgumentException) { Console.WriteLine("Error: path is a zero-length string, contains only white space, or contains one or more invalid characters"); } catch (PathTooLongException) { Console.WriteLine("Error: The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The specified path is invalid, such as being on an unmapped drive."); } catch (IOException) { Console.WriteLine("Error: An I/O error occurred while opening the file."); } catch (UnauthorizedAccessException) { Console.WriteLine("Error: path specified a file that is read-only, the path is a directory, or caller does not have the required permissions."); } catch (IndexOutOfRangeException) { Console.WriteLine("Error: You must provide parameters for MyGZIP."); } } public static void Main(string[] args) { string usageText = "Usage: MYGZIP "; //If no file name is specified, write usage text. if (args.Length == 0) { Console.WriteLine(usageText); } else { if (File.Exists(args[0])) GZipCompressDecompress(args[0]); } } } Cheers Michael M > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? > _______________________________________________ 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 - www.avg.com Version: 9.0.709 / Virus Database: 270.14.99/2553 - Release Date: 12/09/09 06:54:00 From Gustav at cactus.dk Thu Dec 10 04:22:54 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 10 Dec 2009 11:22:54 +0100 Subject: [dba-VB] C# - zip / unzip Message-ID: Hi Michael Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. A bit strange that this widely used function is missing from the framework. /gustav >>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> I've never used it but there are builtin libraries for zipping/unzipping. Look in System.IO.Compression The help file looks, well, helpfull for a change :-) using System; using System.IO; using System.IO.Compression; public class GZipTest { private const int buffer_size = 100; public static int ReadAllBytesFromStream(Stream stream, byte[] buffer) { // Use this method is used to read all bytes from a stream. int offset = 0; int totalCount = 0; while (true) { int bytesRead = stream.Read(buffer, offset, buffer_size); if (bytesRead == 0) { break; } offset += bytesRead; totalCount += bytesRead; } return totalCount; } public static bool CompareData(byte[] buf1, int len1, byte[] buf2, int len2) { // Use this method to compare data from two different buffers. if (len1 != len2) { Console.WriteLine("Number of bytes in two buffer are different {0}:{1}", len1, len2); return false; } for (int i = 0; i < len1; i++) { if (buf1[i] != buf2[i]) { Console.WriteLine("byte {0} is different {1}|{2}", i, buf1[i], buf2[i]); return false; } } Console.WriteLine("All bytes compare."); return true; } public static void GZipCompressDecompress(string filename) { Console.WriteLine("Test compression and decompression on file {0}", filename); FileStream infile; try { // Open the file as a FileStream object. infile = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[infile.Length]; // Read the file to ensure it is readable. int count = infile.Read(buffer, 0, buffer.Length); if (count != buffer.Length) { infile.Close(); Console.WriteLine("Test Failed: Unable to read data from file"); return; } infile.Close(); MemoryStream ms = new MemoryStream(); // Use the newly created memory stream for the compressed data. GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true); Console.WriteLine("Compression"); compressedzipStream.Write(buffer, 0, buffer.Length); // Close the stream. compressedzipStream.Close(); Console.WriteLine("Original size: {0}, Compressed size: {1}", buffer.Length, ms.Length); // Reset the memory stream position to begin decompression. ms.Position = 0; GZipStream zipStream = new GZipStream(ms, CompressionMode.Decompress); Console.WriteLine("Decompression"); byte[] decompressedBuffer = new byte[buffer.Length + buffer_size]; // Use the ReadAllBytesFromStream to read the stream. int totalCount = GZipTest.ReadAllBytesFromStream(zipStream, decompressedBuffer); Console.WriteLine("Decompressed {0} bytes", totalCount); if (!GZipTest.CompareData(buffer, buffer.Length, decompressedBuffer, totalCount)) { Console.WriteLine("Error. The two buffers did not compare."); } zipStream.Close(); } // end try catch (InvalidDataException) { Console.WriteLine("Error: The file being read contains invalid data."); } catch (FileNotFoundException) { Console.WriteLine("Error:The file specified was not found."); } catch (ArgumentException) { Console.WriteLine("Error: path is a zero-length string, contains only white space, or contains one or more invalid characters"); } catch (PathTooLongException) { Console.WriteLine("Error: The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."); } catch (DirectoryNotFoundException) { Console.WriteLine("Error: The specified path is invalid, such as being on an unmapped drive."); } catch (IOException) { Console.WriteLine("Error: An I/O error occurred while opening the file."); } catch (UnauthorizedAccessException) { Console.WriteLine("Error: path specified a file that is read-only, the path is a directory, or caller does not have the required permissions."); } catch (IndexOutOfRangeException) { Console.WriteLine("Error: You must provide parameters for MyGZIP."); } } public static void Main(string[] args) { string usageText = "Usage: MYGZIP "; //If no file name is specified, write usage text. if (args.Length == 0) { Console.WriteLine(usageText); } else { if (File.Exists(args[0])) GZipCompressDecompress(args[0]); } } } Cheers Michael M > Have a look for DotNetNuke sources Thanks, but I am quite sure I would just get lost. You have way too much faith in my C# abilities at this point in time. ;) I have found at least two dlls that can be referenced and used from C#. Each claims to be "managed code" and make the source available, though what that is worth to me is not clear. I just want something that is easy to use and documented so I can figure out how to use it. I have a lot of uses for zip files, from zipping up archives of files for near line storage to making true zip files for shipping to clients. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Have a look for DotNetNuke sources - they have free sources for > zipping/unzipping. > Those sources are used in core DNN functionality (modules setup) - IOW they > tested well, they are stable and thry work very well. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 09, 2009 8:42 PM > To: VBA > Subject: [dba-VB] C# - zip / unzip > > Any recommendations for a well supported (bugs are fixed) library for zip / > unzip for .net? From jwcolby at colbyconsulting.com Thu Dec 10 07:12:44 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 10 Dec 2009 08:12:44 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: References: Message-ID: <4B20F3CC.4090604@colbyconsulting.com> Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple source. Several DLLs out there. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi Michael > > Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. > > A bit strange that this widely used function is missing from the framework. > > /gustav > > >>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> > I've never used it but there are builtin libraries for > zipping/unzipping. > Look in System.IO.Compression From dbdoug at gmail.com Thu Dec 10 08:20:06 2009 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 10 Dec 2009 06:20:06 -0800 Subject: [dba-VB] Slightly O/T - web development stuff Message-ID: <4dd71a0c0912100620w6ef71523w11fba8e1ab39a454@mail.gmail.com> www.sitepoint.com is putting one or more of their books/videos on sale every day this month. A couple of days ago I got seven 20 minute videos on Ajax and css for $15; yesterday I got 3 full books on Javascript/Ajax in pdf form for the same $15. Doug Steele From jwcolby at colbyconsulting.com Sun Dec 13 21:45:18 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 13 Dec 2009 22:45:18 -0500 Subject: [dba-VB] Do you wanna learn c#? Message-ID: <4B25B4CE.9010105@colbyconsulting.com> Have I got the book for you. http://www.amazon.com/Microsoft%C2%AE-XNA%C2%AE-Game-Studio-3-0/dp/0735626588/ref=sr_1_2?ie=UTF8&s=books&qid=1260761698&sr=1-2 I bought this book because I found the XNA studio and wanted to learn all about how it works. But this book is about teaching programming, and from that C#. For anyone who knows vba or VB.net it will start off easy, but for anyone who doesn't program at all it also starts off easy. This might be the best book for learning to program (in general) I have run into. Plus it is fun. You need Visual Studio (express is fine) and you need the XNA studio (it is also free). An XBox 360 game controller will be required pretty quickly. I bought the cheapest controller for $15 from Wally world. Then start reading (and writing). I am on chapter 5 now (in about three days) and working on through it. I swear you will learn C#, have fun while you are at it, AND learn how the XNA game studio framework works which is also an awesome tool. Really folks, this is the real deal, if you have always said "I should..." do this one. Or get your teenager involved in it. I bought the book new from Amazon for about $20, plus the controller. Everything else is free. That is a great deal folks! -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 14 08:47:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Dec 2009 09:47:22 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B20F3CC.4090604@colbyconsulting.com> References: <4B20F3CC.4090604@colbyconsulting.com> Message-ID: <4B264FFA.5020603@colbyconsulting.com> I am working on creating a single field index on every field of a table. I promptly ran into so many problems making it generic that I punted and went back to hard coding the database / table name. I did find this: select Name as FldName from psm11203.sys.columns WHERE object_id = OBJECT_ID('PSM11203.dbo.tblOrderData') Which does give me a table of field names. Using this in a cursor I am then able to create an index on each field, so I am off and running. This is really a one off process that I need to run on my tblHSID - the table from hell from the database from hell. I have to tell you I am a bit hesitant to pull the trigger in this for the table from hell. It is going to take many minutes to build each index and there are well over 500 fields to index. I could end up locking up my database for the next month. ;) I did create a copy, created a clustered index and will be creating all of these indexes on that copy, but even then it pretty much uses all of the resources of the server. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple > source. Several DLLs out there. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi Michael >> >> Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. >> >> A bit strange that this widely used function is missing from the framework. >> >> /gustav >> >> >>>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> >> I've never used it but there are builtin libraries for >> zipping/unzipping. >> Look in System.IO.Compression > > _______________________________________________ > dba-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 Dec 14 09:02:42 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Dec 2009 10:02:42 -0500 Subject: [dba-VB] C# - zip / unzip In-Reply-To: <4B264FFA.5020603@colbyconsulting.com> References: <4B20F3CC.4090604@colbyconsulting.com> <4B264FFA.5020603@colbyconsulting.com> Message-ID: <4B265392.3010107@colbyconsulting.com> Boy did I reply to the wrong email or what??? John W. Colby www.ColbyConsulting.com jwcolby wrote: > I am working on creating a single field index on every field of a table. I promptly ran into so > many problems making it generic that I punted and went back to hard coding the database / table > name. I did find this: > > select Name as FldName from psm11203.sys.columns > WHERE object_id = OBJECT_ID('PSM11203.dbo.tblOrderData') > > Which does give me a table of field names. Using this in a cursor I am then able to create an index > on each field, so I am off and running. > > This is really a one off process that I need to run on my tblHSID - the table from hell from the > database from hell. > > I have to tell you I am a bit hesitant to pull the trigger in this for the table from hell. It is > going to take many minutes to build each index and there are well over 500 fields to index. I could > end up locking up my database for the next month. ;) > > I did create a copy, created a clustered index and will be creating all of these indexes on that > copy, but even then it pretty much uses all of the resources of the server. > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: >> Even more strange that someone hasn't wrapped this into a C# class so that it is available as simple >> source. Several DLLs out there. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Gustav Brock wrote: >>> Hi Michael >>> >>> Neither have I, but I googled a little on the "zubject" and several links tell that this GZip compression is not compatible with WinZip and the like because of missing file info, in other words it should be fine for compressing and decompressing a stream (which of course can be written/read to/from a file) but that's all. >>> >>> A bit strange that this widely used function is missing from the framework. >>> >>> /gustav >>> >>> >>>>>> michael at ddisolutions.com.au 10-12-2009 00:11 >>> >>> I've never used it but there are builtin libraries for >>> zipping/unzipping. >>> Look in System.IO.Compression >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Johncliviger at aol.com Tue Dec 15 04:10:47 2009 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 15 Dec 2009 05:10:47 EST Subject: [dba-VB] A Parameters syntax question Message-ID: Hi All I'm connecting a vb2005 DataGridView to an Access db via vb code to return a subset of records from a table. Using the GUID dataType it works fine but when I change the datatype I get all the records. I'm using the Imports system.Data.OleDb class. From there I have OleDb connection, Command, DataAdapter and a Dataset. EG. With Command .CommandText = "QueryName" .CommandType = CommandType.StoredProcedure .Connection = OleDbConnection .Parameters.Add("@REFNOC", OleDbType.Guid,16).Value = New Guid(REFNOC) end With Every thing works as it should. That is until I change the the datatype in the Parameter line and try to use a string or Integer. I can't get the syntax right for the .Parameters line. If for example I change the .Parameter to say .Parameters.Add("@REFNOC", OleDbType.Single).Value = REFNOC I get all records Can anyone cast a little light here? From Johncliviger at aol.com Tue Dec 15 04:39:12 2009 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 15 Dec 2009 05:39:12 EST Subject: [dba-VB] Parameters problem solved Message-ID: Now then who's a silly boy! When using parameters in vb.net connection one does need to specify the parameter in the back-end query!! Then it works a treat johncliviger From jwcolby at colbyconsulting.com Wed Dec 16 16:20:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 16 Dec 2009 17:20:08 -0500 Subject: [dba-VB] windows 7 media center Message-ID: <4B295D18.7070000@colbyconsulting.com> Well my Vista Windows Media Center (WMC) finally bit the dust. Something happened (a SP install I suspect) and the codec got trashed (I think) and suddenly WMC no workee - no tv of any kind, already recorded or off of the tv card. As a college student I qualify to buy a copy of Windows 7 for $29 which sounded too good to pass up. And that version supposedly had a much improved MCE. So I did. Bought it, and installed it ON A 30 gb FLASH DRIVE last night. Finished about 3:30 am. She workee again. In the meantime I also went from a low power dual core to a medium powered quad core, but twice the ghz rating. Needless to say the Home theater PC flies. Now if it will just work for a long time with no maintenance. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 17 20:37:41 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 17 Dec 2009 21:37:41 -0500 Subject: [dba-VB] SQL Server 2008 install broke my application Message-ID: <4B2AEAF5.3080201@colbyconsulting.com> A perfectly functioning application has all kinds of compile errors after the SQL Server install. A bunch of Microsoft.SQLServer.XXX references had to be deleted and rereferenced. The sole remaining issue that I still haven't gotten around is the Transfer object, supposedly part of the SMO object is suddenly gone missing. And I was using that to copy a database and all of its internal objects. Sigh. -- John W. Colby www.ColbyConsulting.com From bheid at sc.rr.com Sun Dec 20 00:29:55 2009 From: bheid at sc.rr.com (Bobby Heid) Date: Sun, 20 Dec 2009 01:29:55 -0500 Subject: [dba-VB] SQL Server 2008 install broke my application In-Reply-To: <4B2AEAF5.3080201@colbyconsulting.com> References: <4B2AEAF5.3080201@colbyconsulting.com> Message-ID: <000301ca813d$d82a7610$887f6230$@rr.com> Hey John, Did you install the SQL Client Tools? I was just reading something about this today. I think the SMO stuff is installed with the client tools. I am not positive though. If this does not solve your issue, I'll see if I can find that reference tomorrow. Bobby -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 17, 2009 9:38 PM To: VBA Subject: [dba-VB] SQL Server 2008 install broke my application A perfectly functioning application has all kinds of compile errors after the SQL Server install. A bunch of Microsoft.SQLServer.XXX references had to be deleted and rereferenced. The sole remaining issue that I still haven't gotten around is the Transfer object, supposedly part of the SMO object is suddenly gone missing. And I was using that to copy a database and all of its internal objects. Sigh. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sun Dec 20 09:29:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 20 Dec 2009 10:29:39 -0500 Subject: [dba-VB] SPAM-LOW: Re: SQL Server 2008 install broke my application In-Reply-To: <000301ca813d$d82a7610$887f6230$@rr.com> References: <4B2AEAF5.3080201@colbyconsulting.com> <000301ca813d$d82a7610$887f6230$@rr.com> Message-ID: <4B2E42E3.4090208@colbyconsulting.com> I checked every box on the install. John W. Colby www.ColbyConsulting.com Bobby Heid wrote: > Hey John, > > Did you install the SQL Client Tools? I was just reading something about > this today. I think the SMO stuff is installed with the client tools. I am > not positive though. If this does not solve your issue, I'll see if I can > find that reference tomorrow. > > Bobby > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 17, 2009 9:38 PM > To: VBA > Subject: [dba-VB] SQL Server 2008 install broke my application > > A perfectly functioning application has all kinds of compile errors after > the SQL Server install. A > bunch of Microsoft.SQLServer.XXX references had to be deleted and > rereferenced. The sole remaining > issue that I still haven't gotten around is the Transfer object, supposedly > part of the SMO object > is suddenly gone missing. And I was using that to copy a database and all > of its internal objects. > > Sigh. > From jwcolby at colbyconsulting.com Tue Dec 22 10:18:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 22 Dec 2009 11:18:12 -0500 Subject: [dba-VB] Multimonitor toolbar Message-ID: <4B30F144.6090504@colbyconsulting.com> I just found this, WAY COOL! It puts a toolbar at the bottom of the second monitor that displays the icons for the programs being displayed on the second monitor. How come no one told me about this? http://www.mediachance.com/free/multimon.htm -- John W. Colby www.ColbyConsulting.com From paul.hartland at googlemail.com Thu Dec 24 06:09:00 2009 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 24 Dec 2009 12:09:00 +0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False Message-ID: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com From andy at minstersystems.co.uk Thu Dec 24 06:59:11 2009 From: andy at minstersystems.co.uk (Andy Lacey) Date: Thu, 24 Dec 2009 12:59:11 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> Message-ID: <153B93F23C804502875134D824C863BA@MINSTER> Hi Paul Well I'll wait to be corrected but I reckon they're simply two syntactically different ways of saying the same thing. They'd surely compile into the same code. So it just comes down to preference of style and readability, i.e. totally subjective Andy -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: 24 December 2009 12:09 To: VisualBasicList Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Thu Dec 24 07:07:18 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 24 Dec 2009 13:07:18 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <153B93F23C804502875134D824C863BA@MINSTER> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> <153B93F23C804502875134D824C863BA@MINSTER> Message-ID: <4b33679b.0e67f10a.2282.ffffa79b@mx.google.com> Or you could do this (which I prefer) If not rst.eof then Do my stuff Else Msgbox "who nicked my records" Endif Ps. Who is the programmer? You, or the Project Manager? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Andy Lacey Sent: 24 December 2009 12:59 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False Hi Paul Well I'll wait to be corrected but I reckon they're simply two syntactically different ways of saying the same thing. They'd surely compile into the same code. So it just comes down to preference of style and readability, i.e. totally subjective Andy -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: 24 December 2009 12:09 To: VisualBasicList Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False To all, I use a lot of recordsets, and to detect they actually contain something I have always used the following: If myrecordset.bof=false and myrecordset.eof=false then do my stuff here Else msgbox "empty" End If However my project manager prefers: If not myrecordset.bof and not myrecordset.eof then do my stuff here Else msgbox "empty" End If Is there actually a prefered way, or is one quicker than the other, or is there an even better way to do this ? Thanks in advance for any comments, and a very merry christmas & happy new year to everyone. -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 24 10:14:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 24 Dec 2009 11:14:22 -0500 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> Message-ID: <4B33935E.5000607@colbyconsulting.com> Paul, Perhaps better would be: if MyRecordset.BOF and MyRecordset.EOF then msgbox "Empty" else do stuff here endif It is easier to read the true than the nots, especially when there is more than one. Either one works. If this is in a tight loop and speed matters, then the NOT might cause a very slight slowdown as it is two extra boolean operators. OTOH the compiler might just pick it up and rewrite it to my syntax anyway. John W. Colby www.ColbyConsulting.com Paul Hartland wrote: > To all, > > I use a lot of recordsets, and to detect they actually contain something I > have always used the following: > > If myrecordset.bof=false and myrecordset.eof=false then > do my stuff here > Else > msgbox "empty" > End If > > However my project manager prefers: > If not myrecordset.bof and not myrecordset.eof then > do my stuff here > Else > msgbox "empty" > End If > > Is there actually a prefered way, or is one quicker than the other, or is > there an even better way to do this ? > > Thanks in advance for any comments, and a very merry christmas & happy new > year to everyone. > From max.wanadoo at gmail.com Thu Dec 24 12:13:13 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 24 Dec 2009 18:13:13 -0000 Subject: [dba-VB] Just a Christmas quickie Using Not Instead of = False In-Reply-To: <4B33935E.5000607@colbyconsulting.com> References: <38c884770912240409v7becad65te771430652a0472d@mail.gmail.com> <4B33935E.5000607@colbyconsulting.com> Message-ID: <4b33af5b.1067f10a.3ae6.ffffb846@mx.google.com> John, I don't think that will work...something from Getz etc sticks in my mind...might be old age though. maxx -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 24 December 2009 16:14 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Just a Christmas quickie Using Not Instead of = False Paul, Perhaps better would be: if MyRecordset.BOF and MyRecordset.EOF then msgbox "Empty" else do stuff here endif It is easier to read the true than the nots, especially when there is more than one. Either one works. If this is in a tight loop and speed matters, then the NOT might cause a very slight slowdown as it is two extra boolean operators. OTOH the compiler might just pick it up and rewrite it to my syntax anyway. John W. Colby www.ColbyConsulting.com Paul Hartland wrote: > To all, > > I use a lot of recordsets, and to detect they actually contain something I > have always used the following: > > If myrecordset.bof=false and myrecordset.eof=false then > do my stuff here > Else > msgbox "empty" > End If > > However my project manager prefers: > If not myrecordset.bof and not myrecordset.eof then > do my stuff here > Else > msgbox "empty" > End If > > Is there actually a prefered way, or is one quicker than the other, or is > there an even better way to do this ? > > Thanks in advance for any comments, and a very merry christmas & happy new > year to everyone. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 31 16:29:43 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 31 Dec 2009 17:29:43 -0500 Subject: [dba-VB] Happy new year Message-ID: <4B3D25D7.2030404@colbyconsulting.com> I will likely be asleep when it actually happens locally, so I wish each and every one of you a MUCH better year in 2010. HAPPY NEW YEAR! -- John W. Colby www.ColbyConsulting.com From garykjos at gmail.com Thu Dec 31 16:35:55 2009 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 31 Dec 2009 16:35:55 -0600 Subject: [dba-VB] [AccessD] Happy new year In-Reply-To: <4B3D25D7.2030404@colbyconsulting.com> References: <4B3D25D7.2030404@colbyconsulting.com> Message-ID: Likewise for me too John. Early to bed, early to rise is my program for the most part. I echo your sentiments. Happy New Year! GK On Thu, Dec 31, 2009 at 4:29 PM, jwcolby wrote: > I will likely be asleep when it actually happens locally, so I wish each and every one of you a MUCH > better year in 2010. > > HAPPY NEW YEAR! > > -- > John W. Colby > www.ColbyConsulting.com -- Gary Kjos garykjos at gmail.com